diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index 89ce34049850a6..86861abbf6d950 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -78,8 +78,8 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --target bouffalolab-bl706-night-light-light \ - --target bouffalolab-bl706-eth-light \ - --target bouffalolab-bl706-wifi-light \ + --target bouffalolab-bl706dk-light-ethernet \ + --target bouffalolab-bl706dk-light-wifi-fp \ --target bouffalolab-xt-zb6-devkit-light-115200-rpc \ build \ --copy-artifacts-to out/artifacts \ @@ -92,11 +92,11 @@ jobs: /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ bl702 bl706-eth lighting-app \ - out/artifacts/bouffalolab-bl706-eth-light/chip-bl702-lighting-example.out \ + out/artifacts/bouffalolab-bl706dk-light-ethernet/chip-bl702-lighting-example.out \ /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ bl702 bl706-wifi lighting-app \ - out/artifacts/bouffalolab-bl706-wifi-light/chip-bl702-lighting-example.out \ + out/artifacts/bouffalolab-bl706dk-light-wifi-fp/chip-bl702-lighting-example.out \ /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ bl702 bl702+rpc lighting-app \ @@ -110,7 +110,7 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target bouffalolab-bl704l-dvk-light \ + --target bouffalolab-bl704ldk-light \ build \ --copy-artifacts-to out/artifacts \ " @@ -118,7 +118,7 @@ jobs: run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ bl702l bl702l lighting-app \ - out/artifacts/bouffalolab-bl704l-dvk-light/chip-bl702l-lighting-example.out \ + out/artifacts/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.out \ /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out diff --git a/examples/lighting-app/bouffalolab/bl602/BUILD.gn b/examples/lighting-app/bouffalolab/bl602/BUILD.gn index 3470110722b5fe..aba8c463ac7ade 100644 --- a/examples/lighting-app/bouffalolab/bl602/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl602/BUILD.gn @@ -32,10 +32,8 @@ if (chip_enable_pw_rpc) { assert(current_os == "freertos") -example_common_dir = "${chip_root}/examples/lighting-app/bouffalolab/common" -example_dir = "${chip_root}/examples/lighting-app/bouffalolab/bl602" -examples_plat_common_dir = "${chip_root}/examples/platform/bouffalolab/common" -examples_plat_dir = "${chip_root}/examples/platform/bouffalolab/bl602" +example_dir = "${chip_root}/examples/lighting-app/bouffalolab" +examples_plat_dir = "${chip_root}/examples/platform/bouffalolab" declare_args() { # Dump memory usage at link time. @@ -60,12 +58,15 @@ declare_args() { bl_iot_sdk("sdk") { include_dirs = [ + "${example_dir}/bl602", + "${examples_plat_dir}/bl602", + "${examples_plat_dir}/bl602/lwipopts", + "${examples_plat_dir}/common/route_hook", "${chip_root}/src/platform/bouffalolab/BL602", - "${example_dir}", - "${example_dir}/include", + "${chip_root}/src/platform/bouffalolab/common", ] - freertos_config = "${examples_plat_dir}/FreeRTOSConfig.h" + freertos_config = "${examples_plat_dir}/bl602/FreeRTOSConfig.h" defines = [ "INCLUDE_xSemaphoreGetMutexHolder=1", @@ -75,19 +76,20 @@ bl_iot_sdk("sdk") { "OTA_AUTO_REBOOT_DELAY=${ota_auto_reboot_delay_seconds}", "CHIP_UART_BAUDRATE=${baudrate}", "SYS_AOS_LOOP_ENABLE", + "CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE=48", ] if (chip_enable_pw_rpc) { - include_dirs += [ "${examples_plat_common_dir}/rpc" ] + include_dirs += [ "${examples_plat_dir}/common/rpc" ] defines += [ "PW_RPC_ENABLED=1" ] defines += [ "DISABLE_PRINT=1" ] } else if (chip_build_libshell) { - include_dirs += [ "${examples_plat_common_dir}/plat" ] + include_dirs += [ "${examples_plat_dir}/common/plat" ] } } chip_data_model("bouffalolab-lighting") { - zap_file = "${example_dir}/../data_model/lighting-app-wifi.zap" + zap_file = "${example_dir}/data_model/lighting-app-wifi.zap" zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" is_server = true @@ -99,19 +101,31 @@ bouffalolab_executable("lighting_app") { defines = [ "APP_TASK_STACK_SIZE=2044", "CHIP_UART_BAUDRATE=${baudrate}", - "BL602_ENABLE", + "BL602_ENABLE=1", "START_ENTRY=bfl_main", "SYS_AOS_LOOP_ENABLE", ] + if (enable_debug_frame_ptr) { + defines += [ "CONF_ENABLE_FRAME_PTR=1" ] + } + if (false == enable_reset_counter) { defines += [ "BOOT_PIN_RESET=8" ] } + if (chip_enable_factory_data) { + defines += [ "CONFIG_BOUFFALOLAB_FACTORY_DATA_ENABLE" ] + } + + if (chip_enable_factory_data_test) { + defines += [ "CONFIG_BOUFFALOLAB_FACTORY_DATA_TEST" ] + } + bl_plat_name = "bl602" sources = [ - "${examples_plat_common_dir}/route_hook/bl_route_hook.c", - "${examples_plat_common_dir}/route_hook/bl_route_table.c", + "${examples_plat_dir}/common/route_hook/bl_route_hook.c", + "${examples_plat_dir}/common/route_hook/bl_route_table.c", ] if ("BL602-IoT-Matter-V1" == board) { @@ -122,15 +136,16 @@ bouffalolab_executable("lighting_app") { sources += [ "${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp", - "${example_common_dir}/AppTask.cpp", - "${example_common_dir}/ZclCallbacks.cpp", - "${examples_plat_common_dir}/plat/LEDWidget.cpp", - "${examples_plat_common_dir}/plat/OTAConfig.cpp", - "${examples_plat_common_dir}/plat/aos_task.c", - "${examples_plat_common_dir}/plat/demo_pwm.c", - "${examples_plat_common_dir}/plat/main.cpp", - "${examples_plat_common_dir}/plat/platform.cpp", - "${examples_plat_common_dir}/plat/uart.c", + "${example_dir}/common/AppTask.cpp", + "${example_dir}/common/ZclCallbacks.cpp", + "${examples_plat_dir}/common/iot_sdk/aos_task.c", + "${examples_plat_dir}/common/iot_sdk/demo_pwm.c", + "${examples_plat_dir}/common/iot_sdk/platform_port.c", + "${examples_plat_dir}/common/iot_sdk/uart.c", + "${examples_plat_dir}/common/plat/LEDWidget.cpp", + "${examples_plat_dir}/common/plat/OTAConfig.cpp", + "${examples_plat_dir}/common/plat/main.cpp", + "${examples_plat_dir}/common/plat/platform.cpp", ] deps = [ @@ -144,10 +159,12 @@ bouffalolab_executable("lighting_app") { include_dirs = [ "${chip_root}/src/platform/bouffalolab/BL602", - "${example_common_dir}", - "${examples_plat_common_dir}/route_hook", - "${examples_plat_common_dir}/plat", - "${examples_plat_dir}", + "${example_dir}/common", + "${example_dir}/bl602", + "${examples_plat_dir}/bl602/lwipopts", + "${examples_plat_dir}/common/route_hook", + "${examples_plat_dir}/common/plat", + "${examples_plat_dir}/common/iot_sdk", ] if (chip_enable_pw_rpc) { @@ -165,8 +182,8 @@ bouffalolab_executable("lighting_app") { sources += [ "${chip_root}/examples/common/pigweed/RpcService.cpp", "${chip_root}/examples/common/pigweed/bouffalolab/PigweedLoggerMutex.cpp", - "${examples_plat_common_dir}/rpc/PigweedLogger.cpp", - "${examples_plat_common_dir}/rpc/Rpc.cpp", + "${examples_plat_dir}/common/rpc/PigweedLogger.cpp", + "${examples_plat_dir}/common/rpc/Rpc.cpp", ] deps += [ @@ -184,7 +201,7 @@ bouffalolab_executable("lighting_app") { "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", - "${examples_plat_common_dir}/rpc/pw_sys_io:pw_sys_io", + "${examples_plat_dir}/common/rpc/pw_sys_io:pw_sys_io", ] public_deps = [ @@ -210,12 +227,12 @@ bouffalolab_executable("lighting_app") { } if (enable_heap_monitoring) { - sources += [ "${examples_plat_common_dir}/plat/MemMonitoring.cpp" ] + sources += [ "${examples_plat_dir}/common/plat/MemMonitoring.cpp" ] defines += [ "HEAP_MONITORING=1" ] } cflags_c = [ "-Wno-sign-compare" ] - ldscript = "${examples_plat_dir}/ldscripts/flash_rom.ld" + ldscript = "${examples_plat_dir}/bl602/ldscripts/flash_rom.ld" ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] diff --git a/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h b/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h index d265e16693b9b2..51430ca4e69d92 100644 --- a/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h +++ b/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h @@ -113,6 +113,4 @@ #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 -#define CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE 128 - #define CHIP_BLE_DEVICE_NAME "MatterLight" diff --git a/examples/lighting-app/bouffalolab/bl602/board.h b/examples/lighting-app/bouffalolab/bl602/mboard.h similarity index 95% rename from examples/lighting-app/bouffalolab/bl602/board.h rename to examples/lighting-app/bouffalolab/bl602/mboard.h index 4e98b267f9acf9..9698dd83769601 100644 --- a/examples/lighting-app/bouffalolab/bl602/board.h +++ b/examples/lighting-app/bouffalolab/bl602/mboard.h @@ -60,4 +60,4 @@ #endif #define CHIP_UART_PIN_RX 7 -#define CHIP_UART_PIN_TX 16 +#define CHIP_UART_PIN_TX 16 \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/bl702/BUILD.gn b/examples/lighting-app/bouffalolab/bl702/BUILD.gn index 47ba339669ca8e..bed6db25db81fd 100644 --- a/examples/lighting-app/bouffalolab/bl702/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702/BUILD.gn @@ -20,6 +20,7 @@ import("${bouffalolab_iot_sdk_build_root}/bl702/bl_iot_sdk.gni") import("${bouffalolab_iot_sdk_build_root}/common/bouffalolab_executable.gni") import("${build_root}/config/defaults.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/bouffalolab/common/args.gni") import("${chip_root}/src/platform/device.gni") import("${chip_root}/src/app/chip_data_model.gni") @@ -31,10 +32,8 @@ if (chip_enable_pw_rpc) { assert(current_os == "freertos") -example_common_dir = "${chip_root}/examples/lighting-app/bouffalolab/common" -example_dir = "${chip_root}/examples/lighting-app/bouffalolab/bl702" -examples_plat_common_dir = "${chip_root}/examples/platform/bouffalolab/common" -examples_plat_dir = "${chip_root}/examples/platform/bouffalolab/bl702" +example_dir = "${chip_root}/examples/lighting-app/bouffalolab" +examples_plat_dir = "${chip_root}/examples/platform/bouffalolab" declare_args() { # Dump memory usage at link time. @@ -46,29 +45,33 @@ declare_args() { # reboot delay in seconds to apply new OTA image ota_auto_reboot_delay_seconds = 5 - config_cache_size = 8192 - enable_heap_monitoring = false enable_reset_counter = false - enable_cdc_module = false setupPinCode = 20202021 setupDiscriminator = 3840 board = "XT-ZB6-DevKit" module_type = "BL706C-22" - enable_psram = true baudrate = 2000000 + + enable_cdc_module = false + config_cache_size = 16384 + enable_psram = true } bl_iot_sdk("sdk") { include_dirs = [ + "${example_dir}/bl702", + "${example_dir}/bl702/include", + "${examples_plat_dir}", + "${examples_plat_dir}/common/iot_sdk", + "${examples_plat_dir}/common/route_hook", "${chip_root}/src/platform/bouffalolab/BL702", - "${example_dir}", - "${example_common_dir}", + "${chip_root}/src/platform/bouffalolab/common", ] - freertos_config = "${examples_plat_dir}/FreeRTOSConfig.h" + freertos_config = "${examples_plat_dir}/bl702/FreeRTOSConfig.h" defines = [ "INCLUDE_xSemaphoreGetMutexHolder=1", @@ -79,33 +82,41 @@ bl_iot_sdk("sdk") { "PRINT_DEBUG=0", ] - if (chip_enable_openthread) { - defines += [ "OPENTHREAD_CONFIG_PLATFORM_XTAL_ACCURACY=40" ] + if (chip_enable_pw_rpc) { + include_dirs += [ "${examples_plat_dir}/common/rpc" ] + defines += [ "PW_RPC_ENABLED=1" ] + defines += [ "DISABLE_PRINT=1" ] + } else if (chip_build_libshell) { + include_dirs += [ "${examples_plat_dir}/common/plat" ] } - if ("BL706C-22" == module_type) { - defines += [ "CFG_PSRAM_DUAL_BANK=1" ] + defines += [ "CHIP_DEVICE_CONFIG_ENABLE_ETHERNET=${chip_enable_ethernet}" ] + + if (chip_enable_ethernet) { + defines += [ "CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE=48" ] } if (enable_psram) { defines += [ "CFG_USE_PSRAM=1" ] } - if (defined(enable_cdc_module) && enable_cdc_module) { - defines += [ "CFG_USB_CDC_ENABLE" ] + if ("BL706C-22" == module_type) { + defines += [ "CFG_PSRAM_DUAL_BANK=1" ] } - if (chip_enable_pw_rpc) { - include_dirs += [ "${examples_plat_common_dir}/rpc" ] - defines += [ "PW_RPC_ENABLED=1" ] - defines += [ "DISABLE_PRINT=1" ] - } else if (chip_build_libshell) { - include_dirs += [ "${examples_plat_common_dir}/plat" ] + if (defined(enable_cdc_module) && enable_cdc_module) { + defines += [ "CFG_USB_CDC_ENABLE" ] } } chip_data_model("bouffalolab-lighting") { - zap_file = "${example_dir}/../data_model/lighting-app-thread.zap" + if (chip_enable_openthread) { + zap_file = "${example_dir}/data_model/lighting-app-thread.zap" + } else if (chip_enable_wifi) { + zap_file = "${example_dir}/data_model/lighting-app-wifi.zap" + } else { + zap_file = "${example_dir}/data_model/lighting-app-ethernet.zap" + } zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" is_server = true @@ -116,43 +127,41 @@ bouffalolab_executable("lighting_app") { bl_plat_name = "bl702" defines = [ - "APP_TASK_STACK_SIZE=2044", + "APP_TASK_STACK_SIZE=2048", "CHIP_UART_BAUDRATE=${baudrate}", - "BL702_ENABLE", + "BL702_ENABLE=1", "START_ENTRY=bl702_main", ] - if (false == enable_reset_counter) { - defines += [ "BOOT_PIN_RESET=31" ] + if (enable_debug_frame_ptr) { + defines += [ "CONF_ENABLE_FRAME_PTR=1" ] } - if (enable_psram) { - defines += [ "CFG_USE_PSRAM=1" ] + if (chip_config_network_layer_ble) { + defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=1" ] + } + + if (false == enable_reset_counter) { + defines += [ "BOOT_PIN_RESET=31" ] } if ("XT-ZB6-DevKit" == board) { defines += [ "XT_ZB6_DevKit" ] } else if ("BL706-NIGHT-LIGHT" == board) { defines += [ "BL706_NIGHT_LIGHT" ] - } else if ("BL706-ETH" == board) { - defines += [ "BL706_ETHERNET" ] - } else if ("BL706-WIFI" == board) { - defines += [ "BL706_WIFI" ] - } - - if (defined(enable_cdc_module) && enable_cdc_module) { - defines += [ "CFG_USB_CDC_ENABLE" ] } sources = [ - "${example_common_dir}/AppTask.cpp", - "${example_common_dir}/ZclCallbacks.cpp", - "${examples_plat_common_dir}/plat/LEDWidget.cpp", - "${examples_plat_common_dir}/plat/OTAConfig.cpp", - "${examples_plat_common_dir}/plat/demo_pwm.c", - "${examples_plat_common_dir}/plat/main.cpp", - "${examples_plat_common_dir}/plat/platform.cpp", - "${examples_plat_common_dir}/plat/uart.c", + "${example_dir}/common/AppTask.cpp", + "${example_dir}/common/ZclCallbacks.cpp", + "${examples_plat_dir}/common/iot_sdk/aos_task.c", + "${examples_plat_dir}/common/iot_sdk/demo_pwm.c", + "${examples_plat_dir}/common/iot_sdk/platform_port.c", + "${examples_plat_dir}/common/iot_sdk/uart.c", + "${examples_plat_dir}/common/plat/LEDWidget.cpp", + "${examples_plat_dir}/common/plat/OTAConfig.cpp", + "${examples_plat_dir}/common/plat/main.cpp", + "${examples_plat_dir}/common/plat/platform.cpp", ] deps = [ @@ -163,6 +172,39 @@ bouffalolab_executable("lighting_app") { "${chip_root}/src/setup_payload", ] + include_dirs = [ + "${chip_root}/src/platform/bouffalolab/BL702", + "${example_dir}/common", + "${example_dir}/bl702", + "${examples_plat_dir}/common/plat", + "${examples_plat_dir}/common/iot_sdk", + ] + + if (chip_enable_wifi || chip_enable_ethernet) { + include_dirs += [ "${examples_plat_dir}/bl702/lwipopts" ] + } + + if (enable_psram) { + defines += [ "CFG_USE_PSRAM=1" ] + } + + if (defined(enable_cdc_module) && enable_cdc_module) { + defines += [ "CFG_USB_CDC_ENABLE" ] + } + + if (chip_enable_wifi || chip_enable_ethernet) { + include_dirs += [ "${examples_plat_dir}/common/route_hook" ] + + if (chip_enable_wifi) { + defines += [ "CHIP_DEVICE_CONFIG_ENABLE_WIFI" ] + } + + sources += [ + "${examples_plat_dir}/common/route_hook/bl_route_hook.c", + "${examples_plat_dir}/common/route_hook/bl_route_table.c", + ] + } + if (chip_enable_openthread) { deps += [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform", @@ -182,20 +224,8 @@ bouffalolab_executable("lighting_app") { "${chip_root}/third_party/openthread/repo:libopenthread-mtd", ] } - } else { - sources += [ - "${examples_plat_common_dir}/route_hook/bl_route_hook.c", - "${examples_plat_common_dir}/route_hook/bl_route_table.c", - ] } - include_dirs = [ - "${chip_root}/src/platform/bouffalolab/BL702", - "${example_common_dir}", - "${examples_plat_common_dir}/route_hook", - "${examples_plat_common_dir}/plat", - ] - if (chip_enable_pw_rpc) { defines += [ "PW_RPC_ENABLED=1", @@ -214,8 +244,8 @@ bouffalolab_executable("lighting_app") { sources += [ "${chip_root}/examples/common/pigweed/RpcService.cpp", "${chip_root}/examples/common/pigweed/bouffalolab/PigweedLoggerMutex.cpp", - "${examples_plat_common_dir}/rpc/PigweedLogger.cpp", - "${examples_plat_common_dir}/rpc/Rpc.cpp", + "${examples_plat_dir}/common/rpc/PigweedLogger.cpp", + "${examples_plat_dir}/common/rpc/Rpc.cpp", ] deps += [ @@ -231,7 +261,7 @@ bouffalolab_executable("lighting_app") { "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", - "${examples_plat_common_dir}/rpc/pw_sys_io:pw_sys_io", + "${examples_plat_dir}/common/rpc/pw_sys_io:pw_sys_io", ] if (chip_enable_openthread) { @@ -250,23 +280,23 @@ bouffalolab_executable("lighting_app") { } else if (chip_build_libshell) { defines += [ "CONFIG_ENABLE_CHIP_SHELL=${chip_build_libshell}" ] - deps += [ "${chip_root}/examples/shell/shell_common:shell_common" ] - include_dirs += [ "${chip_root}/src/lib/shell", "${chip_root}/examples/shell/shell_common/include", ] + + deps += [ "${chip_root}/examples/shell/shell_common:shell_common" ] } if (enable_heap_monitoring) { - sources += [ "${examples_plat_common_dir}/plat/MemMonitoring.cpp" ] + sources += [ "${examples_plat_dir}/common/plat/MemMonitoring.cpp" ] defines += [ "HEAP_MONITORING=1" ] } if (enable_psram) { - ldscript = "${examples_plat_dir}/ldscripts/psram_flash.ld" + ldscript = "${examples_plat_dir}/bl702/ldscripts/psram_flash.ld" } else { - ldscript = "${examples_plat_dir}/ldscripts/flash.ld" + ldscript = "${examples_plat_dir}/bl702/ldscripts/flash.ld" } inputs = [ ldscript ] diff --git a/examples/lighting-app/bouffalolab/bl702/board.h b/examples/lighting-app/bouffalolab/bl702/mboard.h similarity index 100% rename from examples/lighting-app/bouffalolab/bl702/board.h rename to examples/lighting-app/bouffalolab/bl702/mboard.h diff --git a/examples/lighting-app/bouffalolab/bl702l/BUILD.gn b/examples/lighting-app/bouffalolab/bl702l/BUILD.gn index 621416e5bb3deb..86655fe708bb9d 100644 --- a/examples/lighting-app/bouffalolab/bl702l/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702l/BUILD.gn @@ -31,10 +31,8 @@ if (chip_enable_pw_rpc) { assert(current_os == "freertos") -example_common_dir = "${chip_root}/examples/lighting-app/bouffalolab/common" -example_dir = "${chip_root}/examples/lighting-app/bouffalolab/bl702l" -examples_plat_common_dir = "${chip_root}/examples/platform/bouffalolab/common" -examples_plat_dir = "${chip_root}/examples/platform/bouffalolab/bl702l" +example_dir = "${chip_root}/examples/lighting-app/bouffalolab" +examples_plat_dir = "${chip_root}/examples/platform/bouffalolab" declare_args() { # Dump memory usage at link time. @@ -46,8 +44,6 @@ declare_args() { # reboot delay in seconds to apply new OTA image ota_auto_reboot_delay_seconds = 5 - config_cache_size = 8192 - enable_heap_monitoring = false enable_reset_counter = false @@ -56,18 +52,23 @@ declare_args() { board = "BL704L-EVB" module_type = "BL704L" - enable_psram = true baudrate = 2000000 + + config_cache_size = 8192 + enable_psram = true } bl_iot_sdk("sdk") { include_dirs = [ + "${example_dir}/bl702l", + "${example_dir}/bl702l/include", + "${examples_plat_dir}", + "${examples_plat_dir}/common/route_hook", "${chip_root}/src/platform/bouffalolab/BL702L", - "${example_dir}", - "${example_common_dir}", + "${chip_root}/src/platform/bouffalolab/common", ] - freertos_config = "${examples_plat_dir}/FreeRTOSConfig.h" + freertos_config = "${examples_plat_dir}/bl702l/FreeRTOSConfig.h" defines = [ "INCLUDE_xSemaphoreGetMutexHolder=1", @@ -75,25 +76,28 @@ bl_iot_sdk("sdk") { "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setupDiscriminator}", "OTA_PERIODIC_TIMEOUT=${ota_periodic_query_timeout_seconds}", "OTA_AUTO_REBOOT_DELAY=${ota_auto_reboot_delay_seconds}", - "OPENTHREAD_CONFIG_PLATFORM_XTAL_ACCURACY=40", "PRINT_DEBUG=0", ] - if (enable_psram) { - defines += [ "CFG_USE_PSRAM=1" ] - } - if (chip_enable_pw_rpc) { - include_dirs += [ "${examples_plat_common_dir}/rpc" ] + include_dirs += [ "${examples_plat_dir}/common/rpc" ] defines += [ "PW_RPC_ENABLED=1" ] defines += [ "DISABLE_PRINT=1" ] } else if (chip_build_libshell) { - include_dirs += [ "${examples_plat_common_dir}/plat" ] + include_dirs += [ "${examples_plat_dir}/common/plat" ] + } + + if (chip_enable_openthread) { + defines += [ "OPENTHREAD_CONFIG_PLATFORM_XTAL_ACCURACY=40" ] + } + + if (enable_psram) { + defines += [ "CFG_USE_PSRAM=1" ] } } chip_data_model("bouffalolab-lighting") { - zap_file = "${example_dir}/../data_model/lighting-app-thread.zap" + zap_file = "${example_dir}/data_model/lighting-app-wifi.zap" zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" is_server = true @@ -104,35 +108,39 @@ bouffalolab_executable("lighting_app") { bl_plat_name = "bl702l" defines = [ - "APP_TASK_STACK_SIZE=2044", + "APP_TASK_STACK_SIZE=2048", "CHIP_UART_BAUDRATE=${baudrate}", - "BL702L_ENABLE", + "BL702L_ENABLE=1", "START_ENTRY=bl702_main", ] + if (enable_debug_frame_ptr) { + defines += [ "CONF_ENABLE_FRAME_PTR=1" ] + } + + if (chip_config_network_layer_ble) { + defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=1" ] + } + if (false == enable_reset_counter) { defines += [ "BOOT_PIN_RESET=16" ] } - defines += [ "CFG_USE_PSRAM=1" ] - - if ("BL704L" == board) { + if ("BL704LDK" == board) { defines += [ "XT_ZB6_DevKit" ] - } else if ("BL706-NIGHT-LIGHT" == board) { - defines += [ "BL706_NIGHT_LIGHT" ] - } else if ("BL702-IoT-DVK" == board || "BL706-IoT-DVK" == board) { - defines += [ "BL706_IOT_DVK" ] } sources = [ - "${example_common_dir}/AppTask.cpp", - "${example_common_dir}/ZclCallbacks.cpp", - "${examples_plat_common_dir}/plat/LEDWidget.cpp", - "${examples_plat_common_dir}/plat/OTAConfig.cpp", - "${examples_plat_common_dir}/plat/demo_pwm.c", - "${examples_plat_common_dir}/plat/main.cpp", - "${examples_plat_common_dir}/plat/platform.cpp", - "${examples_plat_common_dir}/plat/uart.c", + "${example_dir}/common/AppTask.cpp", + "${example_dir}/common/ZclCallbacks.cpp", + "${examples_plat_dir}/common/iot_sdk/aos_task.c", + "${examples_plat_dir}/common/iot_sdk/demo_pwm.c", + "${examples_plat_dir}/common/iot_sdk/platform_port.c", + "${examples_plat_dir}/common/iot_sdk/uart.c", + "${examples_plat_dir}/common/plat/LEDWidget.cpp", + "${examples_plat_dir}/common/plat/OTAConfig.cpp", + "${examples_plat_dir}/common/plat/main.cpp", + "${examples_plat_dir}/common/plat/platform.cpp", ] deps = [ @@ -141,29 +149,48 @@ bouffalolab_executable("lighting_app") { "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", "${chip_root}/src/setup_payload", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] - if (chip_openthread_ftd) { - defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=1" ] - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", - ] - } else { - defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=0" ] + include_dirs = [ + "${chip_root}/src/platform/bouffalolab/BL702L", + "${example_dir}/common", + "${example_dir}/bl702l", + "${examples_plat_dir}/common/plat", + "${examples_plat_dir}/common/iot_sdk", + ] + + if (enable_psram) { + defines += [ "CFG_USE_PSRAM=1" ] + } + + if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] + + if (chip_openthread_ftd) { + defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=1" ] + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=0" ] + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } } - include_dirs = [ - "${chip_root}/src/platform/bouffalolab/BL702L", - "${example_common_dir}", - "${examples_plat_common_dir}/plat", - ] + if (chip_enable_wifi) { + include_dirs += [ "${examples_plat_dir}/common/route_hook" ] + sources += [ + "${examples_plat_dir}/common/route_hook/bl_route_hook.c", + "${examples_plat_dir}/common/route_hook/bl_route_table.c", + ] + } if (chip_enable_pw_rpc) { defines += [ @@ -183,8 +210,8 @@ bouffalolab_executable("lighting_app") { sources += [ "${chip_root}/examples/common/pigweed/RpcService.cpp", "${chip_root}/examples/common/pigweed/bouffalolab/PigweedLoggerMutex.cpp", - "${examples_plat_common_dir}/rpc/PigweedLogger.cpp", - "${examples_plat_common_dir}/rpc/Rpc.cpp", + "${examples_plat_dir}/common/rpc/PigweedLogger.cpp", + "${examples_plat_dir}/common/rpc/Rpc.cpp", ] deps += [ @@ -200,11 +227,16 @@ bouffalolab_executable("lighting_app") { "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", - "${examples_plat_common_dir}/rpc/pw_sys_io:pw_sys_io", + "${examples_plat_dir}/common/rpc/pw_sys_io:pw_sys_io", ] + if (chip_enable_openthread) { + deps += [ + "${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", + ] + } + deps += pw_build_LINK_DEPS include_dirs += [ @@ -223,14 +255,14 @@ bouffalolab_executable("lighting_app") { } if (enable_heap_monitoring) { - sources += [ "${examples_plat_common_dir}/plat/MemMonitoring.cpp" ] + sources += [ "${examples_plat_dir}/common/plat/MemMonitoring.cpp" ] defines += [ "HEAP_MONITORING=1" ] } if (enable_psram) { - ldscript = "${examples_plat_dir}/ldscripts/psram_flash_rom.ld" + ldscript = "${examples_plat_dir}/bl702l/ldscripts/psram_flash_rom.ld" } else { - ldscript = "${examples_plat_dir}/ldscripts/flash_rom.ld" + ldscript = "${examples_plat_dir}/bl702l/ldscripts/flash_rom.ld" } inputs = [ ldscript ] diff --git a/examples/lighting-app/bouffalolab/bl702l/board.h b/examples/lighting-app/bouffalolab/bl702l/mboard.h similarity index 100% rename from examples/lighting-app/bouffalolab/bl702l/board.h rename to examples/lighting-app/bouffalolab/bl702l/mboard.h diff --git a/examples/lighting-app/bouffalolab/common/AppTask.cpp b/examples/lighting-app/bouffalolab/common/AppTask.cpp index 3171341a9b49ba..f38ae87a61c340 100644 --- a/examples/lighting-app/bouffalolab/common/AppTask.cpp +++ b/examples/lighting-app/bouffalolab/common/AppTask.cpp @@ -45,15 +45,16 @@ #include #include +#include + extern "C" { -#include "board.h" #include -#include #include #include } #include "AppTask.h" +#include "mboard.h" using namespace ::chip; using namespace ::chip::app; @@ -134,7 +135,7 @@ void AppTask::AppTaskMain(void * pvParameter) app_event_t appEvent; bool onoff = false; -#ifndef BL706_ETHERNET +#if !(BL702_ENABLE && CHIP_DEVICE_CONFIG_ENABLE_ETHERNET) sLightLED.Init(); #endif @@ -212,6 +213,13 @@ void AppTask::AppTaskMain(void * pvParameter) } } +#ifdef BOOT_PIN_RESET + if (APP_EVENT_BTN_LONG & appEvent) + { + /** Turn off light to indicate button long press for factory reset is confirmed */ + sLightLED.SetOnoff(false); + } +#endif if (APP_EVENT_IDENTIFY_MASK & appEvent) { IdentifyHandleOp(appEvent); @@ -271,7 +279,6 @@ void AppTask::LightingUpdate(app_event_t status) { if (v.IsNull()) { - // Just pick something. v.SetNonNull(254); } #if defined(BL706_NIGHT_LIGHT) || defined(BL602_NIGHT_LIGHT) @@ -330,7 +337,12 @@ void AppTask::TimerEventHandler(app_event_t event) if (GetAppTask().mButtonPressedTime) { #ifdef BOOT_PIN_RESET - if (System::SystemClock().GetMonotonicMilliseconds64().count() - GetAppTask().mButtonPressedTime >= APP_BUTTON_PRESS_SHORT) + if (System::SystemClock().GetMonotonicMilliseconds64().count() - GetAppTask().mButtonPressedTime > APP_BUTTON_PRESS_LONG) + { + GetAppTask().PostEvent(APP_EVENT_BTN_LONG); + } + else if (System::SystemClock().GetMonotonicMilliseconds64().count() - GetAppTask().mButtonPressedTime >= + APP_BUTTON_PRESS_SHORT) { #if defined(BL602_NIGHT_LIGHT) || defined(BL706_NIGHT_LIGHT) /** change color to indicate to wait factory reset confirm */ @@ -403,7 +415,7 @@ void AppTask::ButtonEventHandler(uint8_t btnIdx, uint8_t btnAction) } #ifdef BOOT_PIN_RESET -hosal_gpio_dev_t gpio_key = { .port = BOOT_PIN_RESET, .config = INPUT_HIGH_IMPEDANCE, .priv = NULL }; +static hosal_gpio_dev_t gpio_key = { .port = BOOT_PIN_RESET, .config = INPUT_HIGH_IMPEDANCE, .priv = NULL }; void AppTask::ButtonInit(void) { @@ -416,16 +428,19 @@ void AppTask::ButtonInit(void) bool AppTask::ButtonPressed(void) { uint8_t val = 1; + hosal_gpio_input_get(&gpio_key, &val); + return val == 1; } void AppTask::ButtonEventHandler(void * arg) { uint32_t presstime; + if (ButtonPressed()) { -#ifdef BL702L_ENABLE +#if BL702L_ENABLE bl_set_gpio_intmod(gpio_key.port, HOSAL_IRQ_TRIG_NEG_LEVEL); #else bl_set_gpio_intmod(gpio_key.port, 1, HOSAL_IRQ_TRIG_NEG_LEVEL); @@ -436,11 +451,12 @@ void AppTask::ButtonEventHandler(void * arg) } else { -#ifdef BL702L_ENABLE +#if BL702L_ENABLE bl_set_gpio_intmod(gpio_key.port, HOSAL_IRQ_TRIG_POS_PULSE); #else bl_set_gpio_intmod(gpio_key.port, 1, HOSAL_IRQ_TRIG_POS_PULSE); #endif + if (GetAppTask().mButtonPressedTime) { presstime = System::SystemClock().GetMonotonicMilliseconds64().count() - GetAppTask().mButtonPressedTime; diff --git a/examples/lighting-app/bouffalolab/common/AppTask.h b/examples/lighting-app/bouffalolab/common/AppTask.h index 3c32ee7311cd65..638ad9e9f71b58 100644 --- a/examples/lighting-app/bouffalolab/common/AppTask.h +++ b/examples/lighting-app/bouffalolab/common/AppTask.h @@ -23,6 +23,7 @@ #include "FreeRTOS.h" #include "timers.h" + #include using namespace ::chip; @@ -58,6 +59,7 @@ class AppTask APP_EVENT_TIMER = 0x00000010, APP_EVENT_BTN_SHORT = 0x00000020, APP_EVENT_FACTORY_RESET = 0x00000040, + APP_EVENT_BTN_LONG = 0x00000080, APP_EVENT_LIGHTING_ONOFF = 0x00010000, APP_EVENT_LIGHTING_LEVEL = 0x00020000, @@ -69,7 +71,8 @@ class AppTask APP_EVENT_IDENTIFY_STOP = 0x04000000, APP_EVENT_IDENTIFY_MASK = APP_EVENT_IDENTIFY_START | APP_EVENT_IDENTIFY_IDENTIFY | APP_EVENT_IDENTIFY_STOP, - APP_EVENT_ALL_MASK = APP_EVENT_LIGHTING_MASK | APP_EVENT_TIMER | APP_EVENT_BTN_SHORT | APP_EVENT_IDENTIFY_MASK, + APP_EVENT_ALL_MASK = + APP_EVENT_LIGHTING_MASK | APP_EVENT_TIMER | APP_EVENT_BTN_SHORT | APP_EVENT_BTN_LONG | APP_EVENT_IDENTIFY_MASK, }; void SetEndpointId(EndpointId endpointId) @@ -81,6 +84,9 @@ class AppTask EndpointId GetEndpointId(void) { return mEndpointId; } void PostEvent(app_event_t event); void ButtonEventHandler(uint8_t btnIdx, uint8_t btnAction); +#ifdef BOOT_PIN_RESET + static void ButtonEventHandler(void * arg); +#endif static void IdentifyStartHandler(Identify *); static void IdentifyStopHandler(Identify *); @@ -106,7 +112,6 @@ class AppTask #ifdef BOOT_PIN_RESET static void ButtonInit(void); static bool ButtonPressed(void); - static void ButtonEventHandler(void * arg); #endif static void ScheduleInit(intptr_t arg); diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter new file mode 100644 index 00000000000000..9cf2e7bc80bbe2 --- /dev/null +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -0,0 +1,1964 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; +} + +struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; +} + +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +server cluster Identify = 3 { + enum EffectIdentifierEnum : ENUM8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : ENUM8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : ENUM8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + INT16U identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** Attributes and commands for group configuration and manipulation. */ +server cluster Groups = 4 { + bitmap Feature : BITMAP32 { + kGroupNames = 0x1; + } + + bitmap NameSupportBitmap : BITMAP8 { + kGroupNames = 0x80; + } + + readonly attribute NameSupportBitmap nameSupport = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + response struct AddGroupResponse = 0 { + ENUM8 status = 0; + group_id groupID = 1; + } + + response struct ViewGroupResponse = 1 { + ENUM8 status = 0; + group_id groupID = 1; + CHAR_STRING groupName = 2; + } + + response struct GetGroupMembershipResponse = 2 { + nullable INT8U capacity = 0; + group_id groupList[] = 1; + } + + response struct RemoveGroupResponse = 3 { + ENUM8 status = 0; + group_id groupID = 1; + } + + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; +} + +/** Attributes and commands for switching devices between 'On' and 'Off' states. */ +server cluster OnOff = 6 { + enum OnOffDelayedAllOffEffectVariant : ENUM8 { + kFadeToOffIn0p8Seconds = 0; + kNoFade = 1; + k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2; + } + + enum OnOffDyingLightEffectVariant : ENUM8 { + k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0; + } + + enum OnOffEffectIdentifier : ENUM8 { + kDelayedAllOff = 0; + kDyingLight = 1; + } + + enum OnOffStartUpOnOff : ENUM8 { + kOff = 0; + kOn = 1; + kTogglePreviousOnOff = 2; + } + + bitmap Feature : BITMAP32 { + kLighting = 0x1; + kDeadFront = 0x2; + } + + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; + } + + readonly attribute boolean onOff = 0; + readonly attribute boolean globalSceneControl = 16384; + attribute int16u onTime = 16385; + attribute int16u offWaitTime = 16386; + attribute access(write: manage) nullable OnOffStartUpOnOff startUpOnOff = 16387; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OffWithEffectRequest { + OnOffEffectIdentifier effectIdentifier = 0; + int8u effectVariant = 1; + } + + request struct OnWithTimedOffRequest { + OnOffControl onOffControl = 0; + int16u onTime = 1; + int16u offWaitTime = 2; + } + + command Off(): DefaultSuccess = 0; + command On(): DefaultSuccess = 1; + command Toggle(): DefaultSuccess = 2; + command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; + command OnWithRecallGlobalScene(): DefaultSuccess = 65; + command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; +} + +/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ +server cluster LevelControl = 8 { + enum MoveMode : ENUM8 { + kUp = 0; + kDown = 1; + } + + enum StepMode : ENUM8 { + kUp = 0; + kDown = 1; + } + + bitmap Feature : BITMAP32 { + kOnOff = 0x1; + kLighting = 0x2; + kFrequency = 0x4; + } + + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + + readonly attribute nullable int8u currentLevel = 0; + readonly attribute int16u remainingTime = 1; + readonly attribute int8u minLevel = 2; + readonly attribute int8u maxLevel = 3; + readonly attribute int16u currentFrequency = 4; + readonly attribute int16u minFrequency = 5; + readonly attribute int16u maxFrequency = 6; + attribute LevelControlOptions options = 15; + attribute int16u onOffTransitionTime = 16; + attribute nullable int8u onLevel = 17; + attribute nullable int16u onTransitionTime = 18; + attribute nullable int16u offTransitionTime = 19; + attribute nullable int8u defaultMoveRate = 20; + attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct MoveToLevelRequest { + INT8U level = 0; + nullable INT16U transitionTime = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct MoveRequest { + MoveMode moveMode = 0; + nullable INT8U rate = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct StepRequest { + StepMode stepMode = 0; + INT8U stepSize = 1; + nullable INT16U transitionTime = 2; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; + } + + request struct StopRequest { + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; + } + + request struct MoveToLevelWithOnOffRequest { + INT8U level = 0; + nullable INT16U transitionTime = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct MoveWithOnOffRequest { + MoveMode moveMode = 0; + nullable INT8U rate = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct StepWithOnOffRequest { + StepMode stepMode = 0; + INT8U stepSize = 1; + nullable INT16U transitionTime = 2; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; + } + + request struct StopWithOnOffRequest { + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; + } + + command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; + command Move(MoveRequest): DefaultSuccess = 1; + command Step(StepRequest): DefaultSuccess = 2; + command Stop(StopRequest): DefaultSuccess = 3; + command MoveToLevelWithOnOff(MoveToLevelWithOnOffRequest): DefaultSuccess = 4; + command MoveWithOnOff(MoveWithOnOffRequest): DefaultSuccess = 5; + command StepWithOnOff(StepWithOnOffRequest): DefaultSuccess = 6; + command StopWithOnOff(StopWithOnOffRequest): DefaultSuccess = 7; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +server cluster Descriptor = 29 { + bitmap Feature : BITMAP32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute CLUSTER_ID serverList[] = 1; + readonly attribute CLUSTER_ID clientList[] = 2; + readonly attribute ENDPOINT_NO partsList[] = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +server cluster AccessControl = 31 { + enum AccessControlEntryAuthModeEnum : ENUM8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : ENUM8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : ENUM8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +server cluster BasicInformation = 40 { + enum ColorEnum : ENUM8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : ENUM8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + INT32U softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; + attribute access(write: manage) boolean localConfigDisabled = 16; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Provides an interface for providing OTA software updates */ +client cluster OtaSoftwareUpdateProvider = 41 { + enum OTAApplyUpdateAction : ENUM8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum OTADownloadProtocol : ENUM8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum OTAQueryStatus : ENUM8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + INT16U productID = 1; + INT32U softwareVersion = 2; + OTADownloadProtocol protocolsSupported[] = 3; + optional INT16U hardwareVersion = 4; + optional CHAR_STRING<2> location = 5; + optional BOOLEAN requestorCanConsent = 6; + optional OCTET_STRING<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + OTAQueryStatus status = 0; + optional INT32U delayedActionTime = 1; + optional CHAR_STRING<256> imageURI = 2; + optional INT32U softwareVersion = 3; + optional CHAR_STRING<64> softwareVersionString = 4; + optional OCTET_STRING<32> updateToken = 5; + optional BOOLEAN userConsentNeeded = 6; + optional OCTET_STRING<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + OTAApplyUpdateAction action = 0; + INT32U delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +server cluster OtaSoftwareUpdateRequestor = 42 { + enum OTAAnnouncementReason : ENUM8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum OTAChangeReasonEnum : ENUM8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum OTAUpdateStateEnum : ENUM8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + OTAUpdateStateEnum previousState = 0; + OTAUpdateStateEnum newState = 1; + OTAChangeReasonEnum reason = 2; + nullable INT32U targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + INT32U softwareVersion = 0; + INT16U productID = 1; + } + + info event DownloadError = 2 { + INT32U softwareVersion = 0; + INT64U bytesDownloaded = 1; + nullable INT8U progressPercent = 2; + nullable INT64S platformCode = 3; + } + + attribute ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute OTAUpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + OTAAnnouncementReason announcementReason = 2; + optional OCTET_STRING<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +server cluster LocalizationConfiguration = 43 { + attribute char_string<35> activeLocale = 0; + readonly attribute CHAR_STRING supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for how dates and times are conveyed. As such, Nodes that visually + or audibly convey time information need a mechanism by which they can be configured to use a + user’s preferred format. */ +server cluster TimeFormatLocalization = 44 { + enum CalendarTypeEnum : ENUM8 { + kBuddhist = 0; + kChinese = 1; + kCoptic = 2; + kEthiopian = 3; + kGregorian = 4; + kHebrew = 5; + kIndian = 6; + kIslamic = 7; + kJapanese = 8; + kKorean = 9; + kPersian = 10; + kTaiwanese = 11; + } + + enum HourFormatEnum : ENUM8 { + k12hr = 0; + k24hr = 1; + } + + bitmap Feature : BITMAP32 { + kCalendarFormat = 0x1; + } + + attribute HourFormatEnum hourFormat = 0; + attribute CalendarTypeEnum activeCalendarType = 1; + readonly attribute CalendarTypeEnum supportedCalendarTypes[] = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +server cluster GeneralCommissioning = 48 { + enum CommissioningErrorEnum : ENUM8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : ENUM8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + INT16U expiryLengthSeconds = 0; + INT64U breadcrumb = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + CHAR_STRING countryCode = 1; + INT64U breadcrumb = 2; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +server cluster NetworkCommissioning = 49 { + enum NetworkCommissioningStatusEnum : ENUM8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : ENUM8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : BITMAP32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + } + + bitmap WiFiSecurityBitmap : BITMAP8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute int8u scanMaxTimeSeconds = 2; + readonly attribute int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable OCTET_STRING<32> ssid = 0; + optional INT64U breadcrumb = 1; + } + + request struct AddOrUpdateWiFiNetworkRequest { + OCTET_STRING<32> ssid = 0; + OCTET_STRING<64> credentials = 1; + optional INT64U breadcrumb = 2; + } + + request struct AddOrUpdateThreadNetworkRequest { + OCTET_STRING<254> operationalDataset = 0; + optional INT64U breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ConnectNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ReorderNetworkRequest { + OCTET_STRING<32> networkID = 0; + INT8U networkIndex = 1; + optional INT64U breadcrumb = 2; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING<512> debugText = 1; + optional INT8U networkIndex = 2; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; + } + + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +server cluster DiagnosticLogs = 50 { + enum IntentEnum : ENUM8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : ENUM8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : ENUM8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional CHAR_STRING<32> transferFileDesignator = 2; + } + + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster GeneralDiagnostics = 51 { + enum BootReasonEnum : ENUM8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : ENUM8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : ENUM8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : ENUM8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : ENUM8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; + readonly attribute int32u totalOperationalHours = 3; + readonly attribute BootReasonEnum bootReason = 4; + readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + OCTET_STRING<16> enableKey = 0; + INT64U eventTrigger = 1; + } + + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; +} + +/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster SoftwareDiagnostics = 52 { + bitmap Feature : BITMAP32 { + kWaterMarks = 0x1; + } + + struct ThreadMetricsStruct { + int64u id = 0; + optional char_string<8> name = 1; + optional int32u stackFreeCurrent = 2; + optional int32u stackFreeMinimum = 3; + optional int32u stackSize = 4; + } + + info event SoftwareFault = 0 { + INT64U id = 0; + optional CHAR_STRING name = 1; + optional OCTET_STRING faultRecording = 2; + } + + readonly attribute int64u currentHeapFree = 1; + readonly attribute int64u currentHeapUsed = 2; + readonly attribute int64u currentHeapHighWatermark = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command ResetWatermarks(): DefaultSuccess = 0; +} + +/** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster EthernetNetworkDiagnostics = 55 { + enum PHYRateEnum : ENUM8 { + kRate10M = 0; + kRate100M = 1; + kRate1G = 2; + kRate25G = 3; + kRate5G = 4; + kRate10G = 5; + kRate40G = 6; + kRate100G = 7; + kRate200G = 8; + kRate400G = 9; + } + + bitmap Feature : BITMAP32 { + kPacketCounts = 0x1; + kErrorCounts = 0x2; + } + + readonly attribute nullable PHYRateEnum PHYRate = 0; + readonly attribute nullable boolean fullDuplex = 1; + readonly attribute int64u packetRxCount = 2; + readonly attribute int64u packetTxCount = 3; + readonly attribute int64u txErrCount = 4; + readonly attribute int64u collisionCount = 5; + readonly attribute int64u overrunCount = 6; + readonly attribute nullable boolean carrierDetect = 7; + readonly attribute int64u timeSinceReset = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +server cluster AdministratorCommissioning = 60 { + enum CommissioningWindowStatusEnum : ENUM8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : ENUM8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + OCTET_STRING PAKEPasscodeVerifier = 1; + INT16U discriminator = 2; + INT32U iterations = 3; + OCTET_STRING salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + } + + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +server cluster OperationalCredentials = 62 { + enum CertificateChainTypeEnum : ENUM8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : ENUM8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute OCTET_STRING trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + OCTET_STRING attestationNonce = 0; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + request struct CSRRequestRequest { + OCTET_STRING CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + request struct AddNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + OCTET_STRING IPKValue = 2; + Int64u caseAdminSubject = 3; + VENDOR_ID adminVendorId = 4; + } + + request struct UpdateNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + } + + request struct UpdateFabricLabelRequest { + CHAR_STRING<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + OCTET_STRING rootCACertificate = 0; + } + + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +server cluster GroupKeyManagement = 63 { + enum GroupKeySecurityPolicyEnum : ENUM8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : BITMAP32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + INT16U groupKeySetID = 0; + } + + request struct KeySetRemoveRequest { + INT16U groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + INT16U groupKeySetIDs[] = 0; + } + + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only +labels. */ +server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + readonly attribute LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ +server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + attribute access(write: manage) LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for controlling the color properties of a color-capable light. */ +server cluster ColorControl = 768 { + enum ColorLoopAction : ENUM8 { + kDeactivate = 0; + kActivateFromColorLoopStartEnhancedHue = 1; + kActivateFromEnhancedCurrentHue = 2; + } + + enum ColorLoopDirection : ENUM8 { + kDecrementHue = 0; + kIncrementHue = 1; + } + + enum ColorMode : ENUM8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperature = 2; + } + + enum HueDirection : ENUM8 { + kShortestDistance = 0; + kLongestDistance = 1; + kUp = 2; + kDown = 3; + } + + enum HueMoveMode : ENUM8 { + kStop = 0; + kUp = 1; + kDown = 3; + } + + enum HueStepMode : ENUM8 { + kUp = 1; + kDown = 3; + } + + enum SaturationMoveMode : ENUM8 { + kStop = 0; + kUp = 1; + kDown = 3; + } + + enum SaturationStepMode : ENUM8 { + kUp = 1; + kDown = 3; + } + + bitmap ColorCapabilities : BITMAP16 { + kHueSaturationSupported = 0x1; + kEnhancedHueSupported = 0x2; + kColorLoopSupported = 0x4; + kXYAttributesSupported = 0x8; + kColorTemperatureSupported = 0x10; + } + + bitmap ColorLoopUpdateFlags : BITMAP8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; + } + + readonly attribute int8u currentHue = 0; + readonly attribute int8u currentSaturation = 1; + readonly attribute int16u remainingTime = 2; + readonly attribute int16u currentX = 3; + readonly attribute int16u currentY = 4; + readonly attribute int16u colorTemperatureMireds = 7; + readonly attribute enum8 colorMode = 8; + attribute bitmap8 options = 15; + readonly attribute nullable int8u numberOfPrimaries = 16; + readonly attribute int16u primary1X = 17; + readonly attribute int16u primary1Y = 18; + readonly attribute nullable int8u primary1Intensity = 19; + readonly attribute int16u primary2X = 21; + readonly attribute int16u primary2Y = 22; + readonly attribute nullable int8u primary2Intensity = 23; + readonly attribute int16u primary3X = 25; + readonly attribute int16u primary3Y = 26; + readonly attribute nullable int8u primary3Intensity = 27; + readonly attribute int16u primary4X = 32; + readonly attribute int16u primary4Y = 33; + readonly attribute nullable int8u primary4Intensity = 34; + readonly attribute int16u primary5X = 36; + readonly attribute int16u primary5Y = 37; + readonly attribute nullable int8u primary5Intensity = 38; + readonly attribute int16u primary6X = 40; + readonly attribute int16u primary6Y = 41; + readonly attribute nullable int8u primary6Intensity = 42; + readonly attribute int16u enhancedCurrentHue = 16384; + readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute int8u colorLoopActive = 16386; + readonly attribute int8u colorLoopDirection = 16387; + readonly attribute int16u colorLoopTime = 16388; + readonly attribute int16u colorLoopStartEnhancedHue = 16389; + readonly attribute int16u colorLoopStoredEnhancedHue = 16390; + readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute int16u colorTempPhysicalMinMireds = 16395; + readonly attribute int16u colorTempPhysicalMaxMireds = 16396; + readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; + attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct MoveToHueRequest { + INT8U hue = 0; + HueDirection direction = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveHueRequest { + HueMoveMode moveMode = 0; + INT8U rate = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct StepHueRequest { + HueStepMode stepMode = 0; + INT8U stepSize = 1; + INT8U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveToSaturationRequest { + INT8U saturation = 0; + INT16U transitionTime = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct MoveSaturationRequest { + SaturationMoveMode moveMode = 0; + INT8U rate = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct StepSaturationRequest { + SaturationStepMode stepMode = 0; + INT8U stepSize = 1; + INT8U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveToHueAndSaturationRequest { + INT8U hue = 0; + INT8U saturation = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveToColorRequest { + INT16U colorX = 0; + INT16U colorY = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveColorRequest { + INT16S rateX = 0; + INT16S rateY = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct StepColorRequest { + INT16S stepX = 0; + INT16S stepY = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveToColorTemperatureRequest { + INT16U colorTemperatureMireds = 0; + INT16U transitionTime = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct EnhancedMoveToHueRequest { + INT16U enhancedHue = 0; + HueDirection direction = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct EnhancedMoveHueRequest { + HueMoveMode moveMode = 0; + INT16U rate = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct EnhancedStepHueRequest { + HueStepMode stepMode = 0; + INT16U stepSize = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct EnhancedMoveToHueAndSaturationRequest { + INT16U enhancedHue = 0; + INT8U saturation = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct ColorLoopSetRequest { + ColorLoopUpdateFlags updateFlags = 0; + ColorLoopAction action = 1; + ColorLoopDirection direction = 2; + INT16U time = 3; + INT16U startHue = 4; + BITMAP8 optionsMask = 5; + BITMAP8 optionsOverride = 6; + } + + request struct StopMoveStepRequest { + BITMAP8 optionsMask = 0; + BITMAP8 optionsOverride = 1; + } + + request struct MoveColorTemperatureRequest { + HueMoveMode moveMode = 0; + INT16U rate = 1; + INT16U colorTemperatureMinimumMireds = 2; + INT16U colorTemperatureMaximumMireds = 3; + BITMAP8 optionsMask = 4; + BITMAP8 optionsOverride = 5; + } + + request struct StepColorTemperatureRequest { + HueStepMode stepMode = 0; + INT16U stepSize = 1; + INT16U transitionTime = 2; + INT16U colorTemperatureMinimumMireds = 3; + INT16U colorTemperatureMaximumMireds = 4; + BITMAP8 optionsMask = 5; + BITMAP8 optionsOverride = 6; + } + + command MoveToHue(MoveToHueRequest): DefaultSuccess = 0; + command MoveHue(MoveHueRequest): DefaultSuccess = 1; + command StepHue(StepHueRequest): DefaultSuccess = 2; + command MoveToSaturation(MoveToSaturationRequest): DefaultSuccess = 3; + command MoveSaturation(MoveSaturationRequest): DefaultSuccess = 4; + command StepSaturation(StepSaturationRequest): DefaultSuccess = 5; + command MoveToHueAndSaturation(MoveToHueAndSaturationRequest): DefaultSuccess = 6; + command MoveToColor(MoveToColorRequest): DefaultSuccess = 7; + command MoveColor(MoveColorRequest): DefaultSuccess = 8; + command StepColor(StepColorRequest): DefaultSuccess = 9; + command MoveToColorTemperature(MoveToColorTemperatureRequest): DefaultSuccess = 10; + command EnhancedMoveToHue(EnhancedMoveToHueRequest): DefaultSuccess = 64; + command EnhancedMoveHue(EnhancedMoveHueRequest): DefaultSuccess = 65; + command EnhancedStepHue(EnhancedStepHueRequest): DefaultSuccess = 66; + command EnhancedMoveToHueAndSaturation(EnhancedMoveToHueAndSaturationRequest): DefaultSuccess = 67; + command ColorLoopSet(ColorLoopSetRequest): DefaultSuccess = 68; + command StopMoveStep(StopMoveStepRequest): DefaultSuccess = 71; + command MoveColorTemperature(MoveColorTemperatureRequest): DefaultSuccess = 75; + command StepColorTemperature(StepColorTemperatureRequest): DefaultSuccess = 76; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + binding cluster OtaSoftwareUpdateProvider; + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry default = 4; + callback attribute targetsPerAccessControlEntry default = 3; + callback attribute accessControlEntriesPerFabric default = 4; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision default = 10; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location default = "XX"; + callback attribute hardwareVersion default = 0; + callback attribute hardwareVersionString; + callback attribute softwareVersion default = 0; + callback attribute softwareVersionString; + callback attribute manufacturingDate default = "20210614123456ZZ"; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OtaSoftwareUpdateRequestor { + emits event StateTransition; + emits event VersionApplied; + emits event DownloadError; + callback attribute defaultOTAProviders default = 0; + ram attribute updatePossible default = 1; + ram attribute updateState default = 0; + ram attribute updateStateProgress default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster LocalizationConfiguration { + persist attribute activeLocale default = "en-US"; + callback attribute supportedLocales; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster TimeFormatLocalization { + persist attribute hourFormat default = 0; + persist attribute activeCalendarType default = 0; + callback attribute supportedCalendarTypes; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig default = 0; + callback attribute locationCapability default = 0; + callback attribute supportsConcurrentConnection default = 1; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + } + + server cluster DiagnosticLogs { + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralDiagnostics { + emits event HardwareFaultChange; + emits event RadioFaultChange; + emits event NetworkFaultChange; + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; + callback attribute totalOperationalHours default = 0x00000000; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster SoftwareDiagnostics { + callback attribute currentHeapFree default = 0x0000000000000000; + callback attribute currentHeapUsed default = 0x0000000000000000; + callback attribute currentHeapHighWatermark default = 0x0000000000000000; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + } + + server cluster EthernetNetworkDiagnostics { + callback attribute PHYRate; + callback attribute fullDuplex default = 0x00; + callback attribute packetRxCount default = 0x0000000000000000; + callback attribute packetTxCount default = 0x0000000000000000; + callback attribute txErrCount default = 0x0000000000000000; + callback attribute collisionCount default = 0x0000000000000000; + callback attribute overrunCount default = 0x0000000000000000; + callback attribute carrierDetect default = 0x00; + callback attribute timeSinceReset default = 0x0000000000000000; + ram attribute featureMap default = 3; + ram attribute clusterRevision default = 1; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus default = 0; + callback attribute adminFabricIndex default = 1; + callback attribute adminVendorId default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster FixedLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UserLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_extendedcolorlight = 269, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0000; + ram attribute identifyType default = 0x0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + } + + server cluster Groups { + ram attribute nameSupport; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + } + + server cluster OnOff { + persist attribute onOff default = 0x1; + ram attribute globalSceneControl default = 0x01; + ram attribute onTime default = 0x0000; + ram attribute offWaitTime default = 0x0000; + persist attribute startUpOnOff; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 5; + } + + server cluster LevelControl { + persist attribute currentLevel default = 0x254; + ram attribute remainingTime default = 0x0000; + ram attribute minLevel default = 0x01; + ram attribute maxLevel default = 0xFE; + ram attribute currentFrequency default = 0x0000; + ram attribute minFrequency default = 0x0000; + ram attribute maxFrequency default = 0x0000; + ram attribute options default = 0x00; + ram attribute onOffTransitionTime default = 0x0000; + ram attribute onLevel; + ram attribute onTransitionTime; + ram attribute offTransitionTime; + ram attribute defaultMoveRate default = 50; + persist attribute startUpCurrentLevel; + ram attribute featureMap default = 3; + ram attribute clusterRevision default = 5; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster ColorControl { + ram attribute currentHue default = 0x00; + ram attribute currentSaturation default = 0x00; + ram attribute remainingTime default = 0x0000; + ram attribute currentX default = 0x616B; + ram attribute currentY default = 0x607D; + ram attribute colorTemperatureMireds default = 0x00FA; + ram attribute colorMode default = 0x01; + ram attribute options default = 0x00; + ram attribute numberOfPrimaries; + ram attribute primary1X; + ram attribute primary1Y; + ram attribute primary1Intensity; + ram attribute primary2X; + ram attribute primary2Y; + ram attribute primary2Intensity; + ram attribute primary3X; + ram attribute primary3Y; + ram attribute primary3Intensity; + ram attribute primary4X; + ram attribute primary4Y; + ram attribute primary4Intensity; + ram attribute primary5X; + ram attribute primary5Y; + ram attribute primary5Intensity; + ram attribute primary6X; + ram attribute primary6Y; + ram attribute primary6Intensity; + ram attribute enhancedCurrentHue default = 0x0000; + ram attribute enhancedColorMode default = 0x01; + ram attribute colorLoopActive default = 0x00; + ram attribute colorLoopDirection default = 0x00; + ram attribute colorLoopTime default = 0x0019; + ram attribute colorLoopStartEnhancedHue default = 0x2300; + ram attribute colorLoopStoredEnhancedHue default = 0x0000; + ram attribute colorCapabilities default = 0x1F; + ram attribute colorTempPhysicalMinMireds default = 0x0000; + ram attribute colorTempPhysicalMaxMireds default = 0xFEFF; + ram attribute coupleColorTempToLevelMinMireds; + ram attribute startUpColorTemperatureMireds; + ram attribute featureMap default = 0x1F; + ram attribute clusterRevision default = 6; + } +} + + diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap new file mode 100644 index 00000000000000..e8e05aaba1f75c --- /dev/null +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap @@ -0,0 +1,8384 @@ +{ + "featureLevel": 98, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "switch type", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "switch actions", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OTAUpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StateTransition", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "VersionApplied", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "DownloadError", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "en-US", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 0, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "HardwareFaultChange", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "RadioFaultChange", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "NetworkFaultChange", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DetachedRoleCount", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChildRoleCount", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouterRoleCount", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRoleCount", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AttachAttemptCount", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionIdChangeCount", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BetterPartitionAttachAttemptCount", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ParentChangeCount", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxTotalCount", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxUnicastCount", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBroadcastCount", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckRequestedCount", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckedCount", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxNoAckRequestedCount", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataCount", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataPollCount", + "code": 29, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconCount", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconRequestCount", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxOtherCount", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxRetryCount", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCcaCount", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrAbortCount", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrBusyChannelCount", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxTotalCount", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxUnicastCount", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBroadcastCount", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataCount", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataPollCount", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconCount", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconRequestCount", + "code": 45, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxOtherCount", + "code": 46, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxAddressFilteredCount", + "code": 47, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDestAddrFilteredCount", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDuplicatedCount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrNoFrameCount", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrUnknownNeighborCount", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrInvalidSrcAddrCount", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrSecCount", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrFcsCount", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrOtherCount", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveTimestamp", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PendingTimestamp", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Delay", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "WiFiVersion", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "WiFiVersionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelNumber", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RSSI", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconLostCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "Disconnection", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AssociationFailure", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ConnectionStatus", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "PHYRate", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PHYRateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FullDuplex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketRxCount", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketTxCount", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCount", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CollisionCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CarrierDetect", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TimeSinceReset", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "NumberOfPositions", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentPosition", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-extendedcolorlight", + "deviceTypeRef": { + "code": 269, + "profileId": 259, + "label": "MA-extendedcolorlight", + "name": "MA-extendedcolorlight" + }, + "deviceTypes": [ + { + "code": 269, + "profileId": 259, + "label": "MA-extendedcolorlight", + "name": "MA-extendedcolorlight" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 269 + ], + "deviceTypeName": "MA-extendedcolorlight", + "deviceTypeCode": 269, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedAddScene", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedViewScene", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CopyScene", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "OffWithEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "OnWithRecallGlobalScene", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "OnWithTimedOff", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GlobalSceneControl", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OnTime", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OffWaitTime", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StartUpOnOff", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "OnOffStartUpOnOff", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x254", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MinLevel", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxLevel", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentFrequency", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinFrequency", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxFrequency", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "LevelControlOptions", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OnOffTransitionTime", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnLevel", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTransitionTime", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffTransitionTime", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DefaultMoveRate", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "50", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpCurrentLevel", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToHue", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveHue", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepHue", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToSaturation", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveSaturation", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepSaturation", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToHueAndSaturation", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToColor", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveColor", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepColor", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToColorTemperature", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedMoveToHue", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedMoveHue", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedStepHue", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedMoveToHueAndSaturation", + "code": 67, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ColorLoopSet", + "code": 68, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopMoveStep", + "code": 71, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveColorTemperature", + "code": 75, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepColorTemperature", + "code": 76, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "6", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "CurrentHue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentSaturation", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentX", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x616B", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentY", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x607D", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DriftCompensation", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CompensationText", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorTemperatureMireds", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00FA", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorMode", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NumberOfPrimaries", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Primary1X", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1Y", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1Intensity", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2X", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2Y", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2Intensity", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3X", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3Y", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3Intensity", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4X", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4Y", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4Intensity", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5X", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5Y", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5Intensity", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6X", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6Y", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6Intensity", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WhitePointX", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WhitePointY", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRX", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRY", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRIntensity", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGX", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGY", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGIntensity", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBX", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBY", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBIntensity", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnhancedCurrentHue", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "EnhancedColorMode", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopActive", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopDirection", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopTime", + "code": 16388, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0019", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopStartEnhancedHue", + "code": 16389, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x2300", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopStoredEnhancedHue", + "code": 16390, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorCapabilities", + "code": 16394, + "mfgCode": null, + "side": "server", + "type": "bitmap16", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1F", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorTempPhysicalMinMireds", + "code": 16395, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorTempPhysicalMaxMireds", + "code": 16396, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFEFF", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CoupleColorTempToLevelMinMireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StartUpColorTemperatureMireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "6", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Occupancy", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "OccupancyBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OccupancySensorType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OccupancySensorTypeBitmap", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0 + }, + { + "endpointTypeName": "MA-extendedcolorlight", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0 + } + ], + "log": [] +} \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index 39d4d46e7ac9ef..a91fb7fcc4ada7 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -1256,58 +1256,6 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u clusterRevision = 65533; } -/** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. -Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. -Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ -server cluster Switch = 59 { - bitmap Feature : BITMAP32 { - kLatchingSwitch = 0x1; - kMomentarySwitch = 0x2; - kMomentarySwitchRelease = 0x4; - kMomentarySwitchLongPress = 0x8; - kMomentarySwitchMultiPress = 0x10; - } - - info event SwitchLatched = 0 { - INT8U newPosition = 0; - } - - info event InitialPress = 1 { - INT8U newPosition = 0; - } - - info event LongPress = 2 { - INT8U newPosition = 0; - } - - info event ShortRelease = 3 { - INT8U previousPosition = 0; - } - - info event LongRelease = 4 { - INT8U previousPosition = 0; - } - - info event MultiPressOngoing = 5 { - INT8U newPosition = 0; - INT8U currentNumberOfPressesCounted = 1; - } - - info event MultiPressComplete = 6 { - INT8U previousPosition = 0; - INT8U totalNumberOfPressesCounted = 1; - } - - readonly attribute int8u numberOfPositions = 0; - readonly attribute int8u currentPosition = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { enum CommissioningWindowStatusEnum : ENUM8 { @@ -1856,47 +1804,11 @@ server cluster ColorControl = 768 { command StepColorTemperature(StepColorTemperatureRequest): DefaultSuccess = 76; } -/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ -server cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { - kPIR = 0; - kUltrasonic = 1; - kPIRAndUltrasonic = 2; - kPhysicalContact = 3; - } - - bitmap OccupancyBitmap : BITMAP8 { - kOccupied = 0x1; - } - - bitmap OccupancySensorTypeBitmap : BITMAP8 { - kPIR = 0x1; - kUltrasonic = 0x2; - kPhysicalContact = 0x4; - } - - readonly attribute OccupancyBitmap occupancy = 0; - readonly attribute OccupancySensorTypeEnum occupancySensorType = 1; - readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - endpoint 0 { device type ma_rootdevice = 22, version 1; binding cluster OtaSoftwareUpdateProvider; - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -2096,13 +2008,6 @@ endpoint 0 { ram attribute clusterRevision default = 1; } - server cluster Switch { - ram attribute numberOfPositions default = 2; - ram attribute currentPosition; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster AdministratorCommissioning { callback attribute windowStatus default = 0; callback attribute adminFabricIndex default = 1; @@ -2241,14 +2146,6 @@ endpoint 1 { ram attribute featureMap default = 0x1F; ram attribute clusterRevision default = 6; } - - server cluster OccupancySensing { - ram attribute occupancy; - ram attribute occupancySensorType; - ram attribute occupancySensorTypeBitmap; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 3; - } } diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap index 26f2b8f3f04044..951855989958db 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -219,7 +219,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -4684,7 +4684,7 @@ "mfgCode": null, "define": "SWITCH_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "attributes": [ { "name": "NumberOfPositions", @@ -8277,7 +8277,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "attributes": [ { "name": "Occupancy", diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index b94416839d359e..f599263490c64a 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -1166,58 +1166,6 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int16u clusterRevision = 65533; } -/** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. -Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. -Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ -server cluster Switch = 59 { - bitmap Feature : BITMAP32 { - kLatchingSwitch = 0x1; - kMomentarySwitch = 0x2; - kMomentarySwitchRelease = 0x4; - kMomentarySwitchLongPress = 0x8; - kMomentarySwitchMultiPress = 0x10; - } - - info event SwitchLatched = 0 { - INT8U newPosition = 0; - } - - info event InitialPress = 1 { - INT8U newPosition = 0; - } - - info event LongPress = 2 { - INT8U newPosition = 0; - } - - info event ShortRelease = 3 { - INT8U previousPosition = 0; - } - - info event LongRelease = 4 { - INT8U previousPosition = 0; - } - - info event MultiPressOngoing = 5 { - INT8U newPosition = 0; - INT8U currentNumberOfPressesCounted = 1; - } - - info event MultiPressComplete = 6 { - INT8U previousPosition = 0; - INT8U totalNumberOfPressesCounted = 1; - } - - readonly attribute int8u numberOfPositions = 0; - readonly attribute int8u currentPosition = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { enum CommissioningWindowStatusEnum : ENUM8 { @@ -1766,47 +1714,11 @@ server cluster ColorControl = 768 { command StepColorTemperature(StepColorTemperatureRequest): DefaultSuccess = 76; } -/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ -server cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { - kPIR = 0; - kUltrasonic = 1; - kPIRAndUltrasonic = 2; - kPhysicalContact = 3; - } - - bitmap OccupancyBitmap : BITMAP8 { - kOccupied = 0x1; - } - - bitmap OccupancySensorTypeBitmap : BITMAP8 { - kPIR = 0x1; - kUltrasonic = 0x2; - kPhysicalContact = 0x4; - } - - readonly attribute OccupancyBitmap occupancy = 0; - readonly attribute OccupancySensorTypeEnum occupancySensorType = 1; - readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - endpoint 0 { device type ma_rootdevice = 22, version 1; binding cluster OtaSoftwareUpdateProvider; - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -1958,13 +1870,6 @@ endpoint 0 { ram attribute clusterRevision default = 1; } - server cluster Switch { - ram attribute numberOfPositions default = 2; - ram attribute currentPosition; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster AdministratorCommissioning { callback attribute windowStatus default = 0; callback attribute adminFabricIndex default = 1; @@ -2103,14 +2008,6 @@ endpoint 1 { ram attribute featureMap default = 0x1F; ram attribute clusterRevision default = 6; } - - server cluster OccupancySensing { - ram attribute occupancy; - ram attribute occupancySensorType; - ram attribute occupancySensorTypeBitmap; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 3; - } } diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap index 9e99cbc70f93b6..ecd8f43cba5780 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -219,7 +219,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -4684,7 +4684,7 @@ "mfgCode": null, "define": "SWITCH_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "attributes": [ { "name": "NumberOfPositions", @@ -8277,7 +8277,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "attributes": [ { "name": "Occupancy", diff --git a/examples/platform/bouffalolab/bl602/flash_config/factory_data.dts b/examples/platform/bouffalolab/bl602/flash_config/factory_data.dts deleted file mode 100644 index 77eca2a07ad56d..00000000000000 --- a/examples/platform/bouffalolab/bl602/flash_config/factory_data.dts +++ /dev/null @@ -1,361 +0,0 @@ -/dts-v1/; -/include/ "bl602_base.dtsi"; -// version: 17 -// last_comp_version: 16 -// boot_cpuid_phys: 0x0 - -/ { - model = "bl bl602 IOT board"; - compatible = "bl,bl602-sample", "bl,bl602-common"; - #address-cells = <0x1>; - #size-cells = <0x1>; - gpio { - #address-cells = <1>; - #size-cells = <1>; - max_num = <40>; - gpio0 { - status = "okay"; - pin = <5>; - feature = "led"; - active = "Hi"; //Hi or Lo - mode = "blink"; //blink or hearbeat - time = <100>; //duration for this mode - }; - gpio1 { - status = "disable"; - pin = <6>; - feature = "led"; - active = "Hi"; //Hi or Lo - mode = "blink"; //blink or hearbeat - time = <100>; //duration for this mode - }; - gpio2 { - status = "okay"; - pin = <2>; - feature = "button"; - active = "Hi"; - mode = "multipress"; - button { - debounce = <10>; - short_press_ms { - start = <100>; - end = <3000>; - kevent = <2>; - }; - long_press_ms { - start = <6000>; - end = <10000>; - kevent = <3>; - }; - longlong_press_ms { - start = <15000>; - kevent = <4>; - }; - trig_level = "Hi"; - }; - hbn_use = "disable"; - }; - }; - i2s { - #address-cells = <1>; - #size-cells = <1>; - i2s@40017000 { - status = "okay"; - compatible = "bl602_i2s"; - reg = <0x40017000 0x100>; - mclk_only = "okay"; - pin { - mclk = <11>; - }; - }; - i2s@40017100 { - status = "okay"; - compatible = "bl602_i2s"; - reg = <0x40017100 0x100>; - mclk_only = "disable"; - pin { - bclk = <12>; - fs = <29>; - do = <30>; - di = <31>; - }; - }; - }; - i2c { - #address-cells = <1>; - #size-cells = <1>; - i2c@40011000 { - status = "okay"; - compatible = "bl602_i2c"; - reg = <0x40011000 0x100>; - pin { - scl = <32>; - sda = <13>; - }; - devices { - list_addr = <0x18 0x21>; - list_driver = "i2c_es8311", "i2c_gc0308>"; - }; - }; - i2c@40011100 { - status = "disable"; - compatible = "bl602_i2c"; - reg = <0x40011100 0x100>; - pin { - /*empty here*/ - }; - }; - }; - timer { - #address-cells = <1>; - #size-cells = <1>; - timer@40014000 { - status = "disable"; - compatible = "bl602_timer"; - reg = <0x40014000 0x100>; - }; - timer@40014100 { - status = "disable"; - compatible = "bl602_timer"; - reg = <0x40014100 0x100>; - }; - }; - pwm { - #address-cells = <1>; - #size-cells = <1>; - pwm@4000A420 { - status = "okay"; - compatible = "bl602_pwm"; - reg = <0x4000A420 0x20>; - path = "/dev/pwm0"; - id = <0>; - pin = <0>; - freq = <800000>; - duty = <50>; - }; - pwm@4000A440 { - status = "disable"; - reg = <0x4000A440 0x20>; - path = "/dev/pwm1"; - id = <1>; - pin = <1>; - freq = <5000>; - duty = <50>; - }; - pwm@4000A460 { - status = "disable"; - reg = <0x4000A460 0x20>; - path = "/dev/pwm2"; - id = <2>; - pin = <2>; - freq = <5000>; - duty = <50>; - }; - pwm@4000A480 { - status = "disable"; - reg = <0x4000A480 0x20>; - path = "/dev/pwm3"; - id = <3>; - pin = <3>; - freq = <5000>; - duty = <50>; - }; - pwm@4000A4A0 { - status = "disable"; - reg = <0x4000A4A0 0x20>; - path = "/dev/pwm4"; - id = <4>; - pin = <4>; - freq = <5000>; - duty = <50>; - }; - }; - ir { - #address-cells = <1>; - #size-cells = <1>; - ctrltype = <0>; - tx { - status = "disable"; - pin = <11>; // only support 11 - mode = "NEC"; // NEC,ExtenedNEC,RC5,SWM - interval = <100>; // ms - active_mode = "Hi"; //Hi,Lo - }; - rx { - status = "okay"; - pin = <12>; // only support 12 13 - mode = "NEC"; // NEC,ExtenedNEC,RC5,SWM - active_mode = "Hi"; //Hi,Lo - data_check = <2>; //bit 0:check cmd, bit 1:check addr - }; - }; - uart { - #address-cells = <1>; - #size-cells = <1>; - uart@4000A000 { - status = "okay"; - id = <0>; - compatible = "bl602_uart"; - path = "/dev/ttyS0"; - baudrate = <2000000>; - pin { - rx = <7>; - tx = <16>; - }; - buf_size { - rx_size = <512>; - tx_size = <512>; - }; - feature { - tx = "okay"; - rx = "okay"; - cts = "disable"; - rts = "disable"; - }; - }; - uart@4000A100 { - status = "okay"; - id = <1>; - compatible = "bl602_uart"; - path = "/dev/ttyS1"; - baudrate = <115200>; - pin { - rx = <3>; - tx = <4>; - }; - buf_size { - rx_size = <512>; - tx_size = <512>; - }; - feature { - tx = "okay"; - rx = "okay"; - cts = "disable"; - rts = "disable"; - }; - }; - }; - spi { - #address-cells = <1>; - #size-cells = <1>; - spi@4000F000 { - status = "okay"; /* okay disable */ - mode = "master"; - reg = <0x4000F000 0x100>; /* 4KB */ - path = "/dev/spi0"; - port = <0>; - polar_phase = <1>; /* 0,1,2,3 */ - freq = <6000000>; - pin { - clk = <3>; - cs = <2>; - mosi = <1>; - miso = <0>; - }; - dma_cfg { - tx_dma_ch = <2>; - rx_dma_ch = <3>; - }; - }; - }; - gpip { - #address-cells = <1>; - #size-cells = <1>; - adc_key { - status = "disable"; - pin = <9>; - interrupt = <3>; - key_vol = <0 100 400 300 500>; - key_pcb = "SW1", "SW2", "SW3", "SW4","SW5"; - key_event = "Usr1", "Usr2", "Start", "Up", "Down"; - key_raw = <1 2 3 4 5>; - }; - }; - qspi { - #address-cells = <1>; - #size-cells = <1>; - qspi@4000A000 { - status = "disable"; - reg = <0x4000A000 0x1000>;/* 4KB */ - }; - }; - wifi { - #address-cells = <1>; - #size-cells = <1>; - region { - country_code = <86>; - }; - mac { - mode = "MBF"; - sta_mac_addr = [C8 43 57 82 73 40]; - ap_mac_addr = [C8 43 57 82 73 02]; - }; - sta { - ssid = "yourssid"; - pwd = "yourapssword"; - auto_connect_enable = <0>; - }; - ap { - ssid = "bl_test_005"; - pwd = "12345678"; - ap_channel = <11>; - auto_chan_detect = "disable"; - }; - brd_rf { - xtal_mode = "MF"; - xtal = <36 36 0 60 60>; - /* - pwr_table = < 4 3 3 186 - 4 3 4 176 - 4 3 5 167 - 3 3 0 159 - 3 3 1 149 - 3 3 2 140 - 3 3 3 129 - 3 3 4 119 - 3 3 5 110 - 2 3 0 101 - 2 3 1 91 - 2 3 2 82 - 2 3 3 72 - 2 3 4 62 - 2 3 5 52 - 1 3 3 10>; - */ - pwr_mode = "bf";//B: only use power offset in EFUSE; b: use power offset in EFUSE with incremental mode; F: only use power offset in Flash; f: use power offset in Flash with incremental mode - pwr_table_11b = <20 20 20 18>;//1Mbps 2Mbps 5.5Mbps 11Mbps - pwr_table_11g = <18 18 18 18 18 18 14 14>; //6Mbps 9Mbps 12Mbps 18MBps 24Mbps 36Mbps 48Mbps 54Mbps - pwr_table_11n = <18 18 18 18 18 16 14 14>; //MCS0 MCS1 MCS2 MCS3 MCS4 MCS5 MCS6 MCS7 - pwr_offset = <10 10 10 10 10 10 10 10 10 10 10 10 10 10>;//due to the limit of current DTC, negative value is used. So we work around by adding all the poweroffset with 10. so 8 represents -2; 10 represents 0; 13 represents 3 - }; - rf_temp { - en_tcal = <0>; - linear_or_follow = <1>; - Tchannels = <2412 2427 2442 2457 2472>; - Tchannel_os = <180 168 163 160 157>; - Tchannel_os_low = <199 186 170 165 160>; - Troom_os = <255>; - //negative value is NOT supported. So we use '256' for 0, '255' for -1, '257' for 1,'511' for 256 - }; - }; - bluetooth { - #address-cells = <1>; - #size-cells = <1>; - brd_rf { - pwr_table_ble = <13>; //range:0~15dbm - }; - }; - MFD { - vendor_name = "Bouffalo Lab"; - vendor_id = [0x0d 0x13]; - product_name = "Test Device"; - product_id = [0x01 0xf0]; - product_part_number = "Test Part Number"; - product_url = "Test Product URL"; - product_label = "Test Product Label"; - manufactoring_date = <2023 02 26>; - hardware_version = [0x01 0x00]; - hardware_version_string = "ver_0.1"; - }; -}; -}; diff --git a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml b/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml deleted file mode 100644 index b7cf58abd724bc..00000000000000 --- a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml +++ /dev/null @@ -1,107 +0,0 @@ -[pt_table] -#partition table is 4K in size -address0 = 0xE000 -address1 = 0xF000 - -[[pt_entry]] -type = 0 -name = "FW" -device = 0 -address0 = 0x10000 -size0 = 0x15C000 -address1 = 0x16C000 -size1 = 0x4000 -# compressed image must set len,normal image can left it to 0 -len = 0 - -[[pt_entry]] -type = 2 -name = "mfg" -device = 0 -address0 = 0x16C000 -size0 = 0x4000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - -[[pt_entry]] -type = 3 -name = "media" -device = 0 -address0 = 0x1A1000 -size0 = 0x47000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - -[[pt_entry]] -type = 4 -name = "PSM" -device = 0 -address0 = 0x1E8000 -size0 = 0x4000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - -[[pt_entry]] -type = 5 -name = "KEY" -device = 0 -address0 = 0x1F0000 -size0 = 0x2000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - -[[pt_entry]] -type = 6 -name = "DATA" -device = 0 -address0 = 0x1F2000 -size0 = 0x5000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - - -[[pt_entry]] -type = 7 -name = "factory" -device = 0 -address0 = 0x1F7000 -size0 = 0x7000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - - -[[pt_entry]] -type = 8 -name = "MFD" -device = 0 -address0 = 0x1FE000 -size0 = 0x1000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - - -#if user want to put RF calibration data on flash, uncomment following pt entry -#[[pt_entry]] -#type = 9 -#name = "rf_para" -#device = 0 -#address0 = 0x1FF000 -#size0 = 0x1000 -#address1 = 0 -#size1 = 0 -## compressed image must set len,normal image can left it to 0 -#len = 0 diff --git a/examples/platform/bouffalolab/bl702/ldscripts/psram_flash.ld b/examples/platform/bouffalolab/bl702/ldscripts/psram_flash.ld index c18b569ac062e3..04cff2d1b69c0f 100644 --- a/examples/platform/bouffalolab/bl702/ldscripts/psram_flash.ld +++ b/examples/platform/bouffalolab/bl702/ldscripts/psram_flash.ld @@ -226,6 +226,12 @@ SECTIONS KEEP(*libMatterDeviceInfoProviderExample.a:*(.sbss.*)) KEEP(*libMatterDeviceInfoProviderExample.a:*(.bss.*)) + . = ALIGN(16); + KEEP(*libopenthread-ftd.a:*(.sbss.*)) + KEEP(*libopenthread-ftd.a:*(.bss.*)) + KEEP(*libopenthread-mtd.a:*(.sbss.*)) + KEEP(*libopenthread-mtd.a:*(.bss.*)) + . = ALIGN(16); KEEP(*src/app/clusters/*/bouffalolab*.cpp.o(.sbss.*)) KEEP(*src/app/clusters/*/bouffalolab*.cpp.o(.bss.*)) @@ -246,6 +252,18 @@ SECTIONS KEEP(*sdk_lwip.*.c.o(.sbss.*)) KEEP(*sdk_lwip.*.c.o(.bss.*)) + . = ALIGN(16); + KEEP(*sdk_lwip.*.c.o(.sbss.*)) + KEEP(*sdk_lwip.*.c.o(.bss.*)) + + . = ALIGN(16); + KEEP(*libopenthread_br.a:*(.sbss.*)) + KEEP(*libopenthread_br.a:*(.bss.*)) + + . = ALIGN(16); + KEEP(*third_party/tcplp*.c.o(.bss.*)) + KEEP(*third_party/tcplp*.c.o(.bss.*)) + . = ALIGN(16); KEEP(*stack_main.o(.bss.*)) diff --git a/examples/platform/bouffalolab/bl702l/ldscripts/psram_flash_rom.ld b/examples/platform/bouffalolab/bl702l/ldscripts/psram_flash_rom.ld index 60d1ea8358396e..13fd522f638131 100644 --- a/examples/platform/bouffalolab/bl702l/ldscripts/psram_flash_rom.ld +++ b/examples/platform/bouffalolab/bl702l/ldscripts/psram_flash_rom.ld @@ -208,8 +208,6 @@ SECTIONS KEEP(*sdk_lwip.*.c.o(.bss.*)) KEEP(*lwip.*.c.o(.bss.*)) - - . = ALIGN(16); KEEP(*stack_main.o(.bss.*)) diff --git a/examples/platform/bouffalolab/common/plat/aos_task.c b/examples/platform/bouffalolab/common/iot_sdk/aos_task.c similarity index 100% rename from examples/platform/bouffalolab/common/plat/aos_task.c rename to examples/platform/bouffalolab/common/iot_sdk/aos_task.c diff --git a/examples/platform/bouffalolab/common/plat/demo_pwm.c b/examples/platform/bouffalolab/common/iot_sdk/demo_pwm.c similarity index 94% rename from examples/platform/bouffalolab/common/plat/demo_pwm.c rename to examples/platform/bouffalolab/common/iot_sdk/demo_pwm.c index c279ddc1aaec7c..b2343b63e079fa 100644 --- a/examples/platform/bouffalolab/common/plat/demo_pwm.c +++ b/examples/platform/bouffalolab/common/iot_sdk/demo_pwm.c @@ -8,8 +8,8 @@ #include -#include "board.h" #include "demo_pwm.h" +#include "mboard.h" #define PWM_FREQ 1000 #define PWM_DUTY_CYCLE 10000 @@ -49,7 +49,7 @@ hosal_pwm_dev_t rgb_pwm[] = { #endif }; -void demo_hosal_pwm_init(void) +void demo_pwm_init(void) { /* init pwm with given settings */ for (uint32_t i = 0; i < MAX_PWM_CHANNEL; i++) @@ -58,7 +58,7 @@ void demo_hosal_pwm_init(void) } } -void demo_hosal_pwm_start(void) +void demo_pwm_start(void) { /* start pwm */ for (uint32_t i = 0; i < MAX_PWM_CHANNEL; i++) @@ -67,7 +67,7 @@ void demo_hosal_pwm_start(void) } } -void demo_hosal_pwm_change_param(hosal_pwm_config_t * para) +void demo_pwm_change_param(hosal_pwm_config_t * para) { /* change pwm param */ for (uint32_t i = 0; i < MAX_PWM_CHANNEL; i++) @@ -80,7 +80,7 @@ void demo_hosal_pwm_change_param(hosal_pwm_config_t * para) } } -void demo_hosal_pwm_stop(void) +void demo_pwm_stop(void) { for (uint32_t i = 0; i < MAX_PWM_CHANNEL; i++) { @@ -101,7 +101,7 @@ void set_level(uint8_t currLevel) para.duty_cycle = currLevel * PWM_DUTY_CYCLE / 254; para.freq = PWM_FREQ; - demo_hosal_pwm_change_param(¶); + demo_pwm_change_param(¶); } void set_color_red(uint8_t currLevel) @@ -186,7 +186,7 @@ void set_color(uint8_t currLevel, uint8_t currHue, uint8_t currSat) para[2].duty_cycle = green * PWM_DUTY_CYCLE / 254; para[2].freq = PWM_FREQ; - demo_hosal_pwm_change_param(para); + demo_pwm_change_param(para); #else set_level(currLevel); #endif diff --git a/examples/platform/bouffalolab/common/iot_sdk/platform_port.c b/examples/platform/bouffalolab/common/iot_sdk/platform_port.c new file mode 100644 index 00000000000000..9ffd48ec10811b --- /dev/null +++ b/examples/platform/bouffalolab/common/iot_sdk/platform_port.c @@ -0,0 +1,405 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed 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. + */ + +#include +#include + +#include +#include +#include + +#include + +#include + +#if BL702_ENABLE +#include +#include +#elif BL702L_ENABLE +#include +#include +#elif BL602_ENABLE +#include +#endif +#include +#if BL702L_ENABLE +#include +#endif +#include +#include +#ifdef CFG_USE_PSRAM +#include +#endif +#include +#include +#include + +#include + +#if BL702L_ENABLE +#include +#include +#include +#endif + +#include + +#include "mboard.h" +#include + +HOSAL_UART_DEV_DECL(uart_stdio, CHIP_UART_PORT, CHIP_UART_PIN_TX, CHIP_UART_PIN_RX, CHIP_UART_BAUDRATE); + +#ifdef SYS_AOS_LOOP_ENABLE +void aos_loop_start(void); +#endif + +// ================================================================================ +// FreeRTOS Callbacks +// ================================================================================ +unsigned int sleep(unsigned int seconds) +{ + const TickType_t xDelay = 1000 * seconds / portTICK_PERIOD_MS; + vTaskDelay(xDelay); + return 0; +} + +#if !BL702L_ENABLE +void vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) +{ + printf("Stack Overflow checked. Stack name %s", pcTaskName); + while (true) + { + /*empty here*/ + } +} + +void vApplicationMallocFailedHook(void) +{ + printf("Memory Allocate Failed. Current left size is %d bytes", xPortGetFreeHeapSize()); + while (true) + { + /*empty here*/ + } +} + +void vApplicationIdleHook(void) +{ + // bl_wdt_feed(); + __asm volatile(" wfi "); +} + +void vApplicationGetIdleTaskMemory(StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, + uint32_t * pulIdleTaskStackSize) +{ + /* If the buffers to be provided to the Idle task are declared inside this + function then they must be declared static - otherwise they will be allocated on + the stack and so not exists after this function exits. */ + + /* Pass out a pointer to the StaticTask_t structure in which the Idle task's + state will be stored. */ + *ppxIdleTaskTCBBuffer = (StaticTask_t *) pvPortMalloc(sizeof(StaticTask_t)); + + /* Pass out the array that will be used as the Idle task's stack. */ + *ppxIdleTaskStackBuffer = (StackType_t *) pvPortMalloc(sizeof(StackType_t) * configMINIMAL_STACK_SIZE); + + /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer. + Note that, as the array is necessarily of type StackType_t, + configMINIMAL_STACK_SIZE is specified in words, not bytes. */ + *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE; +} + +/* configSUPPORT_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the +application must provide an implementation of vApplicationGetTimerTaskMemory() +to provide the memory that is used by the Timer service task. */ +void vApplicationGetTimerTaskMemory(StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, + uint32_t * pulTimerTaskStackSize) +{ + /* If the buffers to be provided to the Timer task are declared inside this + function then they must be declared static - otherwise they will be allocated on + the stack and so not exists after this function exits. */ + + /* Pass out a pointer to the StaticTask_t structure in which the Timer + task's state will be stored. */ + *ppxTimerTaskTCBBuffer = (StaticTask_t *) pvPortMalloc(sizeof(StaticTask_t)); + + /* Pass out the array that will be used as the Timer task's stack. */ + *ppxTimerTaskStackBuffer = (StackType_t *) pvPortMalloc(sizeof(StackType_t) * configTIMER_TASK_STACK_DEPTH); + + /* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer. + Note that, as the array is necessarily of type StackType_t, + configTIMER_TASK_STACK_DEPTH is specified in words, not bytes. */ + *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH; +} + +#if (configUSE_TICK_HOOK != 0) +void vApplicationTickHook(void) +{ +#if defined(CFG_USB_CDC_ENABLE) + extern void usb_cdc_monitor(void); + usb_cdc_monitor(); +#endif +} +#endif + +void vApplicationSleep(TickType_t xExpectedIdleTime) {} + +void vAssertCalled(void) +{ + void * ra = (void *) __builtin_return_address(0); + +#if CONF_ENABLE_FRAME_PTR == 0 + taskDISABLE_INTERRUPTS(); +#endif + + if (xPortIsInsideInterrupt()) + { + printf("vAssertCalled, ra = %p in ISR\r\n", (void *) ra); + } + else + { + printf("vAssertCalled, ra = %p in task %s\r\n", (void *) ra, pcTaskGetName(NULL)); + } + +#if CONF_ENABLE_FRAME_PTR + portABORT(); +#endif + + while (true) + ; +} +#endif + +#if BL702L_ENABLE +void __attribute__((weak)) user_vAssertCalled(void) +{ + void * ra = (void *) __builtin_return_address(0); + + taskDISABLE_INTERRUPTS(); + + if (xPortIsInsideInterrupt()) + { + printf("vAssertCalled, ra = %p in ISR\r\n", (void *) ra); + } + else + { + printf("vAssertCalled, ra = %p in task %s\r\n", (void *) ra, pcTaskGetName(NULL)); + } + + while (true) + ; +} + +void __attribute__((weak)) user_vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) +{ + puts("Stack Overflow checked\r\n"); + if (pcTaskName) + { + printf("Stack name %s\r\n", pcTaskName); + } + while (1) + { + /*empty here*/ + } +} + +void __attribute__((weak)) user_vApplicationMallocFailedHook(void) +{ + printf("Memory Allocate Failed. Current left size is %d bytes\r\n", xPortGetFreeHeapSize()); +#if defined(CFG_USE_PSRAM) + printf("Current psram left size is %d bytes\r\n", xPortGetFreeHeapSizePsram()); +#endif + while (1) + { + /*empty here*/ + } +} + +void bflb_assert(void) __attribute__((weak, alias("user_vAssertCalled"))); +#else +void user_vAssertCalled(void) __attribute__((weak, alias("vAssertCalled"))); +void bflb_assert(void) __attribute__((weak, alias("vAssertCalled"))); +#endif + +// ================================================================================ +// Main Code +// ================================================================================ +extern uint8_t _heap_start; +extern size_t _heap_size; // @suppress("Type cannot be resolved") + +#if BL602_ENABLE +extern uint8_t _heap_wifi_start; +extern uint8_t _heap_wifi_size; // @suppress("Type cannot be resolved") +static const HeapRegion_t xHeapRegions[] = { + { &_heap_start, (unsigned int) &_heap_size }, // set on runtime + { &_heap_wifi_start, (unsigned int) &_heap_wifi_size }, + { NULL, 0 } /* Terminates the array. */ +}; +#elif BL702_ENABLE +static const HeapRegion_t xHeapRegions[] = { + { &_heap_start, (size_t) &_heap_size }, // set on runtime + { NULL, 0 } /* Terminates the array. */ +}; +#elif BL702L_ENABLE +static const HeapRegion_t xHeapRegions[] = { + { &_heap_start, (size_t) &_heap_size }, // set on runtime + { NULL, 0 } /* Terminates the array. */ +}; +#endif + +#ifdef CFG_USE_PSRAM +extern uint32_t __psram_bss_init_start; +extern uint32_t __psram_bss_init_end; + +static uint32_t __attribute__((section(".rsvd_data"))) psram_reset_count; + +extern uint8_t _heap3_start; +extern size_t _heap3_size; // @suppress("Type cannot be resolved") +static const HeapRegion_t xPsramHeapRegions[] = { + { &_heap3_start, (size_t) &_heap3_size }, { NULL, 0 } /* Terminates the array. */ +}; + +size_t get_heap3_size(void) +{ + return (size_t) &_heap3_size; +} + +void do_psram_test() +{ + static const char teststr[] = "bouffalolab psram test string"; + + do + { + uint8_t * pheap = &_heap3_start; + size_t size = (size_t) &_heap3_size; + + size = size > sizeof(teststr) ? sizeof(teststr) : size; + memset(pheap, 0, size); + if (pheap[0] != 0) + { + break; + } + + memcpy(pheap, teststr, size); + if (0 != memcmp(pheap, teststr, size)) + { + break; + } + + arch_memset4(&__psram_bss_init_start, 0, &__psram_bss_init_end - &__psram_bss_init_start); + + psram_reset_count = 0xffffff00; + return; + } while (0); + + if ((psram_reset_count & 0xffffff00) != 0xffffff00) + { + psram_reset_count = 0xffffff00; + } + + if ((psram_reset_count & 0x000000ff) > 3) + { + printf("PSRAM is still failed to initialize after %ld system reset", psram_reset_count & 0x000000ff); + vAssertCalled(); + } + + psram_reset_count = ((psram_reset_count & 0x000000ff) + 1) | 0xffffff00; + bl_sys_reset_system(); +} +#endif + +void setup_heap() +{ + bl_sys_init(); + +#if BL702_ENABLE + bl_sys_em_config(); +#elif BL702L_ENABLE + bl_sys_em_config(); + + // Initialize rom data + extern uint8_t _rom_data_run; + extern uint8_t _rom_data_load; + extern uint8_t _rom_data_size; + memcpy((void *) &_rom_data_run, (void *) &_rom_data_load, (size_t) &_rom_data_size); +#endif + + vPortDefineHeapRegions(xHeapRegions); + +#ifdef CFG_USE_PSRAM + bl_psram_init(); + do_psram_test(); + vPortDefineHeapRegionsPsram(xPsramHeapRegions); +#endif +} + +size_t get_heap_size(void) +{ + return (size_t) &_heap_size; +} + +void app_init(void) +{ + bl_sys_early_init(); + +#if BL702L_ENABLE + rom_freertos_init(256, 400); + rom_hal_init(); + rom_lmac154_hook_init(); +#endif + + hosal_uart_init(&uart_stdio); + + blog_init(); + bl_irq_init(); +#if BL702L_ENABLE + bl_rtc_init(); +#endif + bl_sec_init(); +#if BL702_ENABLE + bl_timer_init(); +#endif + + hal_boot2_init(); + + /* board config is set after system is init*/ + hal_board_cfg(0); + +#if BL702L_ENABLE || CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + hosal_dma_init(); +#endif +#if BL602_ENABLE + wifi_td_diagnosis_init(); +#endif +} + +void platform_port_init(void) +{ + app_init(); + +#if CONFIG_ENABLE_CHIP_SHELL || PW_RPC_ENABLED + uartInit(); +#endif +#ifdef SYS_AOS_LOOP_ENABLE + aos_loop_start(); +#else +#if defined(CFG_USB_CDC_ENABLE) + extern void usb_cdc_start(int fd_console); + usb_cdc_start(-1); +#endif +#endif +} diff --git a/examples/platform/bouffalolab/common/plat/uart.c b/examples/platform/bouffalolab/common/iot_sdk/uart.c similarity index 79% rename from examples/platform/bouffalolab/common/plat/uart.c rename to examples/platform/bouffalolab/common/iot_sdk/uart.c index 35e0516e480b33..212bcaa51b9b03 100644 --- a/examples/platform/bouffalolab/common/plat/uart.c +++ b/examples/platform/bouffalolab/common/iot_sdk/uart.c @@ -19,7 +19,7 @@ #include #include -#include +#include #ifdef CFG_USB_CDC_ENABLE #include @@ -123,6 +123,45 @@ void aosUartRxCallback(int fd, void * param) xSemaphoreGiveFromISR(chipUart_var.sema, &xHigherPriorityTaskWoken); } } + +static int uartTxCallback(void * p_arg) +{ + + return 0; +} + +static int uartRxCallback(void * p_arg) +{ + uint32_t len = 0; + BaseType_t xHigherPriorityTaskWoken = 1; + + if (chipUart_var.head >= chipUart_var.tail) + { + if (chipUart_var.head < MAX_BUFFER_SIZE) + { + // len = hosal_uart_receive(&uart_stdio, chipUart_var.rxbuf + chipUart_var.head, MAX_BUFFER_SIZE - chipUart_var.head); + chipUart_var.head = (chipUart_var.head + len) % MAX_BUFFER_SIZE; + } + + if (0 == chipUart_var.head) + { + // len = hosal_uart_receive(&uart_stdio, chipUart_var.rxbuf, chipUart_var.tail - 1); + chipUart_var.head += len; + } + } + else + { + chipUart_var.head += + // hosal_uart_receive(&uart_stdio, chipUart_var.rxbuf + chipUart_var.head, chipUart_var.tail - chipUart_var.head - 1); + } + + if (chipUart_var.head != chipUart_var.tail) + { + xSemaphoreGiveFromISR(chipUart_var.sema, &xHigherPriorityTaskWoken); + } + + return 0; +} #endif void uartInit(void) diff --git a/examples/platform/bouffalolab/common/iot_sdk/uart.h b/examples/platform/bouffalolab/common/iot_sdk/uart.h new file mode 100644 index 00000000000000..ff2a398a395dd7 --- /dev/null +++ b/examples/platform/bouffalolab/common/iot_sdk/uart.h @@ -0,0 +1,37 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed 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. + */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void uartInit(void); +int16_t uartWrite(const char * Buf, uint16_t BufLength); +int16_t uartRead(char * Buf, uint16_t NbBytesToRead); + +#ifdef CFG_USB_CDC_ENABLE +void aosUartRxCallback(int fd, void * param); +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/examples/platform/bouffalolab/common/plat/LEDWidget.cpp b/examples/platform/bouffalolab/common/plat/LEDWidget.cpp index a01545ac7058dd..bf6159befb97f1 100644 --- a/examples/platform/bouffalolab/common/plat/LEDWidget.cpp +++ b/examples/platform/bouffalolab/common/plat/LEDWidget.cpp @@ -15,51 +15,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include -#include -#include -#include #include -#include +#include #include "LEDWidget.h" -void LEDWidget::Init() -{ -#ifdef LED1_PIN - mPin = LED1_PIN; - - hosal_gpio_dev_t gpio_led = { .config = OUTPUT_OPEN_DRAIN_NO_PULL, .priv = NULL }; - gpio_led.port = mPin; - - hosal_gpio_init(&gpio_led); -#endif - SetOnoff(false); -} - -void LEDWidget::Toggle(void) -{ - SetOnoff(1 - mOnoff); -} - -void LEDWidget::SetOnoff(bool state) -{ -#ifdef LED1_PIN - hosal_gpio_dev_t gpio_led = { .port = mPin, .config = OUTPUT_OPEN_DRAIN_NO_PULL, .priv = NULL }; - - mOnoff = state; - - if (state) - { - hosal_gpio_output_set(&gpio_led, 1); - } - else - { - hosal_gpio_output_set(&gpio_led, 0); - } -#endif -} - bool LEDWidget::GetOnoff(void) { return mOnoff ? true : false; @@ -70,8 +32,8 @@ void DimmableLEDWidget::Init() mOnoff = light_v = 0; #ifdef MAX_PWM_CHANNEL - demo_hosal_pwm_init(); - demo_hosal_pwm_start(); + demo_pwm_init(); + demo_pwm_start(); #endif } @@ -115,8 +77,8 @@ void ColorLEDWidget::Init() { mOnoff = light_v = light_s = light_h = 0; #ifdef MAX_PWM_CHANNEL - demo_hosal_pwm_init(); - demo_hosal_pwm_start(); + demo_pwm_init(); + demo_pwm_start(); #endif } diff --git a/examples/platform/bouffalolab/common/plat/LEDWidget.h b/examples/platform/bouffalolab/common/plat/LEDWidget.h index 935a1750620066..af1877d1089f3a 100644 --- a/examples/platform/bouffalolab/common/plat/LEDWidget.h +++ b/examples/platform/bouffalolab/common/plat/LEDWidget.h @@ -23,10 +23,11 @@ class LEDWidget { public: - void Init(void); - void SetOnoff(bool state); + virtual void Init(void) = 0; + virtual void SetOnoff(bool state) = 0; bool GetOnoff(void); - void Toggle(void); + virtual void Toggle(void) = 0; + virtual ~LEDWidget(void){}; uint8_t mOnoff; uint8_t mPin; @@ -35,10 +36,11 @@ class LEDWidget class DimmableLEDWidget : public LEDWidget { public: - void Init(void); - void Toggle(void); - void SetOnoff(bool state); + void Init(void) override; + void Toggle(void) override; + void SetOnoff(bool state) override; void SetLevel(uint8_t level); + ~DimmableLEDWidget(void) {} uint8_t light_v; }; @@ -46,11 +48,12 @@ class DimmableLEDWidget : public LEDWidget class ColorLEDWidget : public DimmableLEDWidget { public: - void Init(void); - void Toggle(void); - void SetOnoff(bool state); + void Init(void) override; + void Toggle(void) override; + void SetOnoff(bool state) override; void SetLevel(uint8_t level); void SetColor(uint8_t level, uint8_t hue, uint8_t sat); + ~ColorLEDWidget(void) {} uint8_t light_h; uint8_t light_s; diff --git a/examples/platform/bouffalolab/common/plat/demo_pwm.h b/examples/platform/bouffalolab/common/plat/demo_pwm.h index 80eadb6811bf8d..d434ee9addec2b 100644 --- a/examples/platform/bouffalolab/common/plat/demo_pwm.h +++ b/examples/platform/bouffalolab/common/plat/demo_pwm.h @@ -1,17 +1,12 @@ #ifndef __DEMO_PWM__ #define __DEMO_PWM__ -#include -#include -#include - #ifdef __cplusplus extern "C" { #endif -void demo_hosal_pwm_init(void); -void demo_hosal_pwm_start(void); -void demo_hosal_pwm_change_param(hosal_pwm_config_t * para); +void demo_pwm_init(void); +void demo_pwm_start(void); void set_color_red(uint8_t currLevel); void set_color_green(uint8_t currLevel); void set_color_yellow(uint8_t currLevel); diff --git a/examples/platform/bouffalolab/common/plat/main.cpp b/examples/platform/bouffalolab/common/plat/main.cpp index bf04405bf78523..65e8efce1cc377 100644 --- a/examples/platform/bouffalolab/common/plat/main.cpp +++ b/examples/platform/bouffalolab/common/plat/main.cpp @@ -16,71 +16,16 @@ * limitations under the License. */ -#include -#include - -#include -#include -#include - -#include - #include + #include #include -extern "C" { - -#include - -#ifdef BL702_ENABLE -#include -#include -#elif BL702L_ENABLE -#include -#include -#elif defined(BL602_ENABLE) -#include -#endif -#include -#if defined(BL702L_ENABLE) -#include -#endif -#include -#include -#ifdef CFG_USE_PSRAM -#include -#endif -#include -#include -#include - -#include - -#ifdef BL702L_ENABLE -#include -#include -#include -#endif - -#include "board.h" -#include -} - using namespace ::chip; using namespace ::chip::Inet; using namespace ::chip::DeviceLayer; -#define UNUSED_PARAMETER(a) (a = a) - -HOSAL_UART_DEV_DECL(uart_stdio, CHIP_UART_PORT, CHIP_UART_PIN_TX, CHIP_UART_PIN_RX, CHIP_UART_BAUDRATE); - volatile int apperror_cnt; - -#ifdef SYS_AOS_LOOP_ENABLE -extern "C" void aos_loop_start(void); -#endif - // ================================================================================ // App Error //================================================================================= @@ -97,350 +42,17 @@ void appError(CHIP_ERROR error) appError(static_cast(error.AsInteger())); } -// ================================================================================ -// FreeRTOS Callbacks -// ================================================================================ -extern "C" unsigned int sleep(unsigned int seconds) -{ - const TickType_t xDelay = 1000 * seconds / portTICK_PERIOD_MS; - vTaskDelay(xDelay); - return 0; -} - -#ifndef BL702L_ENABLE - -extern "C" void vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) -{ - ChipLogProgress(NotSpecified, "Stack Overflow checked. Stack name %s", pcTaskName); - while (true) - { - /*empty here*/ - } -} - -extern "C" void vApplicationMallocFailedHook(void) -{ - ChipLogProgress(NotSpecified, "Memory Allocate Failed. Current left size is %d bytes", xPortGetFreeHeapSize()); - while (true) - { - /*empty here*/ - } -} - -extern "C" void vApplicationIdleHook(void) +extern "C" int START_ENTRY(void) { - // bl_wdt_feed(); - __asm volatile(" wfi "); -} - -extern "C" void vApplicationGetIdleTaskMemory(StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, - uint32_t * pulIdleTaskStackSize) -{ - /* If the buffers to be provided to the Idle task are declared inside this - function then they must be declared static - otherwise they will be allocated on - the stack and so not exists after this function exits. */ - - /* Pass out a pointer to the StaticTask_t structure in which the Idle task's - state will be stored. */ - *ppxIdleTaskTCBBuffer = (StaticTask_t *) pvPortMalloc(sizeof(StaticTask_t)); - - /* Pass out the array that will be used as the Idle task's stack. */ - *ppxIdleTaskStackBuffer = (StackType_t *) pvPortMalloc(sizeof(StackType_t) * configMINIMAL_STACK_SIZE); - - /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer. - Note that, as the array is necessarily of type StackType_t, - configMINIMAL_STACK_SIZE is specified in words, not bytes. */ - *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE; -} - -/* configSUPPORT_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the -application must provide an implementation of vApplicationGetTimerTaskMemory() -to provide the memory that is used by the Timer service task. */ -extern "C" void vApplicationGetTimerTaskMemory(StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, - uint32_t * pulTimerTaskStackSize) -{ - /* If the buffers to be provided to the Timer task are declared inside this - function then they must be declared static - otherwise they will be allocated on - the stack and so not exists after this function exits. */ - - /* Pass out a pointer to the StaticTask_t structure in which the Timer - task's state will be stored. */ - *ppxTimerTaskTCBBuffer = (StaticTask_t *) pvPortMalloc(sizeof(StaticTask_t)); - - /* Pass out the array that will be used as the Timer task's stack. */ - *ppxTimerTaskStackBuffer = (StackType_t *) pvPortMalloc(sizeof(StackType_t) * configTIMER_TASK_STACK_DEPTH); - - /* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer. - Note that, as the array is necessarily of type StackType_t, - configTIMER_TASK_STACK_DEPTH is specified in words, not bytes. */ - *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH; -} - -#if (configUSE_TICK_HOOK != 0) -extern "C" void vApplicationTickHook(void) -{ -#if defined(CFG_USB_CDC_ENABLE) - extern void usb_cdc_monitor(void); - usb_cdc_monitor(); -#endif -} -#endif - -void vApplicationSleep(TickType_t xExpectedIdleTime) {} - -extern "C" void vAssertCalled(void) -{ - void * ra = (void *) __builtin_return_address(0); + platform_port_init(); - taskDISABLE_INTERRUPTS(); - if (xPortIsInsideInterrupt()) - { - printf("vAssertCalled, ra = %p in ISR\r\n", (void *) ra); - } - else - { - printf("vAssertCalled, ra = %p in task %s\r\n", (void *) ra, pcTaskGetName(NULL)); - } - - while (true) - ; -} -#endif - -#ifdef BL702L_ENABLE -extern "C" void __attribute__((weak)) user_vAssertCalled(void) -{ - void * ra = (void *) __builtin_return_address(0); - - taskDISABLE_INTERRUPTS(); - if (xPortIsInsideInterrupt()) - { - printf("vAssertCalled, ra = %p in ISR\r\n", (void *) ra); - } - else - { - printf("vAssertCalled, ra = %p in task %s\r\n", (void *) ra, pcTaskGetName(NULL)); - } - - while (true) - ; -} - -extern "C" void __attribute__((weak)) user_vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) -{ - puts("Stack Overflow checked\r\n"); - if (pcTaskName) - { - printf("Stack name %s\r\n", pcTaskName); - } - while (1) - { - /*empty here*/ - } -} - -extern "C" void __attribute__((weak)) user_vApplicationMallocFailedHook(void) -{ - printf("Memory Allocate Failed. Current left size is %d bytes\r\n", xPortGetFreeHeapSize()); -#if defined(CFG_USE_PSRAM) - printf("Current psram left size is %d bytes\r\n", xPortGetFreeHeapSizePsram()); -#endif - while (1) - { - /*empty here*/ - } -} - -#else -extern "C" void user_vAssertCalled(void) __attribute__((weak, alias("vAssertCalled"))); -#endif - -// ================================================================================ -// Main Code -// ================================================================================ -extern "C" uint8_t _heap_start; -extern "C" size_t _heap_size; // @suppress("Type cannot be resolved") - -#ifdef BL602_ENABLE -extern uint8_t _heap_wifi_start; -extern uint8_t _heap_wifi_size; // @suppress("Type cannot be resolved") -static HeapRegion_t xHeapRegions[] = { - { &_heap_start, (unsigned int) &_heap_size }, // set on runtime - { &_heap_wifi_start, (unsigned int) &_heap_wifi_size }, - { NULL, 0 } /* Terminates the array. */ -}; -#elif defined(BL702_ENABLE) -static constexpr HeapRegion_t xHeapRegions[] = { - { &_heap_start, (size_t) &_heap_size }, // set on runtime - { NULL, 0 } /* Terminates the array. */ -}; -#elif defined(BL702L_ENABLE) -static constexpr HeapRegion_t xHeapRegions[] = { - { &_heap_start, (size_t) &_heap_size }, // set on runtime - { NULL, 0 } /* Terminates the array. */ -}; -#endif - -#ifdef CFG_USE_PSRAM - -extern "C" uint32_t __psram_bss_init_start; -extern "C" uint32_t __psram_bss_init_end; - -static uint32_t __attribute__((section(".rsvd_data"))) psram_reset_count; - -extern "C" uint8_t _heap3_start; -extern "C" size_t _heap3_size; // @suppress("Type cannot be resolved") -static constexpr HeapRegion_t xPsramHeapRegions[] = { - { &_heap3_start, (size_t) &_heap3_size }, { NULL, 0 } /* Terminates the array. */ -}; - -extern "C" size_t get_heap3_size(void) -{ - return (size_t) &_heap3_size; -} - -extern "C" void do_psram_test() -{ - static constexpr char teststr[] = "bouffalolab psram test string"; - - do - { - uint8_t * pheap = &_heap3_start; - size_t size = (size_t) &_heap3_size; - - size = size > sizeof(teststr) ? sizeof(teststr) : size; - memset(pheap, 0, size); - if (pheap[0] != 0) - { - break; - } - - memcpy(pheap, teststr, size); - if (0 != memcmp(pheap, teststr, size)) - { - break; - } - - arch_memset4(&__psram_bss_init_start, 0, &__psram_bss_init_end - &__psram_bss_init_start); - - psram_reset_count = 0xffffff00; - return; - } while (0); - - if ((psram_reset_count & 0xffffff00) != 0xffffff00) - { - psram_reset_count = 0xffffff00; - } - - if ((psram_reset_count & 0x000000ff) > 3) - { - ChipLogError(NotSpecified, "PSRAM is still failed to initialize after %ld system reset", psram_reset_count & 0x000000ff); - vAssertCalled(); - } - - psram_reset_count = ((psram_reset_count & 0x000000ff) + 1) | 0xffffff00; - bl_sys_reset_system(); -} -#endif - -extern "C" void setup_heap() -{ - bl_sys_init(); - -#ifdef BL702_ENABLE - bl_sys_em_config(); -#elif defined(BL702L_ENABLE) - bl_sys_em_config(); - - // Initialize rom data - extern uint8_t _rom_data_run; - extern uint8_t _rom_data_load; - extern uint8_t _rom_data_size; - memcpy((void *) &_rom_data_run, (void *) &_rom_data_load, (size_t) &_rom_data_size); -#endif - - vPortDefineHeapRegions(xHeapRegions); - -#ifdef CFG_USE_PSRAM - bl_psram_init(); - do_psram_test(); - vPortDefineHeapRegionsPsram(xPsramHeapRegions); -#endif -} - -extern "C" size_t get_heap_size(void) -{ - return (size_t) &_heap_size; -} - -extern "C" void app_init(void) -{ - bl_sys_early_init(); - -#ifdef BL702L_ENABLE - rom_freertos_init(256, 400); - rom_hal_init(); - rom_lmac154_hook_init(); -#endif - - hosal_uart_init(&uart_stdio); + easyflash_init(); + ef_load_env_cache(); ChipLogProgress(NotSpecified, "=================================================="); ChipLogProgress(NotSpecified, "bouffalolab chip-lighting-example, built at " __DATE__ " " __TIME__); ChipLogProgress(NotSpecified, "=================================================="); -#ifdef CFG_USE_PSRAM - ChipLogProgress(NotSpecified, "Heap %u@[%p:%p], %u@[%p:%p]", (unsigned int) &_heap_size, &_heap_start, - &_heap_start + (unsigned int) &_heap_size, (unsigned int) &_heap3_size, &_heap3_start, - &_heap3_start + (unsigned int) &_heap3_size); -#else - ChipLogProgress(NotSpecified, "Heap %u@[%p:%p]", (unsigned int) &_heap_size, &_heap_start, - &_heap_start + (unsigned int) &_heap_size); -#endif - - blog_init(); - bl_irq_init(); -#if defined(BL702L_ENABLE) - bl_rtc_init(); -#endif - bl_sec_init(); -#if defined(BL702_ENABLE) - bl_timer_init(); -#endif - - hal_boot2_init(); - - /* board config is set after system is init*/ - hal_board_cfg(0); - -#if defined(BL702L_ENABLE) || defined(BL706_WIFI) - hosal_dma_init(); -#endif -#ifdef BL602_ENABLE - wifi_td_diagnosis_init(); -#endif -} - -extern "C" void START_ENTRY(void) -{ - app_init(); - -#if CONFIG_ENABLE_CHIP_SHELL || PW_RPC_ENABLED - uartInit(); -#endif -#ifdef SYS_AOS_LOOP_ENABLE - ChipLogProgress(NotSpecified, "Starting AOS loop Task"); - aos_loop_start(); -#else -#if defined(CFG_USB_CDC_ENABLE) - extern void usb_cdc_start(int fd_console); - usb_cdc_start(-1); -#endif -#endif - - easyflash_init(); - ef_load_env_cache(); - ChipLogProgress(NotSpecified, "Init CHIP Memory"); chip::Platform::MemoryInit(NULL, 0); @@ -453,4 +65,6 @@ extern "C" void START_ENTRY(void) // Should never get here. ChipLogError(NotSpecified, "Starting OS Scheduler failed"); appError(0); + + return 0; } diff --git a/examples/platform/bouffalolab/common/plat/plat.h b/examples/platform/bouffalolab/common/plat/plat.h index 8235304f42c551..ba85f03e88105f 100644 --- a/examples/platform/bouffalolab/common/plat/plat.h +++ b/examples/platform/bouffalolab/common/plat/plat.h @@ -24,8 +24,14 @@ #define EXT_DISCOVERY_TIMEOUT_SECS 20 #ifdef __cplusplus + #include void appError(CHIP_ERROR error); + +extern "C" void platform_port_init(void); #else + void appError(int err); +void platform_port_init(void); + #endif diff --git a/examples/platform/bouffalolab/common/plat/platform.cpp b/examples/platform/bouffalolab/common/plat/platform.cpp index b0d73daa3a2bbc..97e3a07621b093 100644 --- a/examples/platform/bouffalolab/common/plat/platform.cpp +++ b/examples/platform/bouffalolab/common/plat/platform.cpp @@ -51,25 +51,25 @@ #include #endif -#if CHIP_ENABLE_OPENTHREAD +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD #include #include #include #include #endif -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET || CHIP_DEVICE_CONFIG_ENABLE_WIFI +#include #include -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI -#if defined(BL602_ENABLE) +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI && BL602_ENABLE #include -#else -#include #endif -#else +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI && BL702_ENABLE +#include +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET #include #endif -#include #endif #include @@ -87,14 +87,14 @@ chip::app::Clusters::NetworkCommissioning::Instance } #endif -static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; - #if CONFIG_BOUFFALOLAB_FACTORY_DATA_ENABLE || defined(CONFIG_BOUFFALOLAB_FACTORY_DATA_TEST) namespace { FactoryDataProvider sFactoryDataProvider; } #endif +static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; + void ChipEventHandler(const ChipDeviceEvent * event, intptr_t arg) { switch (event->Type) @@ -111,7 +111,9 @@ void ChipEventHandler(const ChipDeviceEvent * event, intptr_t arg) OTAConfig::InitOTARequestorHandler, nullptr); } break; -#else +#endif + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET case DeviceEventType::kInterfaceIpAddressChanged: if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) || (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned)) @@ -128,7 +130,6 @@ void ChipEventHandler(const ChipDeviceEvent * event, intptr_t arg) chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(OTAConfig::kInitOTARequestorDelaySec), OTAConfig::InitOTARequestorHandler, nullptr); } - break; #endif case DeviceEventType::kInternetConnectivityChange: @@ -166,6 +167,8 @@ void ChipEventHandler(const ChipDeviceEvent * event, intptr_t arg) CHIP_ERROR PlatformManagerImpl::PlatformInit(void) { + chip::RendezvousInformationFlags rendezvousMode(chip::RendezvousInformationFlag::kOnNetwork); + #if PW_RPC_ENABLED PigweedLogger::pw_init(); #elif CONFIG_ENABLE_CHIP_SHELL @@ -181,7 +184,7 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void) chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(CHIP_BLE_DEVICE_NAME); -#if CHIP_ENABLE_OPENTHREAD +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD #if CONFIG_ENABLE_CHIP_SHELL cmd_otcli_init(); @@ -196,7 +199,9 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void) ReturnLogErrorOnFailure(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice)); #endif -#elif CHIP_DEVICE_CONFIG_ENABLE_WIFI +#endif + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI ReturnLogErrorOnFailure(sWiFiNetworkCommissioningInstance.Init()); #endif @@ -233,7 +238,7 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void) chip::DeviceLayer::PlatformMgr().UnlockChipStack(); -#if CHIP_ENABLE_OPENTHREAD +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD ChipLogProgress(NotSpecified, "Starting OpenThread task"); // Start OpenThread task ReturnLogErrorOnFailure(ThreadStackMgrImpl().StartThreadTask()); @@ -242,10 +247,9 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void) ConfigurationMgr().LogDeviceConfig(); #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE)); -#else - PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kOnNetwork)); + rendezvousMode.Set(chip::RendezvousInformationFlag::kBLE); #endif + PrintOnboardingCodes(rendezvousMode); PlatformMgr().AddEventHandler(ChipEventHandler, 0); diff --git a/examples/platform/bouffalolab/common/route_hook/bl_route_hook.c b/examples/platform/bouffalolab/common/route_hook/bl_route_hook.c index 93cc731b99857d..68c51bd327e3a2 100644 --- a/examples/platform/bouffalolab/common/route_hook/bl_route_hook.c +++ b/examples/platform/bouffalolab/common/route_hook/bl_route_hook.c @@ -1,8 +1,6 @@ #include #include -#include "utils_log.h" - #include "lwip/icmp6.h" #include "lwip/mld6.h" #include "lwip/netif.h" @@ -81,7 +79,7 @@ static void ra_recv_handler(struct netif * netif, const uint8_t * icmp_payload, const uint8_t * rio_data = &icmp_payload[sizeof(rio_header_t)]; uint8_t rio_data_len = opt_len - sizeof(rio_header_t); - log_info("Received RIO\r\n"); + printf("Received RIO\r\n"); if (rio_data_len >= prefix_len_bytes) { ip6_addr_t prefix; @@ -95,14 +93,14 @@ static void ra_recv_handler(struct netif * netif, const uint8_t * icmp_payload, route.prefix = prefix; route.preference = preference; route.lifetime_seconds = lwip_ntohl(rio_header.route_lifetime); - log_info("prefix %s lifetime %u\r\n", ip6addr_ntoa(&prefix), route.lifetime_seconds); + printf("prefix %s lifetime %lu\r\n", ip6addr_ntoa(&prefix), route.lifetime_seconds); if (bl_route_table_add_route_entry(&route) == NULL) { - log_error("Failed to add route table entry\r\n"); + printf("Failed to add route table entry\r\n"); } else { - log_info("Added entry to route table\r\n"); + printf("Added entry to route table\r\n"); } } } @@ -129,12 +127,12 @@ static uint8_t icmp6_raw_recv_handler(void * arg, struct raw_pcb * pcb, struct p if (p->tot_len != p->len) { - log_error("Ignore segmented ICMP packet\r\n"); + printf("Ignore segmented ICMP packet\r\n"); return 0; } if (p->tot_len <= sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr)) { - log_error("Ignore invalid ICMP packet\r\n"); + printf("Ignore invalid ICMP packet\r\n"); return 0; } if (!ip6_addr_islinklocal(&dest) && !ip6_addr_isallnodes_linklocal(&dest) && !ip6_addr_isallrouters_linklocal(&dest)) @@ -162,7 +160,7 @@ int8_t bl_route_hook_init(void) if (lwip_netif == NULL) { - log_error("Invalid network interface\r\n"); + printf("Invalid network interface\r\n"); return -1; } @@ -177,13 +175,13 @@ int8_t bl_route_hook_init(void) hook = (bl_route_hook_t *) malloc(sizeof(bl_route_hook_t)); if (hook == NULL) { - log_error("Cannot allocate hook\r\n"); + printf("Cannot allocate hook\r\n"); return -1; } if (mld6_joingroup_netif(lwip_netif, ip_2_ip6(&router_group)) != ERR_OK) { - log_error("Failed to join multicast group\r\n"); + printf("Failed to join multicast group\r\n"); ret = -1; goto exit; } diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index dc66ec8eda7eb1..ba048759705c7f 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -35,7 +35,7 @@ steps: --target android-arm64-tv-server --target android-x64-chip-tool --target bouffalolab-bl602-iot-matter-v1-light - --target bouffalolab-bl704l-dvk-light + --target bouffalolab-bl704ldk-light --target bouffalolab-xt-zb6-devkit-light-rpc --target cc13x2x7_26x2x7-lighting --target cc13x2x7_26x2x7-lock-mtd diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 0414a7e820fce7..850b40e44b1de1 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -15,7 +15,7 @@ from builders.ameba import AmebaApp, AmebaBoard, AmebaBuilder from builders.android import AndroidApp, AndroidBoard, AndroidBuilder, AndroidProfile from builders.asr import ASRApp, ASRBoard, ASRBuilder -from builders.bouffalolab import BouffalolabApp, BouffalolabBoard, BouffalolabBuilder +from builders.bouffalolab import BouffalolabApp, BouffalolabBoard, BouffalolabBuilder, BouffalolabMfd from builders.cc32xx import cc32xxApp, cc32xxBuilder from builders.cyw30739 import Cyw30739App, Cyw30739Board, Cyw30739Builder from builders.efr32 import Efr32App, Efr32Board, Efr32Builder @@ -619,11 +619,9 @@ def BuildBouffalolabTarget(): module_type="BL706C-22"), TargetPart('BL706-NIGHT-LIGHT', board=BouffalolabBoard.BL706_NIGHT_LIGHT, module_type="BL706C-22"), - TargetPart('BL706-ETH', - board=BouffalolabBoard.BL706_ETH, module_type="BL706C-22"), - TargetPart('BL706-WIFI', - board=BouffalolabBoard.BL706_WIFI, module_type="BL706C-22"), - TargetPart('BL704L-DVK', board=BouffalolabBoard.BL704L_DVK, module_type="BL704L"), + TargetPart('BL706DK', + board=BouffalolabBoard.BL706DK, module_type="BL706C-22"), + TargetPart('BL704LDK', board=BouffalolabBoard.BL704LDK, module_type="BL704L"), ]) # Apps @@ -637,6 +635,12 @@ def BuildBouffalolabTarget(): target.AppendModifier('cdc', enable_cdc=True) target.AppendModifier('resetCnt', enable_resetCnt=True) target.AppendModifier('rotating_device_id', enable_rotating_device_id=True) + target.AppendModifier('mfd', function_mfd=BouffalolabMfd.MFD_RELEASE) + target.AppendModifier('mfdtest', function_mfd=BouffalolabMfd.MFD_TEST) + target.AppendModifier('ethernet', enable_ethernet=True) + target.AppendModifier('wifi', enable_wifi=True) + target.AppendModifier('thread', enable_thread=True) + target.AppendModifier('fp', enable_frame_ptr=True) return target diff --git a/scripts/build/builders/bouffalolab.py b/scripts/build/builders/bouffalolab.py index d91f5d5633f318..3fbf034844e223 100644 --- a/scripts/build/builders/bouffalolab.py +++ b/scripts/build/builders/bouffalolab.py @@ -46,9 +46,8 @@ class BouffalolabBoard(Enum): BL602_NIGHT_LIGHT = auto() XT_ZB6_DevKit = auto() BL706_NIGHT_LIGHT = auto() - BL706_ETH = auto() - BL706_WIFI = auto() - BL704L_DVK = auto() + BL706DK = auto() + BL704LDK = auto() def GnArgName(self): if self == BouffalolabBoard.BL602_IoT_Matter_V1: @@ -59,16 +58,20 @@ def GnArgName(self): return 'XT-ZB6-DevKit' elif self == BouffalolabBoard.BL706_NIGHT_LIGHT: return 'BL706-NIGHT-LIGHT' - elif self == BouffalolabBoard.BL706_ETH: - return 'BL706-ETH' - elif self == BouffalolabBoard.BL706_WIFI: - return 'BL706-WIFI' - elif self == BouffalolabBoard.BL704L_DVK: - return 'BL704L-DVK' + elif self == BouffalolabBoard.BL706DK: + return 'BL706DK' + elif self == BouffalolabBoard.BL704LDK: + return 'BL704LDK' else: raise Exception('Unknown board #: %r' % self) +class BouffalolabMfd(Enum): + MFD_DISABLE = auto() + MFD_TEST = auto() + MFD_RELEASE = auto() + + class BouffalolabBuilder(GnBuilder): def __init__(self, @@ -82,7 +85,12 @@ def __init__(self, enable_shell: bool = False, enable_cdc: bool = False, enable_resetCnt: bool = False, - enable_rotating_device_id: bool = False + enable_rotating_device_id: bool = False, + function_mfd: BouffalolabMfd = BouffalolabMfd.MFD_DISABLE, + enable_ethernet: bool = False, + enable_wifi: bool = False, + enable_thread: bool = False, + enable_frame_ptr: bool = False ): if 'BL602' == module_type: @@ -102,7 +110,9 @@ def __init__(self, self.argsOpt = [] self.chip_name = bouffalo_chip + self.enable_frame_ptr = enable_frame_ptr + openthread_project_core_config_file = None toolchain = os.path.join(root, os.path.split(os.path.realpath(__file__))[0], '../../../config/bouffalolab/toolchain') toolchain = 'custom_toolchain="{}:riscv_gcc"'.format(toolchain) if toolchain: @@ -115,29 +125,69 @@ def __init__(self, self.argsOpt.append('baudrate=\"{}\"'.format(baudrate)) if bouffalo_chip == "bl602": - self.argsOpt.append('chip_enable_openthread=false') - self.argsOpt.append('chip_enable_wifi=true') - if bouffalo_chip == "bl702": + + enable_wifi = True + if enable_ethernet or enable_thread: + raise Exception('SoC %s doesn\'t support connectivity Ethernet/Thread.' % bouffalo_chip) + + elif bouffalo_chip == "bl702": + self.argsOpt.append('module_type=\"{}\"'.format(module_type)) - if board == BouffalolabBoard.BL706_ETH: - self.argsOpt.append('chip_config_network_layer_ble=false') - self.argsOpt.append('chip_enable_openthread=false') - self.argsOpt.append('chip_enable_wifi=false') - elif board == BouffalolabBoard.BL706_WIFI: - self.argsOpt.append('chip_enable_openthread=false') - self.argsOpt.append('chip_enable_wifi=true') - else: - self.argsOpt.append('chip_enable_openthread=true') - self.argsOpt.append('chip_enable_wifi=false') + if board != BouffalolabBoard.BL706DK: + if enable_ethernet or enable_wifi: + raise Exception('Board %s doesn\'t support connectivity Ethernet/Wi-Fi.' % board) + + if not enable_wifi and not enable_ethernet: + enable_thread = True + openthread_project_core_config_file = "bl702-openthread-core-bl-config.h" + elif bouffalo_chip == "bl702l": - self.argsOpt.append('chip_enable_openthread=true') + + if enable_ethernet or enable_wifi: + raise Exception('SoC %s doesn\'t support connectivity Ethernet/Wi-Fi currently.' % bouffalo_chip) + + enable_thread = True + openthread_project_core_config_file = "bl702l-openthread-core-bl-config.h" + + if enable_wifi or enable_thread: + self.argsOpt.append('chip_config_network_layer_ble=true') + else: + # for enable_ethernet, do not need ble for commissioning + self.argsOpt.append('chip_config_network_layer_ble=false') + + if enable_ethernet: + self.argsOpt.append('chip_enable_ethernet=true') + else: + self.argsOpt.append('chip_enable_ethernet=false') + + if enable_wifi: + self.argsOpt.append('chip_enable_wifi=true') + else: self.argsOpt.append('chip_enable_wifi=false') + if enable_thread: + self.argsOpt.append('chip_enable_openthread=true') + else: + self.argsOpt.append('chip_enable_openthread=false') + + if enable_thread: + self.argsOpt.append('openthread_project_core_config_file="{}"'.format(openthread_project_core_config_file)) + + if enable_thread: + self.argsOpt.append('chip_mdns="platform"') + elif enable_wifi or enable_ethernet: + self.argsOpt.append('chip_mdns="minimal"') + + if enable_ethernet or enable_wifi: + self.argsOpt.append('chip_inet_config_enable_ipv4=true') + else: + self.argsOpt.append('chip_inet_config_enable_ipv4=false') + if enable_cdc: if bouffalo_chip != "bl702": raise Exception('Chip %s does NOT support USB CDC' % bouffalo_chip) - if board == BouffalolabBoard.BL706_ETH: - raise Exception('Board %s does NOT support USB CDC' % self.board.GnArgName()) + if enable_ethernet: + raise Exception('BL706 Ethernet does NOT support USB CDC') self.argsOpt.append('enable_cdc_module=true') @@ -153,20 +203,41 @@ def __init__(self, self.argsOpt.append('chip_enable_additional_data_advertising=true') self.argsOpt.append('chip_enable_rotating_device_id=true') + if BouffalolabMfd.MFD_DISABLE != function_mfd: + if bouffalo_chip != "bl602": + raise Exception('Only BL602 support matter factory data feature currently.') + + if BouffalolabMfd.MFD_RELEASE == function_mfd: + self.argsOpt.append("chip_enable_factory_data=true") + elif BouffalolabMfd.MFD_TEST == function_mfd: + self.argsOpt.append("chip_enable_factory_data_test=true") + + if enable_frame_ptr: + self.argsOpt.append("enable_debug_frame_ptr=true") + else: + self.argsOpt.append("enable_debug_frame_ptr=false") + try: self.argsOpt.append('bouffalolab_sdk_root="%s"' % os.environ['BOUFFALOLAB_SDK_ROOT']) except KeyError as err: - logging.fatal('Please make sure Bouffalo Lab SDK installs as below:') - logging.fatal('\tcd third_party/bouffalolab/repo') - logging.fatal('\tsudo bash scripts/setup.sh') + self.print_enviroment_error() + raise err - logging.fatal('Please make sure BOUFFALOLAB_SDK_ROOT exports before building as below:') - logging.fatal('\texport BOUFFALOLAB_SDK_ROOT=/opt/bouffalolab_sdk') + def print_enviroment_error(self): + logging.fatal('*' * 80) + logging.fatal('\tPlease make sure Bouffalo Lab SDK installs as below:') + logging.fatal('\t\tcd third_party/bouffalolab/repo') + logging.fatal('\t\tsudo bash scripts/setup.sh') - raise err + logging.fatal('\tPlease make sure BOUFFALOLAB_SDK_ROOT exports before building as below:') + logging.fatal('\t\texport BOUFFALOLAB_SDK_ROOT=/opt/bouffalolab_sdk') + logging.fatal('*' * 80) def GnBuildArgs(self): - return self.argsOpt + if self.enable_frame_ptr: + return self.argsOpt + ["debug_output_file=\"{}\"".format(os.path.join(self.output_dir, '%s.out' % self.app.AppNamePrefix(self.chip_name)))] + else: + return self.argsOpt def build_outputs(self): items = { @@ -183,7 +254,6 @@ def build_outputs(self): def PostBuildCommand(self): # Generate Bouffalo Lab format OTA image for development purpose. - ota_images_folder_path = self.output_dir + "/ota_images" ota_images_dev_image = self.output_dir + "/" + self.app.AppNamePrefix(self.chip_name) + ".bin.xz.hash" ota_images_image = self.output_dir + "/ota_images/FW_OTA.bin.xz.hash" diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 7e945289bcb21c..c4beae7f7c0f16 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -1,7 +1,7 @@ ameba-amebad-{all-clusters,all-clusters-minimal,light,light-switch,pigweed} asr-{asr582x,asr595x,asr550x}-{all-clusters,all-clusters-minimal,lighting,light-switch,lock,bridge,temperature-measurement,thermostat,ota-requestor,dishwasher,refrigerator}[-ota][-shell][-no_logging][-factory][-rotating_id][-rio] android-{arm,arm64,x86,x64,androidstudio-arm,androidstudio-arm64,androidstudio-x86,androidstudio-x64}-{chip-tool,chip-test,tv-server,tv-casting-app,java-matter-controller,virtual-device-app}[-no-debug] -bouffalolab-{bl602-iot-matter-v1,bl602-night-light,xt-zb6-devkit,bl706-night-light,bl706-eth,bl706-wifi,bl704l-dvk}-light[-shell][-115200][-rpc][-cdc][-resetcnt][-rotating_device_id] +bouffalolab-{bl602-iot-matter-v1,bl602-night-light,xt-zb6-devkit,bl706-night-light,bl706dk,bl704ldk}-light[-shell][-115200][-rpc][-cdc][-resetcnt][-rotating_device_id][-mfd][-mfdtest][-ethernet][-wifi][-thread][-fp] cc32xx-lock ti-cc13x2x7_26x2x7-{lighting,lock,pump,pump-controller}[-mtd] ti-cc13x4_26x4-{all-clusters,lighting,lock,pump,pump-controller}[-mtd][-ftd] diff --git a/src/lib/shell/streamer_bouffalolab.cpp b/src/lib/shell/streamer_bouffalolab.cpp index d7db7611f39d4a..ae22227dc4dd90 100644 --- a/src/lib/shell/streamer_bouffalolab.cpp +++ b/src/lib/shell/streamer_bouffalolab.cpp @@ -17,7 +17,7 @@ /** * @file - * Source implementation of an input / output stream for bl702 targets. + * Source implementation of an input / output stream for Bouffalo Lab targets. */ #include @@ -31,35 +31,34 @@ namespace chip { namespace Shell { namespace { -int streamer_bl702_init(streamer_t * streamer) +int streamer_iot_sdk_init(streamer_t * streamer) { (void) streamer; - // uartInit(); return 0; } -ssize_t streamer_bl702_read(streamer_t * streamer, char * buffer, size_t length) +ssize_t streamer_iot_sdk_read(streamer_t * streamer, char * buffer, size_t length) { (void) streamer; return (ssize_t) uartRead(buffer, (uint16_t) length); } -ssize_t streamer_bl702_write(streamer_t * streamer, const char * buffer, size_t length) +ssize_t streamer_iot_sdk_write(streamer_t * streamer, const char * buffer, size_t length) { (void) streamer; return uartWrite(buffer, (uint16_t) length); } -static streamer_t streamer_bl702 = { - .init_cb = streamer_bl702_init, - .read_cb = streamer_bl702_read, - .write_cb = streamer_bl702_write, +static streamer_t streamer_iot_sdk = { + .init_cb = streamer_iot_sdk_init, + .read_cb = streamer_iot_sdk_read, + .write_cb = streamer_iot_sdk_write, }; -} // namespace +} // namespace streamer_t * streamer_get(void) { - return &streamer_bl702; + return &streamer_iot_sdk; } } // namespace Shell diff --git a/src/lwip/BUILD.gn b/src/lwip/BUILD.gn index 24462da32a920c..3547ac1157568d 100644 --- a/src/lwip/BUILD.gn +++ b/src/lwip/BUILD.gn @@ -145,8 +145,6 @@ if (current_os == "zephyr" || current_os == "mbed") { } } else if (lwip_platform == "bl702" && defined(chip_enable_openthread) && chip_enable_openthread == false) { - # bl702 platform will use ethernet or SPI Wi-Fi for connectivity, if openthread is not enabled - import("${bouffalolab_iot_sdk_build_root}/bl702/bl_iot_sdk.gni") group("lwip") { public_deps = [ ":lwip_buildconfig" ] public_deps += [ "${bouffalolab_iot_sdk_build_root}/bl702:bl_iot_sdk" ] diff --git a/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp b/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp index 8cd34b5bf67d83..59f1cf4ba52351 100644 --- a/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp +++ b/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp @@ -17,9 +17,10 @@ #include #include -#include #include +#include + extern "C" { #include @@ -63,7 +64,12 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetBootReason(BootReasonType & bootReason CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(MutableByteSpan & BssId) { - return CopySpanToMutableSpan(ByteSpan(wifiMgmr.wifi_mgmr_stat_info.bssid), BssId); + if (ConnectivityMgrImpl()._IsWiFiStationConnected()) + { + return CopySpanToMutableSpan(ByteSpan(wifiMgmr.wifi_mgmr_stat_info.bssid), BssId); + } + + return CHIP_ERROR_READ_FAILED; } CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp index b051a44a44a0d5..4ed9c9359b1f92 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp @@ -1,6 +1,6 @@ /* - * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include #include #include @@ -24,8 +22,6 @@ #include #include -#define WIFI_STA_DISCONNECT_DELAY (pdMS_TO_TICKS(200)) - using namespace ::chip; using namespace ::chip::DeviceLayer::Internal; @@ -33,11 +29,6 @@ namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { -namespace { -static char WiFiSSIDStr[DeviceLayer::Internal::kMaxWiFiSSIDLength]; -static uint8_t scan_type = 0; -} // namespace - CHIP_ERROR BLWiFiDriver::Init(NetworkStatusChangeCallback * networkStatusChangeCallback) { CHIP_ERROR err; @@ -141,24 +132,13 @@ CHIP_ERROR BLWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, { char wifi_ssid[64] = { 0 }; char passwd[64] = { 0 }; - int state = 0; + wifi_interface_t wifi_interface; ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting); - wifi_mgmr_sta_disconnect(); - vTaskDelay(WIFI_STA_DISCONNECT_DELAY); - - wifi_mgmr_sta_disable(NULL); - wifi_mgmr_state_get(&state); - while (state != WIFI_STATE_IDLE) - { - wifi_mgmr_state_get(&state); - vTaskDelay(100); - } - memcpy(wifi_ssid, ssid, ssidLen); memcpy(passwd, key, keyLen); - wifi_interface_t wifi_interface; + wifi_interface = wifi_mgmr_sta_enable(); // Valid Credentials length are: // - 0 bytes: Unsecured (open) connection @@ -234,27 +214,41 @@ void BLWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback } } -CHIP_ERROR BLWiFiDriver::StartScanWiFiNetworks(ByteSpan ssid) +void BLWiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) { - CHIP_ERROR err = CHIP_NO_ERROR; + int iret = 0; - if (!ssid.empty()) - { - memset(WiFiSSIDStr, 0, sizeof(WiFiSSIDStr)); - memcpy(WiFiSSIDStr, ssid.data(), ssid.size()); - err = (CHIP_ERROR) wifi_mgmr_scan_adv(NULL, NULL, NULL, 0, NULL, WiFiSSIDStr, 1, 0); - scan_type = 1; - } - else - { - err = (CHIP_ERROR) wifi_mgmr_scan(NULL, NULL); - scan_type = 0; - } - if (err != CHIP_NO_ERROR) + if (callback != nullptr) { - return CHIP_ERROR_INTERNAL; + if (!ssid.empty()) + { + if (ssid.size() < sizeof(mScanSSID)) + { + memset(mScanSSID, 0, sizeof(mScanSSID)); + memcpy(mScanSSID, ssid.data(), ssid.size()); + iret = wifi_mgmr_scan_adv(NULL, NULL, NULL, 0, NULL, mScanSSID, 1, 0); + mScanType = 1; + } + else + { + iret = -1; + } + } + else + { + iret = wifi_mgmr_scan(NULL, NULL); + mScanType = 0; + } + + if (0 == iret) + { + mpScanCallback = callback; + } + else + { + callback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); + } } - return CHIP_NO_ERROR; } void BLWiFiDriver::OnScanWiFiNetworkDone() @@ -274,7 +268,7 @@ void BLWiFiDriver::OnScanWiFiNetworkDone() } wifi_mgmr_ap_item_t * ScanResult = (wifi_mgmr_ap_item_t *) pvPortMalloc(ap_num * sizeof(wifi_mgmr_ap_item_t)); - wifi_mgmr_get_scan_result(ScanResult, &ap_num, scan_type, WiFiSSIDStr); + wifi_mgmr_get_scan_result(ScanResult, &ap_num, 0, mScanSSID); if (ScanResult) { @@ -306,19 +300,6 @@ void BLWiFiDriver::OnScanWiFiNetworkDone() } } -void BLWiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) -{ - if (callback != nullptr) - { - mpScanCallback = callback; - if (StartScanWiFiNetworks(ssid) != CHIP_NO_ERROR) - { - mpScanCallback = nullptr; - callback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); - } - } -} - CHIP_ERROR GetConfiguredNetwork(Network & network) { uint8_t ssid[64]; @@ -340,7 +321,7 @@ void BLWiFiDriver::OnNetworkStatusChange() { Network configuredNetwork; bool staConnected = false; - // VerifyOrReturn(ESP32Utils::IsStationEnabled(staEnabled) == CHIP_NO_ERROR); + VerifyOrReturn(mpStatusChangeCallback != nullptr); CHIP_ERROR err = GetConfiguredNetwork(configuredNetwork); if (err != CHIP_NO_ERROR) @@ -406,9 +387,107 @@ bool BLWiFiDriver::WiFiNetworkIterator::Next(Network & item) item.connected = true; } } + return true; } +void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg) +{ + if (!(DeviceEventType::IsPlatformSpecific(event->Type) && DeviceEventType::IsPublic(event->Type))) + { + return; + } + + switch (event->Type) + { + case kWiFiOnInitDone: + break; + case kWiFiOnScanDone: + BLWiFiDriver::GetInstance().OnScanWiFiNetworkDone(); + break; + case kWiFiOnConnected: + BLWiFiDriver::GetInstance().OnNetworkStatusChange(); + break; + case kGotIpAddress: + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManagerImpl::kWiFiStationState_Connected); + ConnectivityMgrImpl().OnConnectivityChanged(deviceInterface_getNetif()); + break; + case kGotIpv6Address: + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManagerImpl::kWiFiStationState_Connected); + ConnectivityMgrImpl().OnConnectivityChanged(deviceInterface_getNetif()); + break; + case kWiFiOnDisconnected: + if (ConnectivityManager::kWiFiStationState_Connecting == ConnectivityMgrImpl().GetWiFiStationState()) + { + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting_Failed); + } + break; + default: + ChipLogProgress(DeviceLayer, "Undefined network commission event type %x.\r\n", event->Type); + break; + } +} + +static wifi_conf_t conf = { + .country_code = "CN", +}; + +extern "C" void wifi_event_handler(uint32_t code) +{ + ChipDeviceEvent event; + + memset(&event, 0, sizeof(ChipDeviceEvent)); + + switch (code) + { + case CODE_WIFI_ON_INIT_DONE: + wifi_mgmr_start_background(&conf); + break; + case CODE_WIFI_ON_SCAN_DONE: + event.Type = kWiFiOnScanDone; + PlatformMgr().PostEventOrDie(&event); + break; + case CODE_WIFI_ON_CONNECTED: + event.Type = kWiFiOnConnected; + PlatformMgr().PostEventOrDie(&event); + break; + case CODE_WIFI_ON_GOT_IP: + event.Type = kGotIpAddress; + PlatformMgr().PostEventOrDie(&event); + break; + case CODE_WIFI_ON_DISCONNECT: + event.Type = kWiFiOnDisconnected; + PlatformMgr().PostEventOrDie(&event); + break; + default: + ChipLogProgress(DeviceLayer, "[APP] [EVT] Unknown code %lu \r\n", code); + } +} + +extern "C" void network_netif_ext_callback(struct netif * nif, netif_nsc_reason_t reason, const netif_ext_callback_args_t * args) +{ + ChipDeviceEvent event; + + memset(&event, 0, sizeof(ChipDeviceEvent)); + + if ((LWIP_NSC_IPV6_ADDR_STATE_CHANGED & reason) && args) + { + + if (args->ipv6_addr_state_changed.addr_index >= LWIP_IPV6_NUM_ADDRESSES || + ip6_addr_islinklocal(netif_ip6_addr(nif, args->ipv6_addr_state_changed.addr_index))) + { + return; + } + + if (netif_ip6_addr_state(nif, args->ipv6_addr_state_changed.addr_index) != args->ipv6_addr_state_changed.old_state && + ip6_addr_ispreferred(netif_ip6_addr_state(nif, args->ipv6_addr_state_changed.addr_index))) + { + event.Type = kGotIpv6Address; + PlatformMgr().PostEventOrDie(&event); + } + } +} + } // namespace NetworkCommissioning } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h index 83416a534988ac..5ae1c9a610ef73 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h @@ -1,6 +1,6 @@ /* - * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { +void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg); + namespace { constexpr uint8_t kMaxWiFiNetworks = 1; constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; @@ -132,7 +134,6 @@ class BLWiFiDriver final : public WiFiDriver private: bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); - CHIP_ERROR StartScanWiFiNetworks(ByteSpan ssid); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; @@ -140,6 +141,10 @@ class BLWiFiDriver final : public WiFiDriver ConnectCallback * mpConnectCallback; NetworkStatusChangeCallback * mpStatusChangeCallback = nullptr; int32_t mLastDisconnectedReason; + + /** +1 byte for string termination */ + char mScanSSID[DeviceLayer::Internal::kMaxWiFiSSIDLength + 1]; + uint32_t mScanType; }; } // namespace NetworkCommissioning diff --git a/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp b/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp index f16012851d78de..3c7b35941128c7 100644 --- a/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp +++ b/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp @@ -16,25 +16,20 @@ */ #include -#include - +#include #include #include +#include +#include #include #include - -#include -#include +#include namespace chip { namespace DeviceLayer { -static wifi_conf_t conf = { - .country_code = "CN", -}; - static int app_entropy_source(void * data, unsigned char * output, size_t len, size_t * olen) { bl_rand_stream(reinterpret_cast(output), static_cast(len)); @@ -43,69 +38,6 @@ static int app_entropy_source(void * data, unsigned char * output, size_t len, s return 0; } -typedef void (*aos_event_cb)(input_event_t * event, void * private_data); - -void OnWiFiPlatformEvent(input_event_t * event, void * private_data) -{ - switch (event->code) - { - case CODE_WIFI_ON_INIT_DONE: { - wifi_mgmr_start_background(&conf); - } - break; - case CODE_WIFI_ON_MGMR_DONE: { - } - break; - case CODE_WIFI_ON_CONNECTED: { - ChipLogProgress(DeviceLayer, "WiFi station connected."); - } - break; - case CODE_WIFI_ON_SCAN_DONE: { - chip::DeviceLayer::PlatformMgr().LockChipStack(); - NetworkCommissioning::BLWiFiDriver::GetInstance().OnScanWiFiNetworkDone(); - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - } - break; - case CODE_WIFI_ON_CONNECTING: { - ChipLogProgress(DeviceLayer, "WiFi station starts connecting."); - } - break; - case CODE_WIFI_ON_DISCONNECT: { - ChipLogProgress(DeviceLayer, "WiFi station disconnect, reason %s.", wifi_mgmr_status_code_str(event->value)); - chip::DeviceLayer::PlatformMgr().LockChipStack(); - if (ConnectivityManager::kWiFiStationState_Connecting == ConnectivityMgrImpl().GetWiFiStationState()) - { - ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting_Failed); - } - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - } - break; - case CODE_WIFI_CMD_RECONNECT: { - ChipLogProgress(DeviceLayer, "WiFi station reconnect."); - } - break; - case CODE_WIFI_ON_GOT_IP: { - ChipLogProgress(DeviceLayer, "WiFi station gets IPv4 address."); - chip::DeviceLayer::PlatformMgr().LockChipStack(); - ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManagerImpl::kWiFiStationState_Connected); - ConnectivityMgrImpl().OnConnectivityChanged(wifi_mgmr_sta_netif_get()); - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - } - break; - case CODE_WIFI_ON_GOT_IP6: { - ChipLogProgress(DeviceLayer, "WiFi station gets IPv6 address."); - chip::DeviceLayer::PlatformMgr().LockChipStack(); - ConnectivityMgrImpl().OnConnectivityChanged(wifi_mgmr_sta_netif_get()); - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - } - break; - default: { - ChipLogProgress(DeviceLayer, "WiFi station gets unknow code %u.", event->code); - /*nothing*/ - } - } -} - CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -113,10 +45,8 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) // Initialize LwIP. tcpip_init(NULL, NULL); - aos_register_event_filter(EV_WIFI, OnWiFiPlatformEvent, NULL); - hal_wifi_start_firmware_task(); - aos_post_event(EV_WIFI, CODE_WIFI_ON_INIT_DONE, 0); + ReturnErrorOnFailure(System::Clock::InitClock_RealTime()); err = chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16); SuccessOrExit(err); @@ -129,6 +59,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) SuccessOrExit(err); Internal::GenericPlatformManagerImpl_FreeRTOS::mEventLoopTask = backup_eventLoopTask; + wifi_start_firmware_task(); exit: return err; } diff --git a/src/platform/bouffalolab/BL602/args.gni b/src/platform/bouffalolab/BL602/args.gni index 2f8964ad4a907c..fbabcea74083b7 100644 --- a/src/platform/bouffalolab/BL602/args.gni +++ b/src/platform/bouffalolab/BL602/args.gni @@ -26,8 +26,6 @@ chip_enable_ota_requestor = true lwip_platform = "bl602" -chip_inet_config_enable_ipv4 = true - chip_build_tests = false chip_inet_config_enable_dns_resolver = false chip_inet_config_enable_tun_endpoint = false diff --git a/src/platform/bouffalolab/BL602/lwip_default_hooks.h b/src/platform/bouffalolab/BL602/lwip_default_hooks.h deleted file mode 100644 index 3c1d1d186c8836..00000000000000 --- a/src/platform/bouffalolab/BL602/lwip_default_hooks.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _LWIP_DEFAULT_HOOKS_H_ -#define _LWIP_DEFAULT_HOOKS_H_ -#include "lwip/arch.h" -#include "lwip/err.h" -#include "lwip/ip_addr.h" - -#ifdef CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT -extern struct netif * lwip_hook_ip6_route(const ip6_addr_t * src, const ip6_addr_t * dest); -#define LWIP_HOOK_IP6_ROUTE lwip_hook_ip6_route -#endif - -#ifdef CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT -extern const ip6_addr_t * lwip_hook_nd6_get_gw(struct netif * netif, const ip6_addr_t * dest); -#define LWIP_HOOK_ND6_GET_GW lwip_hook_nd6_get_gw -#endif - -#endif /* _LWIP_DEFAULT_HOOKS_H_ */ diff --git a/src/platform/bouffalolab/BL602/wifi_mgmr_portable.c b/src/platform/bouffalolab/BL602/wifi_mgmr_portable.c index 47cac9e4e10018..ae50a9c30c47aa 100644 --- a/src/platform/bouffalolab/BL602/wifi_mgmr_portable.c +++ b/src/platform/bouffalolab/BL602/wifi_mgmr_portable.c @@ -1,9 +1,12 @@ +#include #include #include +#include #include #include #include +#include #include #include @@ -12,13 +15,16 @@ #include #include +#include + extern struct wpa_sm gWpaSm; +static netif_ext_callback_t netifExtCallback; int wifi_mgmr_get_bssid(uint8_t * bssid) { int i; - for (i = 0; i < 8; i++) + for (i = 0; i < sizeof(wifiMgmr.wifi_mgmr_stat_info.bssid); i++) { bssid[i] = wifiMgmr.wifi_mgmr_stat_info.bssid[i]; } @@ -149,3 +155,18 @@ struct netif * deviceInterface_getNetif(void) { return wifi_mgmr_sta_netif_get(); } + +static void wifi_event_handler_raw(input_event_t * event, void * private_data) +{ + wifi_event_handler(event->code); +} + +void wifi_start_firmware_task(void) +{ + aos_register_event_filter(EV_WIFI, wifi_event_handler_raw, NULL); + + netif_add_ext_callback(&netifExtCallback, network_netif_ext_callback); + + hal_wifi_start_firmware_task(); + aos_post_event(EV_WIFI, CODE_WIFI_ON_INIT_DONE, 0); +} diff --git a/src/platform/bouffalolab/BL602/wifi_mgmr_portable.h b/src/platform/bouffalolab/BL602/wifi_mgmr_portable.h index aa855d23680613..f74f829a8baf76 100644 --- a/src/platform/bouffalolab/BL602/wifi_mgmr_portable.h +++ b/src/platform/bouffalolab/BL602/wifi_mgmr_portable.h @@ -18,6 +18,10 @@ bool wifi_mgmr_security_type_is_wpa2(void); bool wifi_mgmr_security_type_is_wpa3(void); struct netif * deviceInterface_getNetif(void); +void wifi_event_handler(uint32_t code); +void wifi_start_firmware_task(void); +void network_netif_ext_callback(struct netif * netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t * args); + #ifdef __cplusplus } #endif diff --git a/src/platform/bouffalolab/BL702/BUILD.gn b/src/platform/bouffalolab/BL702/BUILD.gn index b6a076655b3ace..ae27e225df6b01 100644 --- a/src/platform/bouffalolab/BL702/BUILD.gn +++ b/src/platform/bouffalolab/BL702/BUILD.gn @@ -20,14 +20,15 @@ import("${chip_root}/src/platform/device.gni") import("${chip_root}/src/platform/bouffalolab/common/args.gni") assert(chip_device_platform == "bl702") -assert(false == (chip_enable_wifi && chip_enable_openthread), - "Not support Wi-Fi and Thread together") +assert(chip_enable_factory_data == false) if (chip_enable_openthread) { import("//build_overrides/openthread.gni") } static_library("BL702") { + defines = [] + sources = [ "DiagnosticDataProviderImpl.cpp", "PlatformManagerImpl.cpp", @@ -73,11 +74,13 @@ static_library("BL702") { "ConfigurationManagerImpl.cpp", "ConnectivityManagerImpl.cpp", "NetworkCommissioningDriver.cpp", - "WiFiInterface.c", + "wifi_mgmr_portable.c", ] deps = [ "${chip_root}/src/lib/dnssd:platform_header" ] - } else if (chip_enable_openthread) { + } + + if (chip_enable_openthread) { # needed for MTD/FTD import("//build_overrides/bouffalolab_iot_sdk.gni") @@ -97,7 +100,9 @@ static_library("BL702") { ] deps += [ "${chip_root}/src/lib/dnssd:platform_header" ] } - } else { + } + + if (chip_enable_ethernet) { sources += [ "ConfigurationManagerImpl.cpp", "ConnectivityManagerImpl.cpp", diff --git a/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp b/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp index ec685f82ac7547..2b09225b2259c2 100644 --- a/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp @@ -18,14 +18,14 @@ #include #include #if CHIP_DEVICE_CONFIG_ENABLE_WIFI -#include -#endif +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET extern "C" { #include } -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET namespace chip { namespace DeviceLayer { @@ -37,7 +37,9 @@ CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) return CHIP_NO_ERROR; } -#elif !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI + +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET CHIP_ERROR ConfigurationManagerImpl::GetPrimaryMACAddress(MutableByteSpan buf) { if (buf.size() != ConfigurationManager::kPrimaryMACAddressLength) @@ -47,7 +49,7 @@ CHIP_ERROR ConfigurationManagerImpl::GetPrimaryMACAddress(MutableByteSpan buf) return CHIP_NO_ERROR; } -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/BL702/ConnectivityManagerImpl.cpp b/src/platform/bouffalolab/BL702/ConnectivityManagerImpl.cpp index 3f3465554bfad0..49692725f234c1 100644 --- a/src/platform/bouffalolab/BL702/ConnectivityManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702/ConnectivityManagerImpl.cpp @@ -23,13 +23,13 @@ #if CHIP_DEVICE_CONFIG_ENABLE_WIFI #include -#include -#endif +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET #include #include -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET using namespace ::chip; @@ -109,15 +109,41 @@ extern "C" void wifiInterface_eventScanDone(struct netif * interface, netbus_fs_ ChipLogProgress(DeviceLayer, "wifiInterface_eventScanDone"); NetworkCommissioning::BLWiFiDriver::GetInstance().OnScanWiFiNetworkDone(pmsg); } -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET extern "C" void ethernetInterface_eventGotIP(struct netif * interface) { ChipLogProgress(DeviceLayer, "ethernetInterface_eventGotIP"); ConnectivityMgrImpl().OnConnectivityChanged(interface); } -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET +extern "C" void network_netif_ext_callback(struct netif * nif, netif_nsc_reason_t reason, const netif_ext_callback_args_t * args) +{ + ChipDeviceEvent event; + + memset(&event, 0, sizeof(ChipDeviceEvent)); + + if ((LWIP_NSC_IPV6_ADDR_STATE_CHANGED & reason) && args) + { + + if (args->ipv6_addr_state_changed.addr_index >= LWIP_IPV6_NUM_ADDRESSES || + ip6_addr_islinklocal(netif_ip6_addr(nif, args->ipv6_addr_state_changed.addr_index))) + { + return; + } + + if (netif_ip6_addr_state(nif, args->ipv6_addr_state_changed.addr_index) != args->ipv6_addr_state_changed.old_state && + ip6_addr_ispreferred(netif_ip6_addr_state(nif, args->ipv6_addr_state_changed.addr_index))) + { + event.Type = kGotIpv6Address; + PlatformMgr().PostEventOrDie(&event); + } + } +} +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp b/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp index 1c93df0830875c..69ccc5da6e2dd3 100644 --- a/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp +++ b/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp @@ -18,8 +18,8 @@ #include #if CHIP_DEVICE_CONFIG_ENABLE_WIFI -#include -#endif +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI extern "C" { #include @@ -58,31 +58,31 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetBootReason(BootReasonType & bootReason #if CHIP_DEVICE_CONFIG_ENABLE_WIFI CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(MutableByteSpan & BssId) { - struct bflbwifi_ap_record ap_info; + struct bflbwifi_ap_record * pApInfo = wifiInterface_getApInfo(); - if (!wifiInterface_getApInfo(&ap_info)) + if (NULL == pApInfo) { ChipLogError(DeviceLayer, "Failed to get ap info."); return CHIP_ERROR_INTERNAL; } - return CopySpanToMutableSpan(ByteSpan(ap_info.bssid), BssId); + return CopySpanToMutableSpan(ByteSpan(pApInfo->bssid), BssId); } CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) { using app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum; - struct bflbwifi_ap_record ap_info; + struct bflbwifi_ap_record * pApInfo = wifiInterface_getApInfo(); - if (!wifiInterface_getApInfo(&ap_info)) + if (NULL == pApInfo) { ChipLogError(DeviceLayer, "Failed to get ap info."); return CHIP_ERROR_INTERNAL; } - if (ap_info.auth_mode < (uint8_t)(SecurityTypeEnum::kUnknownEnumValue)) + if (pApInfo->auth_mode < (uint8_t)(SecurityTypeEnum::kUnknownEnumValue)) { - securityType = (SecurityTypeEnum)(ap_info.auth_mode); + securityType = (SecurityTypeEnum)(pApInfo->auth_mode); } else { @@ -99,30 +99,30 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(app::Clusters::WiFiNetwork CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiChannelNumber(uint16_t & channelNumber) { - struct bflbwifi_ap_record ap_info; + struct bflbwifi_ap_record * pApInfo = wifiInterface_getApInfo(); - if (!wifiInterface_getApInfo(&ap_info)) + if (NULL == pApInfo) { ChipLogError(DeviceLayer, "Failed to get ap info."); return CHIP_ERROR_INTERNAL; } - channelNumber = ap_info.channel; + channelNumber = pApInfo->channel; return CHIP_NO_ERROR; } CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiRssi(int8_t & rssi) { - struct bflbwifi_ap_record ap_info; + struct bflbwifi_ap_record * pApInfo = wifiInterface_getApInfo(); - if (!wifiInterface_getApInfo(&ap_info)) + if (NULL == pApInfo) { ChipLogError(DeviceLayer, "Failed to get ap info."); return CHIP_ERROR_INTERNAL; } - rssi = ap_info.rssi; + rssi = pApInfo->rssi; return CHIP_NO_ERROR; } @@ -171,6 +171,6 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBeaconRxCount(uint32_t & beaconRxC { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/BL702/EthernetInterface.c b/src/platform/bouffalolab/BL702/EthernetInterface.c index 469ffb79f64852..82ded1b92d6dd3 100644 --- a/src/platform/bouffalolab/BL702/EthernetInterface.c +++ b/src/platform/bouffalolab/BL702/EthernetInterface.c @@ -21,28 +21,17 @@ #include "EthernetInterface.h" static struct dhcp6 dhcp6_val; - -extern int8_t bl_route_hook_init(void); +static netif_ext_callback_t netifExtCallback; static void netif_status_callback(struct netif * netif) { - if (netif->flags & NETIF_FLAG_UP) + if ((netif->flags & NETIF_FLAG_UP) && !ip4_addr_isany(netif_ip4_addr(netif))) { - for (uint32_t i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) - { - if (!ip6_addr_isany(netif_ip6_addr(netif, i)) && ip6_addr_ispreferred(netif_ip6_addr_state(netif, i))) - { - - const ip6_addr_t * ip6addr = netif_ip6_addr(netif, i); - if (ip6_addr_isany(ip6addr) || ip6_addr_islinklocal(ip6addr)) - { - continue; - } + printf("IP: %s\r\n", ip4addr_ntoa(netif_ip4_addr(netif))); + printf("MASK: %s\r\n", ip4addr_ntoa(netif_ip4_netmask(netif))); + printf("Gateway: %s\r\n", ip4addr_ntoa(netif_ip4_gw(netif))); - ethernetInterface_eventGotIP(netif); - break; - } - } + ethernetInterface_eventGotIP(netif); } } @@ -81,7 +70,7 @@ void ethernetInterface_init(void) /* Set callback to be called when interface is brought up/down or address is changed while up */ netif_set_status_callback(ð_mac, netif_status_callback); - bl_route_hook_init(); + netif_add_ext_callback(&netifExtCallback, network_netif_ext_callback); } struct netif * deviceInterface_getNetif(void) diff --git a/src/platform/bouffalolab/BL702/EthernetInterface.h b/src/platform/bouffalolab/BL702/EthernetInterface.h index 7809a5430f5c88..98e1a7fa03df49 100644 --- a/src/platform/bouffalolab/BL702/EthernetInterface.h +++ b/src/platform/bouffalolab/BL702/EthernetInterface.h @@ -25,6 +25,8 @@ void ethernetInterface_init(void); void ethernetInterface_eventGotIP(struct netif * interface); struct netif * deviceInterface_getNetif(void); +void network_netif_ext_callback(struct netif * netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t * args); + #ifdef __cplusplus } #endif diff --git a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp index 252a1eba7f2475..3762091fbd3e21 100644 --- a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp +++ b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp @@ -17,12 +17,11 @@ #include #include -#include +#include using namespace ::chip; using namespace ::chip::DeviceLayer::Internal; -//#if CHIP_DEVICE_CONFIG_ENABLE_WIFI namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { @@ -33,23 +32,22 @@ CHIP_ERROR BLWiFiDriver::Init(NetworkStatusChangeCallback * networkStatusChangeC size_t ssidLen = 0; size_t credentialsLen = 0; - err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiSSID, mSavedNetwork.ssid, sizeof(mSavedNetwork.ssid), - &ssidLen); - SuccessOrExit(err); - err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiPassword, mSavedNetwork.credentials, + mpScanCallback = nullptr; + mpConnectCallback = nullptr; + mpStatusChangeCallback = networkStatusChangeCallback; + + err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiSSID, mSavedNetwork.credentials, sizeof(mSavedNetwork.credentials), &credentialsLen); SuccessOrExit(err); + err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiPassword, mSavedNetwork.ssid, + sizeof(mSavedNetwork.ssid), &ssidLen); + SuccessOrExit(err); - mSavedNetwork.credentialsLen = credentialsLen; - mSavedNetwork.ssidLen = ssidLen; - mSavedNetwork.credentials[mSavedNetwork.credentialsLen] = '\0'; - mSavedNetwork.ssid[mSavedNetwork.ssidLen] = '\0'; + mSavedNetwork.credentialsLen = credentialsLen; + mSavedNetwork.ssidLen = ssidLen; - mStagingNetwork = mSavedNetwork; - mpScanCallback = nullptr; - mpConnectCallback = nullptr; - mpStatusChangeCallback = networkStatusChangeCallback; - mScanSpecific = false; + mStagingNetwork = mSavedNetwork; + mScanSpecific = false; exit: if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND) @@ -123,6 +121,7 @@ Status BLWiFiDriver::RemoveNetwork(ByteSpan networkId, MutableCharSpan & outDebu Status BLWiFiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index, MutableCharSpan & outDebugText) { outDebugText.reduce_size(0); + // Only one network is supported now VerifyOrReturnError(index == 0, Status::kOutOfRange); VerifyOrReturnError(NetworkMatch(mStagingNetwork, networkId), Status::kNetworkIDNotFound); @@ -145,7 +144,8 @@ CHIP_ERROR BLWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen || keyLen == BLWiFiDriver::WiFiCredentialLength::kWEP64 || (keyLen >= BLWiFiDriver::WiFiCredentialLength::kMinWPAPSK && keyLen <= BLWiFiDriver::WiFiCredentialLength::kMaxWPAPSK)) { - + wifiInterface_disconnect(); + vTaskDelay(500); if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen) { wifiInterface_connect((char *) ssid, NULL); @@ -187,11 +187,9 @@ void BLWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback VerifyOrExit(NetworkMatch(mStagingNetwork, networkId), networkingStatus = Status::kNetworkIDNotFound); VerifyOrExit(mpConnectCallback == nullptr, networkingStatus = Status::kUnknownError); - ChipLogProgress(NetworkProvisioning, "BL702 Network Commissioning ConnectNetwork: SSID: %.*s", - static_cast(networkId.size()), networkId.data()); + ChipLogProgress(NetworkProvisioning, "BL NetworkCommissioningDelegate: SSID: %.*s", static_cast(networkId.size()), + networkId.data()); - mStagingNetwork.ssid[mStagingNetwork.ssidLen] = '\0'; - mStagingNetwork.credentials[mStagingNetwork.credentialsLen] = '\0'; err = ConnectWiFiNetwork(reinterpret_cast(mStagingNetwork.ssid), mStagingNetwork.ssidLen, reinterpret_cast(mStagingNetwork.credentials), mStagingNetwork.credentialsLen); mpConnectCallback = callback; @@ -209,14 +207,34 @@ void BLWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback } } -void BLWiFiDriver::OnScanWiFiNetworkDone(void * arg) +void BLWiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) { - netbus_fs_scan_ind_cmd_msg_t * pmsg = (netbus_fs_scan_ind_cmd_msg_t *) arg; - size_t i = 0, ap_num = pmsg->num; + if (callback != nullptr) + { + ChipLogError(NetworkProvisioning, "ssid.data(): %s", ssid.data()); + + if (ssid.data()) + { + memset(mScanSSID, 0, sizeof(mScanSSID)); + memcpy(mScanSSID, ssid.data(), ssid.size()); + mScanSpecific = true; + } + mpScanCallback = callback; + wifiInterface_startScan(); + } +} + +void BLWiFiDriver::OnScanWiFiNetworkDone(void * opaque) +{ + netbus_wifi_mgmr_msg_cmd_t * pkg_data = (netbus_wifi_mgmr_msg_cmd_t *) ((struct pkg_protocol *) opaque)->payload; + netbus_fs_scan_ind_cmd_msg_t * pmsg = (netbus_fs_scan_ind_cmd_msg_t *) ((netbus_fs_scan_ind_cmd_msg_t *) pkg_data); + + size_t i = 0, ap_num = 0; WiFiScanResponse *pScanResponse, *p; for (i = 0; i < pmsg->num; i++) { + ChipLogProgress(DeviceLayer, "OnScanWiFiNetworkDone %s", pmsg->records[i].ssid); if (mScanSpecific && !strcmp(mScanSSID, (char *) (pmsg->records[i].ssid))) { ap_num = 1; @@ -224,7 +242,7 @@ void BLWiFiDriver::OnScanWiFiNetworkDone(void * arg) } } - if (0 == ap_num || (mScanSpecific && ap_num == pmsg->num)) + if (0 == pmsg->num || (mScanSpecific && 0 == ap_num)) { ChipLogProgress(DeviceLayer, "No AP found"); if (mpScanCallback != nullptr) @@ -235,7 +253,15 @@ void BLWiFiDriver::OnScanWiFiNetworkDone(void * arg) return; } - p = pScanResponse = (WiFiScanResponse *) malloc(sizeof(WiFiScanResponse) * ap_num); + if (ap_num) + { + p = pScanResponse = (WiFiScanResponse *) malloc(sizeof(WiFiScanResponse) * ap_num); + } + else + { + p = pScanResponse = (WiFiScanResponse *) malloc(sizeof(WiFiScanResponse) * pmsg->num); + ap_num = pmsg->num; + } for (i = 0; i < pmsg->num; i++) { if (mScanSpecific && strcmp(mScanSSID, (char *) (pmsg->records[i].ssid))) @@ -280,39 +306,25 @@ void BLWiFiDriver::OnScanWiFiNetworkDone(void * arg) free(pScanResponse); } -void BLWiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) -{ - if (callback != nullptr) - { - if (ssid.data()) - { - memset(mScanSSID, 0, sizeof(mScanSSID)); - memcpy(mScanSSID, ssid.data(), ssid.size()); - mScanSpecific = true; - } - mpScanCallback = callback; - wifiInterface_startScan(); - } -} - CHIP_ERROR GetConfiguredNetwork(Network & network) { - struct bflbwifi_ap_record ap_info; - - ChipLogProgress(DeviceLayer, "GetConfiguredNetwork"); + struct bflbwifi_ap_record * pApInfo = wifiInterface_getApInfo(); - if (!wifiInterface_getApInfo(&ap_info)) + if (NULL == pApInfo) { return CHIP_ERROR_INTERNAL; } - uint8_t length = strnlen(reinterpret_cast(ap_info.ssid), DeviceLayer::Internal::kMaxWiFiSSIDLength); + ChipLogProgress(DeviceLayer, "GetConfiguredNetwork [%s]", pApInfo->ssid); + + uint8_t length = strnlen(reinterpret_cast(pApInfo->ssid), DeviceLayer::Internal::kMaxWiFiSSIDLength); if (length > sizeof(network.networkID)) { ChipLogError(DeviceLayer, "SSID too long"); return CHIP_ERROR_INTERNAL; } - memcpy(network.networkID, ap_info.ssid, length); + + memcpy(network.networkID, pApInfo->ssid, length); network.networkIDLen = length; return CHIP_NO_ERROR; } @@ -334,6 +346,7 @@ void BLWiFiDriver::OnNetworkStatusChange() if (ConnectivityMgrImpl().GetWiFiStationState() == ConnectivityManager::kWiFiStationState_Connected) { + ChipLogProgress(DeviceLayer, "OnNetworkStatusChange kWiFiStationState_Connected, %s", configuredNetwork.networkID); staConnected = true; } @@ -390,7 +403,64 @@ bool BLWiFiDriver::WiFiNetworkIterator::Next(Network & item) return true; } +void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg) +{ + if (!(DeviceEventType::IsPlatformSpecific(event->Type) && DeviceEventType::IsPublic(event->Type))) + { + return; + } + + switch (event->Type) + { + case kWiFiOnInitDone: + break; + case kWiFiOnConnected: + BLWiFiDriver::GetInstance().OnNetworkStatusChange(); + break; + case kGotIpAddress: + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManagerImpl::kWiFiStationState_Connected); + ConnectivityMgrImpl().OnConnectivityChanged(deviceInterface_getNetif()); + break; + case kGotIpv6Address: + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManagerImpl::kWiFiStationState_Connected); + ConnectivityMgrImpl().OnConnectivityChanged(deviceInterface_getNetif()); + break; + case kWiFiOnDisconnected: + if (ConnectivityManager::kWiFiStationState_Connecting == ConnectivityMgrImpl().GetWiFiStationState()) + { + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting_Failed); + } + break; + default: + ChipLogProgress(DeviceLayer, "Undefined network commission event type %x.\r\n", event->Type); + break; + } +} + +extern "C" void wifi_event_handler(uint32_t code) +{ + ChipDeviceEvent event; + + memset(&event, 0, sizeof(ChipDeviceEvent)); + switch (code) + { + case VIRT_NET_EV_ON_CONNECTED: + event.Type = kWiFiOnConnected; + PlatformMgr().PostEventOrDie(&event); + break; + case VIRT_NET_EV_ON_GOT_IP: + event.Type = kGotIpAddress; + PlatformMgr().PostEventOrDie(&event); + break; + case VIRT_NET_EV_ON_DISCONNECT: + event.Type = kWiFiOnDisconnected; + PlatformMgr().PostEventOrDie(&event); + break; + default: + ChipLogProgress(DeviceLayer, "[APP] [EVT] Unknown code %lu \r\n", code); + } +} + } // namespace NetworkCommissioning } // namespace DeviceLayer } // namespace chip -//#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI diff --git a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h index caa071ddd467b2..5c9e5637857a14 100644 --- a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h @@ -17,12 +17,15 @@ #pragma once +#include #include namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { +void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg); + namespace { constexpr uint8_t kMaxWiFiNetworks = 1; constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; @@ -49,9 +52,9 @@ class BLScanResponseIterator : public Iterator void Release() override {} private: + const size_t mSize; + const WiFiScanResponse * mpScanResults; size_t mIternum = 0; - size_t mSize; - WiFiScanResponse * mpScanResults; }; class BLWiFiDriver final : public WiFiDriver @@ -73,9 +76,9 @@ class BLWiFiDriver final : public WiFiDriver struct WiFiNetwork { - char ssid[DeviceLayer::Internal::kMaxWiFiSSIDLength + 1]; + char ssid[DeviceLayer::Internal::kMaxWiFiSSIDLength]; uint8_t ssidLen = 0; - char credentials[DeviceLayer::Internal::kMaxWiFiKeyLength + 1]; + char credentials[DeviceLayer::Internal::kMaxWiFiKeyLength]; uint8_t credentialsLen = 0; }; enum WiFiCredentialLength @@ -107,10 +110,11 @@ class BLWiFiDriver final : public WiFiDriver Status AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials, MutableCharSpan & outDebugText, uint8_t & outNetworkIndex) override; void ScanNetworks(ByteSpan ssid, ScanCallback * callback) override; + CHIP_ERROR ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, const char * key, uint8_t keyLen); void OnConnectWiFiNetwork(bool isConnected); - void OnScanWiFiNetworkDone(void * arg); - void OnNetworkStatusChange(); + void OnScanWiFiNetworkDone(void * opaque = NULL); + void OnNetworkStatusChange(void); CHIP_ERROR SetLastDisconnectReason(const ChipDeviceEvent * event); int32_t GetLastDisconnectReason(); @@ -123,7 +127,6 @@ class BLWiFiDriver final : public WiFiDriver private: bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); - CHIP_ERROR StartScanWiFiNetworks(ByteSpan ssid); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; @@ -131,6 +134,8 @@ class BLWiFiDriver final : public WiFiDriver ConnectCallback * mpConnectCallback; NetworkStatusChangeCallback * mpStatusChangeCallback = nullptr; int32_t mLastDisconnectedReason; + + /** +1 byte for string termination */ char mScanSSID[chip::DeviceLayer::Internal::kMaxWiFiSSIDLength + 1]; bool mScanSpecific = false; }; diff --git a/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp b/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp index db91cda12ed06b..1edc80bb21eed4 100644 --- a/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp @@ -25,16 +25,18 @@ #include #if CHIP_DEVICE_CONFIG_ENABLE_WIFI -#include -#endif +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI #if CHIP_DEVICE_CONFIG_ENABLE_THREAD #include #include -#else -#include #endif +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + extern "C" { #include } @@ -63,24 +65,17 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) // Initialize LwIP. tcpip_init(NULL, NULL); -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI - wifiInterface_init(); -#elif CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD otRadio_opt_t opt; - opt.byte = 0; + opt.bf.isFtd = true; opt.bf.isCoexEnable = true; ot_alarmInit(); ot_radioInit(opt); -#else - ethernetInterface_init(); -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD ReturnErrorOnFailure(System::Clock::InitClock_RealTime()); - SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance()); - SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance()); - err = chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16); SuccessOrExit(err); @@ -92,6 +87,14 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) SuccessOrExit(err); Internal::GenericPlatformManagerImpl_FreeRTOS::mEventLoopTask = backup_eventLoopTask; +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI + wifi_start_firmware_task(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI + +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + ethernetInterface_init(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + exit: return err; } diff --git a/src/platform/bouffalolab/BL702/args.gni b/src/platform/bouffalolab/BL702/args.gni index 4a3494612104ac..ba2962717104cc 100644 --- a/src/platform/bouffalolab/BL702/args.gni +++ b/src/platform/bouffalolab/BL702/args.gni @@ -17,6 +17,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/mbedtls.gni") import("//build_overrides/pigweed.gni") import("${chip_root}/examples/platform/bouffalolab/bl702/args.gni") +import("${chip_root}/src/platform/bouffalolab/common/args.gni") chip_device_platform = "bl702" @@ -28,13 +29,12 @@ riscv_platform_config = "${bouffalolab_iot_sdk_build_root}/common/rsicv.gni" mbedtls_target = "${bouffalolab_iot_sdk_build_root}/bl702:bl_iot_sdk" -chip_inet_config_enable_ipv4 = false chip_inet_config_enable_tcp_endpoint = false chip_build_tests = false openthread_external_mbedtls = mbedtls_target -openthread_project_core_config_file = "bl702-openthread-core-bl-config.h" + openthread_core_config_platform_check_file = "bl702-openthread-core-bl-config-check.h" openthread_project_include_dirs = diff --git a/src/platform/bouffalolab/BL702/bl702-openthread-core-bl-config.h b/src/platform/bouffalolab/BL702/bl702-openthread-core-bl-config.h index e25197c8011f10..6bc32bebc35f3f 100644 --- a/src/platform/bouffalolab/BL702/bl702-openthread-core-bl-config.h +++ b/src/platform/bouffalolab/BL702/bl702-openthread-core-bl-config.h @@ -60,8 +60,8 @@ #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 0 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 0 -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 1 -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 1 +#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 0 +#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 0 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 1 #define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 @@ -77,4 +77,7 @@ // #define OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE 0 #define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +// #define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG + #endif // OPENTHREAD_CORE_BL702_CONFIG_H_ diff --git a/src/platform/bouffalolab/BL702/lwip_default_hooks.h b/src/platform/bouffalolab/BL702/lwip_default_hooks.h deleted file mode 100644 index 3c1d1d186c8836..00000000000000 --- a/src/platform/bouffalolab/BL702/lwip_default_hooks.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _LWIP_DEFAULT_HOOKS_H_ -#define _LWIP_DEFAULT_HOOKS_H_ -#include "lwip/arch.h" -#include "lwip/err.h" -#include "lwip/ip_addr.h" - -#ifdef CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT -extern struct netif * lwip_hook_ip6_route(const ip6_addr_t * src, const ip6_addr_t * dest); -#define LWIP_HOOK_IP6_ROUTE lwip_hook_ip6_route -#endif - -#ifdef CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT -extern const ip6_addr_t * lwip_hook_nd6_get_gw(struct netif * netif, const ip6_addr_t * dest); -#define LWIP_HOOK_ND6_GET_GW lwip_hook_nd6_get_gw -#endif - -#endif /* _LWIP_DEFAULT_HOOKS_H_ */ diff --git a/src/platform/bouffalolab/BL702/WiFiInterface.c b/src/platform/bouffalolab/BL702/wifi_mgmr_portable.c similarity index 57% rename from src/platform/bouffalolab/BL702/WiFiInterface.c rename to src/platform/bouffalolab/BL702/wifi_mgmr_portable.c index 1634edc04256a0..05b9f4b7317b1e 100644 --- a/src/platform/bouffalolab/BL702/WiFiInterface.c +++ b/src/platform/bouffalolab/BL702/wifi_mgmr_portable.c @@ -16,6 +16,7 @@ */ #include #include +#include #include #include @@ -24,71 +25,48 @@ #include #include -#include -#include - -#include -#include +#include virt_net_t vnet_spi; -struct bflbwifi_ap_record vnet_ap_record; -SemaphoreHandle_t vnet_msgSem = NULL; - -extern int8_t bl_route_hook_init(void); +static struct bflbwifi_ap_record vnet_ap_record; +static netif_ext_callback_t netifExtCallback; /* event callback */ static int virt_net_spi_event_cb(virt_net_t obj, enum virt_net_event_code code, void * opaque) { + struct bflbwifi_ap_record * record; + assert(obj != NULL); - switch (code) + if (VIRT_NET_EV_ON_LINK_STATUS_DONE == code) { - case VIRT_NET_EV_ON_CONNECTED: - wifiInterface_eventConnected((struct netif *) &obj->netif); - break; - case VIRT_NET_EV_ON_DISCONNECT: - wifiInterface_eventDisconnected((struct netif *) &obj->netif); - break; - - case VIRT_NET_EV_ON_LINK_STATUS_DONE: { - struct bflbwifi_ap_record * record; netbus_fs_link_status_ind_cmd_msg_t * pkg_data; pkg_data = (netbus_fs_link_status_ind_cmd_msg_t *) ((struct pkg_protocol *) opaque)->payload; record = &pkg_data->record; memcpy(&vnet_ap_record, record, sizeof(struct bflbwifi_ap_record)); - wifiInterface_eventLinkStatusDone((struct netif *) &obj->netif, pkg_data); - - if (vnet_msgSem) + if (record->link_status == BF1B_WIFI_LINK_STATUS_DOWN) { - xSemaphoreGive(vnet_msgSem); + code = VIRT_NET_EV_ON_DISCONNECT; + } + else + { + code = -1; + return 0; } - - break; } - - case VIRT_NET_EV_ON_GOT_IP: { - wifiInterface_eventGotIP((struct netif *) &obj->netif); - break; + else if (VIRT_NET_EV_ON_SCAN_DONE == code) + { + wifiInterface_eventScanDone((struct netif *) &obj->netif, opaque); } - case VIRT_NET_EV_ON_SCAN_DONE: { - netbus_wifi_mgmr_msg_cmd_t * pkg_data; - pkg_data = (netbus_wifi_mgmr_msg_cmd_t *) ((struct pkg_protocol *) opaque)->payload; - - netbus_fs_scan_ind_cmd_msg_t * msg; - msg = (netbus_fs_scan_ind_cmd_msg_t *) ((netbus_fs_scan_ind_cmd_msg_t *) pkg_data); - wifiInterface_eventScanDone((struct netif *) &obj->netif, msg); - } - default: - break; - } + wifi_event_handler(code); return 0; } -bool wifiInterface_init() +bool wifi_start_firmware_task(void) { vnet_spi = virt_net_create(NULL); if (vnet_spi == NULL) @@ -101,16 +79,10 @@ bool wifiInterface_init() return false; } - vnet_msgSem = xSemaphoreCreateBinary(); - if (vnet_msgSem == NULL) - { - return false; - } - virt_net_setup_callback(vnet_spi, virt_net_spi_event_cb, NULL); netifapi_netif_set_default((struct netif *) &vnet_spi->netif); - bl_route_hook_init(); + netif_add_ext_callback(&netifExtCallback, network_netif_ext_callback); return true; } @@ -125,9 +97,19 @@ struct netif * deviceInterface_getNetif(void) return NULL; } +struct netif * otbr_getBackboneNetif(void) +{ + if (vnet_spi) + { + return (struct netif *) &vnet_spi->netif; + } + + return NULL; +} + void wifiInterface_getMacAddress(uint8_t * pmac) { - virt_net_get_mac(vnet_spi, pmac); + memcpy(pmac, vnet_spi->mac, sizeof(vnet_spi->mac)); } void wifiInterface_connect(char * ssid, char * passwd) @@ -140,19 +122,15 @@ void wifiInterface_disconnect(void) virt_net_disconnect(vnet_spi); } -bool wifiInterface_getApInfo(struct bflbwifi_ap_record * ap_info) +struct bflbwifi_ap_record * wifiInterface_getApInfo(void) { - virt_net_get_link_status(vnet_spi); - - if (vnet_msgSem && xSemaphoreTake(vnet_msgSem, 3000)) + memset(&vnet_ap_record, 0, sizeof(struct bflbwifi_ap_record)); + if (0 == virt_net_get_link_status(vnet_spi)) { - if (ap_info) - { - memcpy(ap_info, &vnet_ap_record, sizeof(struct bflbwifi_ap_record)); - } - return true; + return &vnet_ap_record; } - return false; + + return NULL; } void wifiInterface_startScan(void) diff --git a/src/platform/bouffalolab/BL702/WiFiInterface.h b/src/platform/bouffalolab/BL702/wifi_mgmr_portable.h similarity index 83% rename from src/platform/bouffalolab/BL702/WiFiInterface.h rename to src/platform/bouffalolab/BL702/wifi_mgmr_portable.h index e48e0da6cba63b..4d152355c405c1 100644 --- a/src/platform/bouffalolab/BL702/WiFiInterface.h +++ b/src/platform/bouffalolab/BL702/wifi_mgmr_portable.h @@ -22,14 +22,13 @@ extern "C" { #endif #include - -bool wifiInterface_init(); +#include struct netif * deviceInterface_getNetif(void); void wifiInterface_getMacAddress(uint8_t * pmac); void wifiInterface_connect(char * ssid, char * passwd); void wifiInterface_disconnect(void); -bool wifiInterface_getApInfo(struct bflbwifi_ap_record * ap_info); +struct bflbwifi_ap_record * wifiInterface_getApInfo(void); void wifiInterface_startScan(void); void wifiInterface_eventConnected(struct netif * interface); @@ -39,6 +38,11 @@ void wifiInterface_eventLinkStatusDone(struct netif * interface, netbus_fs_link_ void wifiInterface_eventGotIP(struct netif * interface); void wifiInterface_eventScanDone(struct netif * interface, netbus_fs_scan_ind_cmd_msg_t * pmsg); +void wifi_event_handler(uint32_t code); +bool wifi_start_firmware_task(void); + +void network_netif_ext_callback(struct netif * netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t * args); + #ifdef __cplusplus } #endif diff --git a/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp b/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp index 798e0c1413e220..3072f3aa26dcab 100644 --- a/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp @@ -68,9 +68,6 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) ReturnErrorOnFailure(System::Clock::InitClock_RealTime()); - SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance()); - SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance()); - // Initialize LwIP. tcpip_init(NULL, NULL); diff --git a/src/platform/bouffalolab/BL702L/args.gni b/src/platform/bouffalolab/BL702L/args.gni index 58c45b87113ff5..f9a81a293f40c5 100644 --- a/src/platform/bouffalolab/BL702L/args.gni +++ b/src/platform/bouffalolab/BL702L/args.gni @@ -28,13 +28,12 @@ riscv_platform_config = "${bouffalolab_iot_sdk_build_root}/common/rsicv.gni" mbedtls_target = "${bouffalolab_iot_sdk_build_root}/bl702l:bl_iot_sdk" -chip_inet_config_enable_ipv4 = false chip_inet_config_enable_tcp_endpoint = false chip_build_tests = false openthread_external_mbedtls = mbedtls_target -openthread_project_core_config_file = "bl702l-openthread-core-bl-config.h" + openthread_core_config_platform_check_file = "bl702l-openthread-core-bl-config-check.h" openthread_project_include_dirs = diff --git a/src/platform/bouffalolab/BL702L/bl702l-openthread-core-bl-config.h b/src/platform/bouffalolab/BL702L/bl702l-openthread-core-bl-config.h index e25197c8011f10..7836304f8a0401 100644 --- a/src/platform/bouffalolab/BL702L/bl702l-openthread-core-bl-config.h +++ b/src/platform/bouffalolab/BL702L/bl702l-openthread-core-bl-config.h @@ -60,8 +60,8 @@ #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 0 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 0 -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 1 -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 1 +#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 0 +#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 0 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 1 #define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 diff --git a/src/platform/bouffalolab/common/BLEManagerImpl.cpp b/src/platform/bouffalolab/common/BLEManagerImpl.cpp index b233721953161e..1cb6ce696f73e6 100644 --- a/src/platform/bouffalolab/common/BLEManagerImpl.cpp +++ b/src/platform/bouffalolab/common/BLEManagerImpl.cpp @@ -29,7 +29,7 @@ #endif extern "C" { -#ifdef BL702L +#if CHIP_DEVICE_LAYER_TARGET_BL702L #include #else #include @@ -124,7 +124,7 @@ CHIP_ERROR BLEManagerImpl::_Init() memset(mSubscribedConns, 0, sizeof(mSubscribedConns)); ReturnErrorOnFailure(InitRandomStaticAddress()); -#ifdef BL702L +#if CHIP_DEVICE_LAYER_TARGET_BL702L btble_controller_init(configMAX_PRIORITIES - 1); #else ble_controller_init(configMAX_PRIORITIES - 1); diff --git a/src/platform/bouffalolab/common/CHIPDevicePlatformEvent.h b/src/platform/bouffalolab/common/CHIPDevicePlatformEvent.h index 8746bebf82bfe8..a7ee3ec529f146 100644 --- a/src/platform/bouffalolab/common/CHIPDevicePlatformEvent.h +++ b/src/platform/bouffalolab/common/CHIPDevicePlatformEvent.h @@ -19,8 +19,10 @@ #include +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE #include #include +#endif namespace chip { namespace DeviceLayer { @@ -51,6 +53,7 @@ enum InternalPlatformSpecificEventTypes } // namespace DeviceEventType +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE struct BleConnEventType { bt_conn * BtConn; @@ -88,6 +91,11 @@ struct ChipDevicePlatformEvent final BleC2IndDoneEventType BleC2IndDoneEvent; }; }; +#else +struct ChipDevicePlatformEvent final +{ +}; +#endif } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/common/CHIPPlatformConfig.h b/src/platform/bouffalolab/common/CHIPPlatformConfig.h index 3cb267bdcb6b1e..94fe3e715580c8 100644 --- a/src/platform/bouffalolab/common/CHIPPlatformConfig.h +++ b/src/platform/bouffalolab/common/CHIPPlatformConfig.h @@ -19,9 +19,10 @@ #include -// ==================== General Platform Adaptations ==================== -#define ChipDie() abort() +extern "C" void bflb_assert(void); +#define CHIP_CONFIG_ABORT() bflb_assert() +// ==================== General Platform Adaptations ==================== #define CHIP_CONFIG_PERSISTED_STORAGE_KEY_TYPE const char * #define CHIP_CONFIG_PERSISTED_STORAGE_ENC_MSG_CNTR_ID 1 #define CHIP_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH 2 @@ -29,9 +30,6 @@ #define CHIP_CONFIG_LIFETIIME_PERSISTED_COUNTER_KEY BLConfig::kConfigKey_LifeTimeCounter // ==================== Security Adaptations ==================== -//#define CHIP_CONFIG_SHA256_CONTEXT_SIZE sizeof(bl_sha_ctx_t) -#define CHIP_CONFIG_SHA256_CONTEXT_SIZE ((1 + 5 + 18 + 16 + 16) * sizeof(unsigned int)) - #define CHIP_CONFIG_AES_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_AES_IMPLEMENTATION_AESNI 0 #define CHIP_CONFIG_AES_IMPLEMENTATION_MBEDTLS 1 diff --git a/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp b/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp index b9719b795d15c3..b8b82dd3c296f9 100644 --- a/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp +++ b/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp @@ -21,9 +21,7 @@ #include -extern "C" { -#include -} +extern "C" void hal_reboot(void); namespace chip { namespace DeviceLayer { @@ -207,7 +205,8 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) // Restart the system. ChipLogProgress(DeviceLayer, "System restarting"); - bl_sys_reset_por(); + + hal_reboot(); } ConfigurationManager & ConfigurationMgrImpl() diff --git a/src/platform/bouffalolab/common/ConfigurationManagerImpl.h b/src/platform/bouffalolab/common/ConfigurationManagerImpl.h index d882f76f89e3bf..1e7bb53922eb79 100644 --- a/src/platform/bouffalolab/common/ConfigurationManagerImpl.h +++ b/src/platform/bouffalolab/common/ConfigurationManagerImpl.h @@ -65,7 +65,7 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp CHIP_ERROR GetPrimaryWiFiMACAddress(uint8_t * buf) override; #endif -#if !CHIP_DEVICE_CONFIG_ENABLE_WIFI && !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) override; #endif diff --git a/src/platform/bouffalolab/common/ConnectivityManagerImpl.cpp b/src/platform/bouffalolab/common/ConnectivityManagerImpl.cpp index a74cf5dd1cf686..598d40a24b31e4 100644 --- a/src/platform/bouffalolab/common/ConnectivityManagerImpl.cpp +++ b/src/platform/bouffalolab/common/ConnectivityManagerImpl.cpp @@ -33,12 +33,15 @@ #if CHIP_DEVICE_CONFIG_ENABLE_WIFI #include -#ifdef BL602 +#if CHIP_DEVICE_LAYER_TARGET_BL602 #include #endif -#ifdef BL702 +#if CHIP_DEVICE_LAYER_TARGET_BL702 #include #endif +#if CHIP_DEVICE_LAYER_TARGET_BL616 +#include +#endif #endif #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE @@ -71,6 +74,8 @@ CHIP_ERROR ConnectivityManagerImpl::_Init() #if CHIP_DEVICE_CONFIG_ENABLE_WIFI mWiFiStationState = ConnectivityManager::kWiFiStationState_NotConnected; ReturnErrorOnFailure(SetWiFiStationMode(kWiFiStationMode_Enabled)); + + PlatformMgr().AddEventHandler(NetworkCommissioning::NetworkEventHandler, 0); #endif return CHIP_NO_ERROR; @@ -226,7 +231,7 @@ void ConnectivityManagerImpl::DriveStationState() } break; case ConnectivityManager::kWiFiStationState_Connected: { - ChipLogProgress(DeviceLayer, "Wi-Fi stattion connected."); + ChipLogProgress(DeviceLayer, "Wi-Fi station connected."); OnWiFiStationConnected(); SystemLayer().ScheduleLambda([]() { NetworkCommissioning::BLWiFiDriver::GetInstance().OnConnectWiFiNetwork(true); }); } @@ -247,7 +252,7 @@ void ConnectivityManagerImpl::DriveStationState(::chip::System::Layer * aLayer, } #endif -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET || CHIP_DEVICE_CONFIG_ENABLE_WIFI void ConnectivityManagerImpl::OnConnectivityChanged(struct netif * interface) { bool haveIPv4Conn = false; @@ -308,11 +313,13 @@ void ConnectivityManagerImpl::OnConnectivityChanged(struct netif * interface) if (haveIPv4Conn != hadIPv4Conn) { + memset(&m_ip4addr, 0, sizeof(ip4_addr_t)); ChipLogProgress(DeviceLayer, "%s Internet connectivity %s", "IPv4", (haveIPv4Conn) ? "ESTABLISHED" : "LOST"); } if (haveIPv6Conn != hadIPv6Conn) { + memset(&m_ip6addr, 0, sizeof(ip6_addr_t) * LWIP_IPV6_NUM_ADDRESSES); ChipLogProgress(DeviceLayer, "%s Internet connectivity %s", "IPv6", (haveIPv6Conn) ? "ESTABLISHED" : "LOST"); } } diff --git a/src/platform/bouffalolab/common/ConnectivityManagerImpl.h b/src/platform/bouffalolab/common/ConnectivityManagerImpl.h index 0011a8b0fc1467..80b1d980d4f9d1 100644 --- a/src/platform/bouffalolab/common/ConnectivityManagerImpl.h +++ b/src/platform/bouffalolab/common/ConnectivityManagerImpl.h @@ -42,6 +42,16 @@ namespace chip { namespace DeviceLayer { +enum +{ + kWiFiOnInitDone = DeviceEventType::kRange_PublicPlatformSpecific, + kWiFiOnScanDone, + kWiFiOnConnected, + kGotIpAddress, + kGotIpv6Address, + kWiFiOnDisconnected, +}; + class ConnectivityManagerImpl final : public ConnectivityManager, public Internal::GenericConnectivityManagerImpl, public Internal::GenericConnectivityManagerImpl_UDP, @@ -79,7 +89,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, void OnWiFiStationDisconnected(void); #endif -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET void OnConnectivityChanged(struct netif * interface); void OnIPv4AddressAvailable(); void OnIPv6AddressAvailable(); @@ -100,9 +110,10 @@ class ConnectivityManagerImpl final : public ConnectivityManager, void _ClearWiFiStationProvision(); void _OnWiFiStationProvisionChange(); CHIP_ERROR ConnectProvisionedWiFiNetwork(); -#elif !CHIP_DEVICE_CONFIG_ENABLE_THREAD - enum class ConnectivityFlags : uint16_t - { +#endif + +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + enum class ConnectivityFlags : uint16_t{ kHaveIPv4InternetConnectivity = 0x0001, kHaveIPv6InternetConnectivity = 0x0002, kAwaitingConnectivity = 0x0010, @@ -110,7 +121,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, BitFlags mConnectivityFlag; #endif -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET ip4_addr_t m_ip4addr; ip6_addr_t m_ip6addr[LWIP_IPV6_NUM_ADDRESSES]; #endif diff --git a/src/platform/bouffalolab/common/Logging.cpp b/src/platform/bouffalolab/common/Logging.cpp index e008fcd022b331..b9ccf882c61165 100644 --- a/src/platform/bouffalolab/common/Logging.cpp +++ b/src/platform/bouffalolab/common/Logging.cpp @@ -18,6 +18,7 @@ #include +#include #include #include @@ -27,7 +28,9 @@ #include #include +#if CHIP_DEVICE_LAYER_TARGET_BL602 || CHIP_DEVICE_LAYER_TARGET_BL702 || CHIP_DEVICE_LAYER_TARGET_BL702L #include +#endif namespace chip { namespace Logging { @@ -37,8 +40,26 @@ static char formattedMsg[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE]; void LogV(const char * module, uint8_t category, const char * msg, va_list v) { #ifndef PW_RPC_ENABLED + int lmsg = 0; + vsnprintf(formattedMsg, sizeof(formattedMsg), msg, v); + lmsg = strlen(formattedMsg); + if (lmsg) + { + /** remove duplicate \r\n */ + if (lmsg >= 2 && formattedMsg[lmsg - 2] == '\r' && formattedMsg[lmsg - 1] == '\n') + { + lmsg -= 2; + } + else if (lmsg >= 1 && formattedMsg[lmsg - 1] == '\n') + { + lmsg -= 1; + } + + formattedMsg[lmsg] = '\0'; + } + switch (category) { case kLogCategory_Error: @@ -82,3 +103,28 @@ void LogV(const char * module, uint8_t category, const char * msg, va_list v) } // namespace Platform } // namespace Logging } // namespace chip + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +extern "C" void otPlatLog(int aLogLevel, int aLogRegion, const char * aFormat, ...) +{ + va_list v; + uint8_t category = chip::Logging::kLogCategory_Error; + + (void) aLogRegion; + + if (aLogLevel == 1 && aLogLevel == 2) + { + category = chip::Logging::kLogCategory_Error; + } + else + { + category = chip::Logging::kLogCategory_Progress; + } + + va_start(v, aFormat); + + chip::Logging::Platform::LogV("OTBR", category, aFormat, v); + + va_end(v); +} +#endif diff --git a/src/platform/bouffalolab/common/OTAImageProcessorImpl.cpp b/src/platform/bouffalolab/common/OTAImageProcessorImpl.cpp index 6e38bf0b5a77cd..0f70a2a33edc1e 100644 --- a/src/platform/bouffalolab/common/OTAImageProcessorImpl.cpp +++ b/src/platform/bouffalolab/common/OTAImageProcessorImpl.cpp @@ -18,12 +18,17 @@ #include #include -#include "OTAImageProcessorImpl.h" +#if CHIP_DEVICE_LAYER_TARGET_BL602 || CHIP_DEVICE_LAYER_TARGET_BL702 || CHIP_DEVICE_LAYER_TARGET_BL702L extern "C" { #include #include +#endif + +extern void hal_reboot(void); } +#include "OTAImageProcessorImpl.h" + using namespace chip::System; namespace chip { @@ -198,7 +203,6 @@ void OTAImageProcessorImpl::HandleProcessBlock(intptr_t context) ByteSpan block = imageProcessor->mBlock; if (imageProcessor->mHeaderParser.IsInitialized()) { - error = imageProcessor->mHeaderParser.AccumulateAndDecode(block, header); if (CHIP_ERROR_BUFFER_TOO_SMALL == error) { diff --git a/src/platform/bouffalolab/common/PlatformManagerImpl.cpp b/src/platform/bouffalolab/common/PlatformManagerImpl.cpp index f31ae77999db64..a346a1bbd7e1b8 100644 --- a/src/platform/bouffalolab/common/PlatformManagerImpl.cpp +++ b/src/platform/bouffalolab/common/PlatformManagerImpl.cpp @@ -50,5 +50,21 @@ void PlatformManagerImpl::_Shutdown() Internal::GenericPlatformManagerImpl_FreeRTOS::_Shutdown(); } + +CHIP_ERROR PlatformManagerImpl::_PostEvent(const ChipDeviceEvent * event) +{ + if (mChipEventQueue == NULL) + { + return CHIP_ERROR_INTERNAL; + } + BaseType_t status = xQueueSend(mChipEventQueue, event, 0); + if (status != pdTRUE) + { + ChipLogError(DeviceLayer, "Failed to post event to CHIP Platform event queue"); + return CHIP_ERROR(chip::ChipError::Range::kOS, status); + } + + return CHIP_NO_ERROR; +} } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/common/PlatformManagerImpl.h b/src/platform/bouffalolab/common/PlatformManagerImpl.h index 6acc7bf07c3c0c..59cc45848e2323 100644 --- a/src/platform/bouffalolab/common/PlatformManagerImpl.h +++ b/src/platform/bouffalolab/common/PlatformManagerImpl.h @@ -18,10 +18,11 @@ #pragma once -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI +#include + +#if CHIP_DEVICE_LAYER_TARGET_BL602 #include #endif -#include namespace chip { namespace DeviceLayer { @@ -58,10 +59,11 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener friend PlatformManager & PlatformMgr(void); friend PlatformManagerImpl & PlatformMgrImpl(void); friend class Internal::BLEManagerImpl; -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI +#if CHIP_DEVICE_LAYER_TARGET_BL602 && CHIP_DEVICE_CONFIG_ENABLE_WIFI friend void OnWiFiPlatformEvent(input_event_t * event, void * private_data); #endif + CHIP_ERROR _PostEvent(const ChipDeviceEvent * event); System::Clock::Timestamp mStartTime = System::Clock::kZero; static PlatformManagerImpl sInstance; @@ -86,7 +88,7 @@ inline PlatformManager & PlatformMgr(void) * Returns the platform-specific implementation of the PlatformManager singleton object. * * Chip applications can use this to gain access to features of the PlatformManager - * that are specific to the ESP32 platform. + * that are specific to the Bouffalo Lab platform. */ inline PlatformManagerImpl & PlatformMgrImpl(void) { diff --git a/src/platform/bouffalolab/common/SystemPlatformConfig.h b/src/platform/bouffalolab/common/SystemPlatformConfig.h index 4912f404626de3..80f21edc1fccfd 100644 --- a/src/platform/bouffalolab/common/SystemPlatformConfig.h +++ b/src/platform/bouffalolab/common/SystemPlatformConfig.h @@ -29,3 +29,6 @@ struct ChipDeviceEvent; #define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_EVENT_FUNCTIONS 1 #define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1 #define CHIP_SYSTEM_CONFIG_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent * + +//#define CHIP_CONFIG_SHA256_CONTEXT_SIZE sizeof(bl_sha_ctx_t) +#define CHIP_CONFIG_SHA256_CONTEXT_SIZE ((1 + 5 + 18 + 16 + 16) * sizeof(unsigned int)) diff --git a/src/platform/bouffalolab/common/args.gni b/src/platform/bouffalolab/common/args.gni index e15c3f95daf34a..48159fd3b6b4b9 100644 --- a/src/platform/bouffalolab/common/args.gni +++ b/src/platform/bouffalolab/common/args.gni @@ -15,4 +15,6 @@ declare_args() { chip_enable_factory_data = false chip_enable_factory_data_test = false + + chip_enable_ethernet = false } diff --git a/src/platform/device.gni b/src/platform/device.gni index bf243f26524839..8bfaee12b86a01 100644 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -86,10 +86,9 @@ declare_args() { if (chip_device_platform == "linux" || chip_device_platform == "esp32" || chip_device_platform == "mbed" || chip_device_platform == "psoc6" || chip_device_platform == "ameba" || chip_device_platform == "webos" || - chip_device_platform == "cc32xx" || chip_device_platform == "bl602" || - chip_device_platform == "mw320" || chip_device_platform == "beken" || - chip_device_platform == "mt793x" || chip_device_platform == "asr" || - chip_device_platform == "openiotsdk") { + chip_device_platform == "cc32xx" || chip_device_platform == "mw320" || + chip_device_platform == "beken" || chip_device_platform == "mt793x" || + chip_device_platform == "asr" || chip_device_platform == "openiotsdk") { chip_mdns = "minimal" } else if (chip_device_platform == "darwin" || chip_device_platform == "cc13x2_26x2" || @@ -116,14 +115,6 @@ declare_args() { chip_subscription_timeout_resumption = chip_persist_subscriptions } -if (chip_device_platform == "bl702" || chip_device_platform == "bl702l") { - if (chip_enable_openthread) { - chip_mdns = "platform" - } else { - chip_mdns = "minimal" - } -} - _chip_device_layer = "none" if (chip_device_platform == "cc13x2_26x2") { _chip_device_layer = "cc13xx_26xx/cc13x2_26x2" diff --git a/third_party/bouffalolab/bl602/bl_iot_sdk.gni b/third_party/bouffalolab/bl602/bl_iot_sdk.gni index be738a1820b508..3d649794d168a6 100644 --- a/third_party/bouffalolab/bl602/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl602/bl_iot_sdk.gni @@ -19,6 +19,9 @@ import("${chip_root}/src/lib/lib.gni") declare_args() { bl_iot_sdk_root = "${chip_root}/third_party/bouffalolab/repo" + + enable_debug_frame_ptr = false + debug_output_file = "" } assert(bl_iot_sdk_root != "", "bl_iot_sdk_root must be specified") @@ -39,12 +42,6 @@ template("bl_iot_sdk") { "BL602_USE_HAL_DRIVER=1", "CFG_CHIP_BL602", - - "MBEDTLS_CONFIG_FILE=\"bl602-chip-mbedtls-config.h\"", - - #dump backtrace - "CONF_ENABLE_FRAME_PTR=1", - "CONF_ENABLE_FUNC_BACKTRACE_ELF=out/bl602-light/chip-bl602-lighting-example.out", ] include_dirs = [] @@ -64,6 +61,11 @@ template("bl_iot_sdk") { "-include", rebase_path("${invoker.freertos_config}", root_build_dir), ] + + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + cflags = [ "-fno-omit-frame-pointer" ] + } } source_set("${sdk_target_name}_soc") { @@ -152,6 +154,15 @@ template("bl_iot_sdk") { source_set("${sdk_target_name}_bl602_freertos") { defines = [ "portasmHANDLE_INTERRUPT=interrupt_entry" ] + + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + defines += [ + "CONF_ENABLE_FRAME_PTR=1", + "CONF_ENABLE_FUNC_BACKTRACE_ELF=${invoker.debug_output_file}", + ] + } + include_dirs = [ "${bl_iot_sdk_root}/components/platform/soc/bl602/freertos_riscv_ram/portable/GCC/RISC-V/chip_specific_extensions/RV32F_float_abi_single" ] sources = [ @@ -522,7 +533,7 @@ template("bl_iot_sdk") { ] } - config("${sdk_target_name}_ble_config") { + config("${sdk_target_name}_config_ble") { include_dirs = [ "${bl_iot_sdk_root}/components/network/ble/blecontroller/ble_inc", "${bl_iot_sdk_root}/components/network/ble/blestack/src/include", @@ -613,7 +624,7 @@ template("bl_iot_sdk") { public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_hosal", - ":${sdk_target_name}_ble_config", + ":${sdk_target_name}_config_ble", ] cflags_c = [ @@ -849,9 +860,9 @@ template("bl_iot_sdk") { "MEMP_NUM_MLD6_GROUP=10", "PBUF_POOL_SIZE=20", "PBUF_POOL_BUFSIZE=1600", - "CONFIG_ENABLE_IPV6_ADDR_CALLBACK", - "CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT", - "CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT", + "MEMP_NUM_UDP_PCB=8", + "LWIP_NETIF_EXT_STATUS_CALLBACK", + "LWIP_HOOK_FILENAME=\"bl_route_hook.h\"", ] } diff --git a/third_party/bouffalolab/bl702/bl_iot_sdk.gni b/third_party/bouffalolab/bl702/bl_iot_sdk.gni index d6b5ac30fff066..832e2261f628ef 100644 --- a/third_party/bouffalolab/bl702/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl702/bl_iot_sdk.gni @@ -20,6 +20,9 @@ import("${chip_root}/src/lib/lib.gni") declare_args() { bl_iot_sdk_root = "${chip_root}/third_party/bouffalolab/repo" + + enable_debug_frame_ptr = true + debug_output_file = "" } assert(bl_iot_sdk_root != "", "bl_iot_sdk_root must be specified") @@ -58,6 +61,11 @@ template("bl_iot_sdk") { "-include", rebase_path("${invoker.freertos_config}", root_build_dir), ] + + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + cflags = [ "-fno-omit-frame-pointer" ] + } } config("${sdk_target_name}_config_soc") { @@ -161,6 +169,14 @@ template("bl_iot_sdk") { source_set("${sdk_target_name}_bl702_freertos") { defines = [ "portasmHANDLE_INTERRUPT=interrupt_entry" ] + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + defines += [ + "CONF_ENABLE_FRAME_PTR=1", + "CONF_ENABLE_FUNC_BACKTRACE_ELF=${invoker.debug_output_file}", + ] + } + include_dirs = [ "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_freertos/portable/GCC/RISC-V/chip_specific_extensions/RV32F_float_abi_single" ] sources = [ @@ -184,6 +200,14 @@ template("bl_iot_sdk") { "-Wno-old-style-declaration", ] + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + cflags_c += [ + "-Wno-incompatible-pointer-types", + "-Wno-int-conversion", + ] + } + public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_freertos", @@ -519,6 +543,7 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ctr_drbg.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ecdh.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ecdsa.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ecjpake.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ecp.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ecp_curves.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/entropy.c", @@ -535,6 +560,12 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/platform_util.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/sha256.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/sha512.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_ciphersuites.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_cli.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_cookie.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_msg.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_srv.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_tls.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/x509.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/x509_create.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/x509_crt.c", @@ -556,7 +587,7 @@ template("bl_iot_sdk") { ] } - config("${sdk_target_name}_ble_config") { + config("${sdk_target_name}_config_ble") { include_dirs = [ "${bl_iot_sdk_root}/components/network/ble/blecontroller/ble_inc", "${bl_iot_sdk_root}/components/network/ble/blestack/src/include", @@ -646,7 +677,7 @@ template("bl_iot_sdk") { ] public_configs = [ ":${sdk_target_name}_config", - ":${sdk_target_name}_ble_config", + ":${sdk_target_name}_config_ble", ] cflags_c = [ @@ -670,9 +701,6 @@ template("bl_iot_sdk") { "${chip_root}/third_party/openthread/repo/src/core", "${chip_root}/third_party/openthread/repo/examples/platforms", "${bl_iot_sdk_root}/components/network/thread/openthread_port/include", - ] - - include_dirs += [ "${bl_iot_sdk_root}/components/network/thread/openthread_utils/include", ] } @@ -692,7 +720,6 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_diag.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_entropy.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_linkmetric.c", - "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_logging.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_misc.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_radio.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_settings.c", @@ -802,7 +829,6 @@ template("bl_iot_sdk") { ] include_dirs += [ - "${bl_iot_sdk_root}/components/network/lwip/lwip-port/config", "${bl_iot_sdk_root}/components/network/lwip/src/include", "${bl_iot_sdk_root}/components/network/lwip/src/include/lwip/apps", "${bl_iot_sdk_root}/components/network/lwip/lwip-port", @@ -818,8 +844,9 @@ template("bl_iot_sdk") { "LWIP_IPV6_SCOPES=0", "PBUF_POOL_SIZE=20", "PBUF_POOL_BUFSIZE=1600", - "CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT", - "CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT", + "MEMP_NUM_UDP_PCB=8", + "LWIP_NETIF_EXT_STATUS_CALLBACK", + "LWIP_HOOK_FILENAME=\"bl_route_hook.h\"", ] } @@ -911,7 +938,6 @@ template("bl_iot_sdk") { ":${sdk_target_name}_BSP_Driver", ":${sdk_target_name}_bl702_freertos", ":${sdk_target_name}_ble", - ":${sdk_target_name}_ethernet", ":${sdk_target_name}_fs", ":${sdk_target_name}_hosal", ":${sdk_target_name}_libc", @@ -933,10 +959,6 @@ template("bl_iot_sdk") { public_deps += [ ":${sdk_target_name}_lwip" ] } - if (defined(invoker.enable_zigbee) && invoker.enable_zigbee) { - public_deps += [ ":${sdk_target_name}_zigbee" ] - } - if (defined(invoker.enable_cdc_module) && invoker.enable_cdc_module) { public_deps += [ ":${sdk_target_name}_bl702_usb_cdc" ] } diff --git a/third_party/bouffalolab/bl702l/bl_iot_sdk.gni b/third_party/bouffalolab/bl702l/bl_iot_sdk.gni index 89d35bc98bb1a5..391997f3a10ac3 100644 --- a/third_party/bouffalolab/bl702l/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl702l/bl_iot_sdk.gni @@ -22,6 +22,9 @@ import("${mbedtls_root}/mbedtls.gni") declare_args() { bl_iot_sdk_root = "${chip_root}/third_party/bouffalolab/repo" + + enable_debug_frame_ptr = true + debug_output_file = "" } assert(bl_iot_sdk_root != "", "bl_iot_sdk_root must be specified") @@ -60,6 +63,11 @@ template("bl_iot_sdk") { "-include", rebase_path("${invoker.freertos_config}", root_build_dir), ] + + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + cflags = [ "-fno-omit-frame-pointer" ] + } } config("${sdk_target_name}_config_soc") { @@ -137,6 +145,11 @@ template("bl_iot_sdk") { source_set("${sdk_target_name}_bl702l_rom_a0") { defines = [ "portasmHANDLE_INTERRUPT=interrupt_entry" ] + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + defines += [ "CONF_ENABLE_FRAME_PTR=1" ] + } + include_dirs = [ "${bl_iot_sdk_root}/components/platform/soc/bl702l/bl702l_std/BSP_Driver/regs" ] libs = [ "${bl_iot_sdk_root}/components/platform/soc/bl702l/bl702l_rom_a0/bl702l_rom_ext/lib/libbl702l_rom_ext.a" ] @@ -407,7 +420,7 @@ template("bl_iot_sdk") { ] } - config("${sdk_target_name}_ble_config") { + config("${sdk_target_name}_config_ble") { include_dirs = [ "${bl_iot_sdk_root}/components/network/ble/btblecontroller/btble_inc", "${bl_iot_sdk_root}/components/network/ble/blestack/src/include", @@ -518,7 +531,7 @@ template("bl_iot_sdk") { ] public_configs = [ ":${sdk_target_name}_config", - ":${sdk_target_name}_ble_config", + ":${sdk_target_name}_config_ble", ] cflags_c = [ @@ -564,7 +577,6 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_diag.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_entropy.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_linkmetric.c", - "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_logging.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_misc.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_radio.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_settings.c", diff --git a/third_party/bouffalolab/common/bouffalolab_executable.gni b/third_party/bouffalolab/common/bouffalolab_executable.gni index 6e0684ea757d18..7410067891fcb4 100644 --- a/third_party/bouffalolab/common/bouffalolab_executable.gni +++ b/third_party/bouffalolab/common/bouffalolab_executable.gni @@ -39,12 +39,12 @@ template("bouffalolab_executable") { flashing_script_inputs = [ "${chip_root}/scripts/flashing/bouffalolab_firmware_utils.py", "${chip_root}/scripts/flashing/firmware_utils.py", - - "${chip_root}/examples/platform/bouffalolab/${invoker.bl_plat_name}/flash_config/partition_cfg_2M.toml", ] if (invoker.bl_plat_name == "bl602") { flashing_script_inputs += [ "${chip_root}/examples/platform/bouffalolab/${invoker.bl_plat_name}/flash_config/partition_cfg_4M.toml" ] + } else { + flashing_script_inputs += [ "${chip_root}/examples/platform/bouffalolab/${invoker.bl_plat_name}/flash_config/partition_cfg_2M.toml" ] } copy(flashing_runtime_target) { @@ -68,13 +68,17 @@ template("bouffalolab_executable") { } flashing_options += [ "--pt" ] - if (invoker.board == "BL602-IOT-DVK-3S" || invoker.bl_plat_name == "bl702" || - invoker.bl_plat_name == "bl702l") { + if (invoker.bl_plat_name == "bl602") { flashing_options += - [ rebase_path("partition_cfg_2M.toml", root_out_dir, root_out_dir) ] + [ rebase_path("partition_cfg_4M.toml", root_out_dir, root_out_dir) ] + } else if (defined(invoker.enable_openthread_border_router) && + invoker.enable_openthread_border_router) { + flashing_options += [ rebase_path("partition_cfg_2M_noOTA.toml", + root_out_dir, + root_out_dir) ] } else { flashing_options += - [ rebase_path("partition_cfg_4M.toml", root_out_dir, root_out_dir) ] + [ rebase_path("partition_cfg_2M.toml", root_out_dir, root_out_dir) ] } flashing_options += [ "--ota" ] diff --git a/third_party/bouffalolab/common/rsicv.gni b/third_party/bouffalolab/common/rsicv.gni index dc75aaa22232d6..7d056d5a311088 100644 --- a/third_party/bouffalolab/common/rsicv.gni +++ b/third_party/bouffalolab/common/rsicv.gni @@ -12,6 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build_overrides/chip.gni") + +import("${chip_root}/src/platform/device.gni") + riscv_arch = "rv32imfc" riscv_abi = "ilp32f" # riscv_cpu = ""