diff --git a/config/standalone/standalone-chip.mk b/config/standalone/standalone-chip.mk index e189f64736764f..184a67bf19afcc 100644 --- a/config/standalone/standalone-chip.mk +++ b/config/standalone/standalone-chip.mk @@ -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) @@ -135,6 +135,7 @@ STD_LDFLAGS += -L$(CHIP_OUTPUT_DIR)/lib # Add CHIP libraries to standard libraries list. STD_LIBS += \ -lCHIP \ + -lDeviceLayer \ -lInetLayer \ -lnlfaultinjection \ -lSystemLayer @@ -149,6 +150,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 diff --git a/configure.ac b/configure.ac index b48c5c0761fa09..413535d725393b 100644 --- a/configure.ac +++ b/configure.ac @@ -996,11 +996,11 @@ AC_DEFINE_UNQUOTED([CONFIG_NETWORK_LAYER_INET],[${CONFIG_NETWORK_LAYER_INET}],[D AC_MSG_CHECKING([device layer]) AC_ARG_WITH(device-layer, [AS_HELP_STRING([--with-device-layer=LAYER], - [Specify the target environment for the CHIP Device Layer. Choose one of: darwin, efr32, esp32, nrf5, linux, or none @<:@default=none@:>@.])], + [Specify the target environment for the CHIP Device Layer. Choose one of: auto, darwin, efr32, esp32, nrf5, linux, or none @<:@default=auto@:>@.])], [ case "${with_device_layer}" in - darwin|efr32|esp32|nrf5|linux|none) + auto|darwin|efr32|esp32|nrf5|linux|none) ;; *) @@ -1009,7 +1009,7 @@ AC_ARG_WITH(device-layer, esac ], - [with_device_layer=none]) + [with_device_layer=auto]) AC_MSG_RESULT(${with_device_layer}) # Disable all device layer targets by default @@ -1019,6 +1019,24 @@ CHIP_DEVICE_LAYER_TARGET_ESP32=0 CHIP_DEVICE_LAYER_TARGET_NRF5=0 CHIP_DEVICE_LAYER_TARGET_LINUX=0 +if test "${with_device_layer}" = "auto"; then + case ${target_os} in + + *darwin*) + with_device_layer=darwin + ;; + + *linux*) + with_device_layer=linux + ;; + + *) + with_device_layer=none + ;; + + esac +fi + case "${with_device_layer}" in darwin) diff --git a/src/include/platform/CHIPDeviceEvent.h b/src/include/platform/CHIPDeviceEvent.h index 337e3b1d2a1918..ace79c752268ef 100644 --- a/src/include/platform/CHIPDeviceEvent.h +++ b/src/include/platform/CHIPDeviceEvent.h @@ -275,6 +275,7 @@ typedef void (*AsyncWorkFunct)(intptr_t arg); #include CHIPDEVICEPLATFORMEVENT_HEADER #endif +#include #include namespace chip { diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index 8021582df42bf1..106eaab5f75821 100644 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -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); diff --git a/src/platform/Makefile.am b/src/platform/Makefile.am index dbc8b725b9f76f..482151030eda98 100644 --- a/src/platform/Makefile.am +++ b/src/platform/Makefile.am @@ -50,6 +50,15 @@ noinst_HEADERS = \ @top_srcdir@/src/include/platform/internal/EventLogging.h \ @top_srcdir@/src/include/platform/internal/GenericConfigurationManagerImpl.h \ @top_srcdir@/src/include/platform/internal/GenericConfigurationManagerImpl.ipp \ + @top_srcdir@/src/include/platform/internal/GenericConnectivityManagerImpl.h \ + @top_srcdir@/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h \ + @top_srcdir@/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.ipp \ + @top_srcdir@/src/include/platform/internal/GenericConnectivityManagerImpl_NoBLE.h \ + @top_srcdir@/src/include/platform/internal/GenericConnectivityManagerImpl_NoThread.h \ + @top_srcdir@/src/include/platform/internal/GenericConnectivityManagerImpl_NoTunnel.h \ + @top_srcdir@/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h \ + @top_srcdir@/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h \ + @top_srcdir@/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.ipp \ @top_srcdir@/src/include/platform/internal/GenericPlatformManagerImpl.h \ @top_srcdir@/src/include/platform/internal/GenericPlatformManagerImpl.ipp \ @top_srcdir@/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.h \ @@ -61,8 +70,11 @@ noinst_HEADERS = \ @top_srcdir@/src/include/platform/internal/CHIPDeviceLayerInternal.h \ @top_srcdir@/src/platform/Darwin/CHIPDevicePlatformConfig.h \ @top_srcdir@/src/platform/Darwin/CHIPDevicePlatformEvent.h \ + @top_srcdir@/src/platform/Darwin/CHIPPlatformConfig.h \ @top_srcdir@/src/platform/Darwin/ConfigurationManagerImpl.h \ + @top_srcdir@/src/platform/Darwin/ConnectivityManagerImpl.h \ @top_srcdir@/src/platform/Darwin/PlatformManagerImpl.h \ + @top_srcdir@/src/platform/Darwin/PosixConfig.h \ @top_srcdir@/src/platform/nRF5/ConnectivityManagerImpl.h \ @top_srcdir@/src/platform/nRF5/nRF5Config.h \ @top_srcdir@/src/platform/nRF5/CHIPDevicePlatformConfig.h \ @@ -93,8 +105,12 @@ noinst_HEADERS = \ @top_srcdir@/src/platform/ESP32/ESP32Config.h \ @top_srcdir@/src/platform/Linux/CHIPDevicePlatformConfig.h \ @top_srcdir@/src/platform/Linux/CHIPDevicePlatformEvent.h \ + @top_srcdir@/src/platform/Linux/CHIPPlatformConfig.h \ @top_srcdir@/src/platform/Linux/ConfigurationManagerImpl.h \ + @top_srcdir@/src/platform/Linux/ConnectivityManagerImpl.h \ @top_srcdir@/src/platform/Linux/PlatformManagerImpl.h \ + @top_srcdir@/src/platform/Linux/PosixConfig.h \ + @top_srcdir@/src/include/platform/testing/ConfigUnitTest.h \ $(NULL) if CONFIG_DEVICE_LAYER diff --git a/third_party/mbedtls/Makefile.am b/third_party/mbedtls/Makefile.am index 3fd8a7fdfce1d1..94912fdf42ed08 100644 --- a/third_party/mbedtls/Makefile.am +++ b/third_party/mbedtls/Makefile.am @@ -122,6 +122,13 @@ nodist_libmbedtls_a_SOURCES += $(NULL) endif +if CHIP_DEVICE_LAYER_TARGET_LINUX +nodist_libmbedtls_a_SOURCES += \ + repo/library/entropy_poll.c \ + repo/library/timing.c \ + $(NULL) +endif + libmbedtls_a_CPPFLAGS = \ -I$(top_srcdir)/third_party/mbedtls/repo/include \ $(MBEDTLS_CPPFLAGS) \