Skip to content

Commit

Permalink
Glue standalone application to a device layer for POSIX platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple committed Jul 9, 2020
1 parent c56ec54 commit 8972c7b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Makefile-Standalone
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ ifeq ($(ENABLE_CHIPOBLE_TEST),1)
configure_OPTIONS += --enable-chipoble-test=yes
endif

ifeq ($(HOSTOS),darwin)
configure_OPTIONS += --with-device-layer=darwin
endif

ifeq ($(HOSTOS),linux)
configure_OPTIONS += --with-device-layer=linux
endif

ifndef BuildJobs
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
endif
Expand Down
14 changes: 12 additions & 2 deletions config/standalone/standalone-chip.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ CHIP_OUTPUT_DIR = $(OUTPUT_DIR)/chip
# An optional file containing application-specific configuration overrides.
CHIP_PROJECT_CONFIG = $(wildcard $(PROJECT_ROOT)/include/CHIPProjectConfig.h)

# Architcture on which CHIP is being built.
# Architecture on which CHIP is being built.
CHIP_BUILD_ARCH = $(shell $(CHIP_ROOT)/third_party/nlbuild-autotools/repo/third_party/autoconf/config.guess | sed -e 's/[[:digit:].]*$$//g')

# Archtecture for which CHIP will be built.
# Architecture for which CHIP will be built.
CHIP_HOST_ARCH := $(CHIP_BUILD_ARCH)


Expand Down Expand Up @@ -114,6 +114,14 @@ else
CHIP_CONFIGURE_OPTIONS += --enable-optimization=no
endif

# Enable a device layer depending on the target
ifeq ($(findstring darwin,$(CHIP_HOST_ARCH)),darwin)
CHIP_CONFIGURE_OPTIONS += --with-device-layer=darwin
endif

ifeq ($(findstring linux,$(CHIP_HOST_ARCH)),linux)
CHIP_CONFIGURE_OPTIONS += --with-device-layer=linux
endif

# ==================================================
# Adjustments to standard build settings to
Expand All @@ -135,6 +143,7 @@ STD_LDFLAGS += -L$(CHIP_OUTPUT_DIR)/lib
# Add CHIP libraries to standard libraries list.
STD_LIBS += \
-lCHIP \
-lDeviceLayer \
-lInetLayer \
-lnlfaultinjection \
-lSystemLayer
Expand All @@ -149,6 +158,7 @@ STD_COMPILE_PREREQUISITES += install-chip
# Add the CHIP libraries as prerequisites for linking the application.
STD_LINK_PREREQUISITES += \
$(CHIP_OUTPUT_DIR)/lib/libCHIP.a \
$(CHIP_OUTPUT_DIR)/lib/libDeviceLayer.a \
$(CHIP_OUTPUT_DIR)/lib/libInetLayer.a \
$(CHIP_OUTPUT_DIR)/lib/libnlfaultinjection.a \
$(CHIP_OUTPUT_DIR)/lib/libSystemLayer.a
Expand Down
1 change: 1 addition & 0 deletions src/include/platform/CHIPDeviceEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ typedef void (*AsyncWorkFunct)(intptr_t arg);
#include CHIPDEVICEPLATFORMEVENT_HEADER
#endif

#include <ble/BleConfig.h>
#include <system/SystemPacketBuffer.h>

namespace chip {
Expand Down
2 changes: 1 addition & 1 deletion src/include/platform/ConnectivityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class ConnectivityManager
bool HaveServiceConnectivity(void);

// CHIPoBLE service methods
typedef void (*BleConnectionReceivedFunct)(BLEEndPoint * endpoint);
typedef void (*BleConnectionReceivedFunct)(Ble::BLEEndPoint * endpoint);
void AddCHIPoBLEConnectionHandler(BleConnectionReceivedFunct handler);
void RemoveCHIPoBLEConnectionHandler(void);
CHIPoBLEServiceMode GetCHIPoBLEServiceMode(void);
Expand Down

0 comments on commit 8972c7b

Please sign in to comment.