-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yyy
committed
Dec 10, 2024
1 parent
061d97c
commit 1055681
Showing
14 changed files
with
3,387 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# * http://www.apache.org/licenses/LICENSE-2.0 | ||
# * Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
# Toolchain commands | ||
CROSS_COMPILE ?= | ||
CC := ccache $(CROSS_COMPILE)gcc | ||
CXX := ccache $(CROSS_COMPILE)g++ | ||
LD := $(CROSS_COMPILE)gcc | ||
AR := $(CROSS_COMPILE)ar | ||
AS := $(CROSS_COMPILE)as | ||
NM := $(CROSS_COMPILE)nm | ||
OBJDUMP := $(CROSS_COMPILE)objdump | ||
OBJCOPY := $(CROSS_COMPILE)objcopy | ||
SIZE := $(CROSS_COMPILE)size | ||
|
||
# Configure NimBLE variables | ||
NIMBLE_ROOT := ../../.. | ||
NIMBLE_CFG_TINYCRYPT := 1 | ||
|
||
# Skip files that don't build for this port | ||
NIMBLE_IGNORE := $(NIMBLE_ROOT)/porting/nimble/src/hal_timer.c \ | ||
$(NIMBLE_ROOT)/porting/nimble/src/os_cputime.c \ | ||
$(NIMBLE_ROOT)/porting/nimble/src/os_cputime_pwr2.c \ | ||
$(NULL) | ||
|
||
include $(NIMBLE_ROOT)/porting/nimble/Makefile.defs | ||
include $(NIMBLE_ROOT)/porting/nimble/Makefile.mesh | ||
|
||
SRC := $(NIMBLE_SRC) | ||
|
||
# Source files for NPL OSAL | ||
SRC += \ | ||
$(wildcard $(NIMBLE_ROOT)/porting/npl/linux/src/*.c) \ | ||
$(wildcard $(NIMBLE_ROOT)/porting/npl/linux/src/*.cc) \ | ||
$(wildcard $(NIMBLE_ROOT)/nimble/transport/socket/src/*.c) \ | ||
$(TINYCRYPT_SRC) \ | ||
$(wildcard $(NIMBLE_ROOT)/nimble/host/mesh/src/*.c) \ | ||
$(NULL) | ||
|
||
# Source files for demo app | ||
SRC += \ | ||
./src/main.c \ | ||
./src/ble.c \ | ||
./shell/shell_port.c \ | ||
./shell/console_port.c \ | ||
$(NULL) | ||
|
||
# Add NPL and all NimBLE directories to include paths | ||
INC = \ | ||
./include \ | ||
$(NIMBLE_ROOT)/porting/npl/linux/include \ | ||
$(NIMBLE_ROOT)/porting/npl/linux/src \ | ||
$(NIMBLE_ROOT)/nimble/transport/socket/include \ | ||
$(NIMBLE_INCLUDE) \ | ||
$(TINYCRYPT_INCLUDE) \ | ||
$(NULL) | ||
|
||
INCLUDES := $(addprefix -I, $(INC)) | ||
|
||
SRC_C = $(filter %.c, $(SRC)) | ||
SRC_CC = $(filter %.cc, $(SRC)) | ||
|
||
OBJ := $(SRC_C:.c=.o) | ||
OBJ += $(SRC_CC:.cc=.o) | ||
|
||
TINYCRYPT_OBJ := $(TINYCRYPT_SRC:.c=.o) | ||
|
||
CFLAGS = \ | ||
$(NIMBLE_CFLAGS) \ | ||
$(INCLUDES) \ | ||
-g \ | ||
-D_GNU_SOURCE \ | ||
$(NULL) | ||
|
||
LIBS := $(NIMBLE_LDFLAGS) -lrt -lpthread -lstdc++ | ||
|
||
.PHONY: all clean | ||
.DEFAULT: all | ||
|
||
all: nimble-linux-blemesh-shell | ||
|
||
clean: | ||
rm $(OBJ) -f | ||
rm nimble-linux-blemesh-shell -f | ||
|
||
$(TINYCRYPT_OBJ): CFLAGS+=$(TINYCRYPT_CFLAGS) | ||
|
||
%.o: %.c | ||
$(CC) -c $(INCLUDES) $(CFLAGS) -o $@ $< | ||
|
||
%.o: %.cc | ||
$(CXX) -c $(INCLUDES) $(CFLAGS) -o $@ $< | ||
|
||
nimble-linux-blemesh-shell: $(OBJ) $(TINYCRYPT_OBJ) | ||
$(LD) -o $@ $^ $(LIBS) | ||
$(SIZE) $@ |
Binary file not shown.
40 changes: 40 additions & 0 deletions
40
porting/examples/linux_blemesh_shell/include/console/console_port.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
#ifndef __CONSOLE_PORT_H__ | ||
#define __CONSOLE_PORT_H__ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include "nimble/nimble_npl.h" | ||
struct os_eventq; | ||
|
||
void console_set_queues(struct os_eventq *avail, struct os_eventq *lines); | ||
|
||
void console_set_event_cb(ble_npl_event_fn *cb); | ||
|
||
int console_init(); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
Oops, something went wrong.