diff --git a/examples/lighting-app/efr32/src/main.cpp b/examples/lighting-app/efr32/src/main.cpp index a8afe74ad76e3e..624319983a87d5 100644 --- a/examples/lighting-app/efr32/src/main.cpp +++ b/examples/lighting-app/efr32/src/main.cpp @@ -115,9 +115,6 @@ int main(void) MemMonitoring::startHeapMonitoring(); #endif - // Initialize mbedtls threading support on EFR32 - THREADING_setup(); - EFR32_LOG("=================================================="); EFR32_LOG("chip-efr32-lighting-example starting"); EFR32_LOG("=================================================="); diff --git a/examples/lock-app/efr32/src/main.cpp b/examples/lock-app/efr32/src/main.cpp index f09e0c0ed13ab3..df26beda91a6f3 100644 --- a/examples/lock-app/efr32/src/main.cpp +++ b/examples/lock-app/efr32/src/main.cpp @@ -99,9 +99,6 @@ int main(void) init_efrPlatform(); mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); - // Initialize mbedtls threading support on EFR32 - THREADING_setup(); - EFR32_LOG("=================================================="); EFR32_LOG("chip-efr32-lock-example starting"); EFR32_LOG("=================================================="); diff --git a/examples/shell/efr32/src/main.cpp b/examples/shell/efr32/src/main.cpp index 4d5295daf85721..5357856a96ed07 100644 --- a/examples/shell/efr32/src/main.cpp +++ b/examples/shell/efr32/src/main.cpp @@ -114,9 +114,6 @@ int main(void) MemMonitoring::startHeapMonitoring(); #endif - // Initialize mbedtls threading support on EFR32 - THREADING_setup(); - EFR32_LOG("=================================================="); EFR32_LOG("chip-efr32-shell-example starting"); EFR32_LOG("=================================================="); diff --git a/examples/window-app/efr32/src/main.cpp b/examples/window-app/efr32/src/main.cpp index 076f18a31f00d6..0309c06afdf3c4 100644 --- a/examples/window-app/efr32/src/main.cpp +++ b/examples/window-app/efr32/src/main.cpp @@ -108,9 +108,6 @@ int main(void) mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); - // Initialize mbedtls threading support on EFR32 - THREADING_setup(); - EFR32_LOG("=================================================="); EFR32_LOG("chip-efr32-window-cover-example starting"); EFR32_LOG("=================================================="); diff --git a/src/platform/EFR32/BLEManagerImpl.cpp b/src/platform/EFR32/BLEManagerImpl.cpp index 1d057b3bbe758c..67c968b9f9451f 100644 --- a/src/platform/EFR32/BLEManagerImpl.cpp +++ b/src/platform/EFR32/BLEManagerImpl.cpp @@ -29,6 +29,7 @@ #include #include "FreeRTOS.h" +#include "rail.h" #include "sl_bt_api.h" #include "sl_bt_stack_config.h" #include "sl_bt_stack_init.h" @@ -37,7 +38,6 @@ #include #include #include - using namespace ::chip; using namespace ::chip::Ble; @@ -117,6 +117,10 @@ BLEManagerImpl BLEManagerImpl::sInstance; ******************************************************************************/ extern "C" sl_status_t initialize_bluetooth() { +#if !defined(SL_CATALOG_KERNEL_PRESENT) + NVIC_ClearPendingIRQ(PendSV_IRQn); + NVIC_EnableIRQ(PendSV_IRQn); +#endif sl_status_t ret = sl_bt_init_stack(&config); sl_bt_init_classes(bt_class_table); sl_bt_init_multiprotocol(); @@ -131,7 +135,7 @@ static void initBleConfig(void) config.bluetooth.max_advertisers = BLE_MAX_ADVERTISERS; config.bluetooth.max_periodic_sync = BLE_CONFIG_MAX_PERIODIC_ADVERTISING_SYNC; config.bluetooth.max_buffer_memory = BLE_MAX_BUFFER_SIZE; - config.gattdb = &bg_gattdb_data; /* Pointer to GATT database */ + config.gattdb = &gattdb; /* Pointer to GATT database */ config.scheduler_callback = BluetoothLLCallback; config.stack_schedule_callback = BluetoothUpdate; config.max_timers = BLE_CONFIG_MAX_SOFTWARE_TIMERS; @@ -236,10 +240,15 @@ void BLEManagerImpl::bluetoothStackEventHandler(void * p_arg) switch (SL_BT_MSG_ID(bluetooth_evt->header)) { case sl_bt_evt_system_boot_id: { - ChipLogProgress(DeviceLayer, "Bluetooth stack booted: v%d.%d.%d-b%d\n", bluetooth_evt->data.evt_system_boot.major, + ChipLogProgress(DeviceLayer, "Bluetooth stack booted: v%d.%d.%d-b%d", bluetooth_evt->data.evt_system_boot.major, bluetooth_evt->data.evt_system_boot.minor, bluetooth_evt->data.evt_system_boot.patch, bluetooth_evt->data.evt_system_boot.build); sInstance.HandleBootEvent(); + + RAIL_Version_t railVer; + RAIL_GetVersion(&railVer, true); + ChipLogProgress(DeviceLayer, "RAIL version:, v%d.%d.%d-b%d", railVer.major, railVer.minor, railVer.rev, + railVer.build); } break; @@ -741,6 +750,7 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) err = MapBLEError(ret); SuccessOrExit(err); + sl_bt_advertiser_set_configuration(advertising_set_handle, 1); ret = sl_bt_advertiser_start(advertising_set_handle, sl_bt_advertiser_user_data, connectableAdv); if (SL_STATUS_OK == ret) diff --git a/src/platform/EFR32/efr32-chip-mbedtls-config.h b/src/platform/EFR32/efr32-chip-mbedtls-config.h index 36194b552e1afe..cdf11515823400 100644 --- a/src/platform/EFR32/efr32-chip-mbedtls-config.h +++ b/src/platform/EFR32/efr32-chip-mbedtls-config.h @@ -36,13 +36,6 @@ #include "em_se.h" #include "sl_malloc.h" -/** - * Enable FreeRTOS threading support - */ -#define MBEDTLS_FREERTOS -#define MBEDTLS_THREADING_C -#define MBEDTLS_THREADING_ALT - #define SL_CATALOG_FREERTOS_KERNEL_PRESENT /** @@ -53,13 +46,8 @@ #define MBEDTLS_ECDH_C #define MBEDTLS_ENTROPY_C #define MBEDTLS_SHA256_C -#define MBEDTLS_CIPHER_MODE_CTR #define MBEDTLS_TRNG_C -#if defined(MBEDTLS_ECP_ALT) && !defined(MBEDTLS_ECP_RESTARTABLE) -typedef void mbedtls_ecp_restart_ctx; -#endif - #define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf #define MBEDTLS_AES_ROM_TABLES @@ -69,8 +57,6 @@ typedef void mbedtls_ecp_restart_ctx; #define MBEDTLS_BIGNUM_C #define MBEDTLS_CCM_C #define MBEDTLS_CIPHER_C -#define MBEDTLS_CIPHER_MODE_CBC -#define MBEDTLS_CIPHER_MODE_CFB #define MBEDTLS_CMAC_C #define MBEDTLS_CTR_DRBG_C #define MBEDTLS_ECDH_LEGACY_CONTEXT @@ -103,7 +89,6 @@ typedef void mbedtls_ecp_restart_ctx; #define MBEDTLS_PSA_CRYPTO_C #define MBEDTLS_PSA_CRYPTO_CONFIG #define MBEDTLS_PSA_CRYPTO_DRIVERS -#define MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS #define MBEDTLS_PSA_CRYPTO_STORAGE_C #define MBEDTLS_SHA256_SMALLER #define MBEDTLS_SHA512_C @@ -143,5 +128,9 @@ typedef void mbedtls_ecp_restart_ctx; #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 +#define MBEDTLS_CIPHER_MODE_WITH_PADDING + +#include "check_crypto_config.h" #include "config-device-acceleration.h" #include "mbedtls/check_config.h" +#include "mbedtls/config_psa.h" diff --git a/src/platform/EFR32/efr32-mbedtls-psa-crypto-config.h b/src/platform/EFR32/efr32-mbedtls-psa-crypto-config.h new file mode 100644 index 00000000000000..92f831d68744f0 --- /dev/null +++ b/src/platform/EFR32/efr32-mbedtls-psa-crypto-config.h @@ -0,0 +1,66 @@ +/* + * + * Copyright (c) 2020-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 + +// ADD USER PSA CRYPTO CONFIG HERE +#define SL_PSA_KEY_USER_SLOT_COUNT (4) + +#define SL_PSA_ITS_USER_MAX_FILES (128) +// end of user configuration section >>> + +// AUTO GENERATED PSA CONFIG SECTION BELOW. **KEEP AS IS FUTURE GSDK UPDATE** +#define PSA_WANT_KEY_TYPE_AES +#define PSA_WANT_ALG_CMAC +#define MBEDTLS_PSA_BUILTIN_ALG_CMAC 1 +#define PSA_WANT_ALG_SHA_224 +#define PSA_WANT_ALG_SHA_256 +#define PSA_WANT_ALG_CCM +#define PSA_WANT_ALG_CBC_NO_PADDING +#define PSA_WANT_ALG_ECB_NO_PADDING +#define PSA_WANT_ALG_ECDSA +#define PSA_WANT_ALG_ECDH +#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR +#define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY +#define PSA_WANT_ECC_SECP_R1_256 +#define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_PUBLIC_KEY 1 +#define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR 1 +#define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_256 1 +#define MBEDTLS_PSA_BUILTIN_ALG_ECDH 1 +#define MBEDTLS_PSA_BUILTIN_ALG_ECDSA 1 +#define PSA_WANT_ALG_HKDF +#define PSA_WANT_ALG_HMAC +#define PSA_WANT_KEY_TYPE_HMAC +#define MBEDTLS_PSA_BUILTIN_ALG_HMAC 1 +#define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG +#define MBEDTLS_PSA_ACCEL_ALG_SHA_1 +#define MBEDTLS_PSA_ACCEL_ALG_SHA_224 +#define MBEDTLS_PSA_ACCEL_ALG_SHA_256 +#define MBEDTLS_PSA_ACCEL_KEY_TYPE_AES +#define MBEDTLS_PSA_ACCEL_ALG_ECB_NO_PADDING +#define MBEDTLS_PSA_ACCEL_ALG_CBC_NO_PADDING +#define MBEDTLS_PSA_ACCEL_ALG_CBC_PKCS7 +#define MBEDTLS_PSA_ACCEL_ALG_CTR +#define MBEDTLS_PSA_ACCEL_ALG_CFB +#define MBEDTLS_PSA_ACCEL_ALG_OFB +#define MBEDTLS_PSA_ACCEL_ALG_GCM +#define MBEDTLS_PSA_ACCEL_ALG_CCM +#define MBEDTLS_PSA_ACCEL_ALG_CMAC + +#define MBEDTLS_PSA_KEY_SLOT_COUNT (15 + 1 + SL_PSA_KEY_USER_SLOT_COUNT) +#define SL_PSA_ITS_MAX_FILES (1 + SL_PSA_ITS_USER_MAX_FILES) diff --git a/src/platform/EFR32/freertos_bluetooth.c b/src/platform/EFR32/freertos_bluetooth.c index d65b937e1716dc..79562021149448 100644 --- a/src/platform/EFR32/freertos_bluetooth.c +++ b/src/platform/EFR32/freertos_bluetooth.c @@ -142,6 +142,8 @@ void BluetoothTask(void * p) vRaiseEventFlagBasedOnContext(bluetooth_event_flags, BLUETOOTH_EVENT_FLAG_RSP_WAITING); } + // Run Bluetooth stack. Pop the next event for application + sl_bt_run(); // Bluetooth stack needs updating, and evt can be used if (sl_bt_event_pending() && (flags & BLUETOOTH_EVENT_FLAG_EVT_HANDLED)) { // update bluetooth & read event diff --git a/src/platform/EFR32/gatt_db.c b/src/platform/EFR32/gatt_db.c index 6a4d4977a3a8f1..4b58ed9091743d 100644 --- a/src/platform/EFR32/gatt_db.c +++ b/src/platform/EFR32/gatt_db.c @@ -20,360 +20,382 @@ * Autogenerated file, do not edit. *******************************************************************/ -#include "bg_gattdb_def.h" - +#include "sli_bt_gattdb_def.h" #include #define GATT_HEADER(F) F #define GATT_DATA(F) F -GATT_DATA(const uint16_t bg_gattdb_data_uuidtable_16_map[]) = { - 0x2800, 0x2801, 0x2803, 0x1800, 0x2a00, 0x2a01, 0x180a, 0x2a29, 0x2a24, 0x2a23, 0xfff6, 0x1801, 0x2a05, 0x2b2a, 0x2b29, 0x2902, +GATT_DATA(const uint16_t gattdb_uuidtable_16_map[]) = { + 0x2800, 0x2801, 0x2803, 0x2a00, 0x2a01, 0x2a29, 0x2a24, 0x2a23, 0x2a05, 0x2b2a, 0x2b29, 0x2902, }; -GATT_DATA(const uint8_t bg_gattdb_data_uuidtable_128_map[]) = { - 0xf0, 0x19, 0x21, 0xb4, 0x47, 0x8f, 0xa4, 0xbf, 0xa1, 0x4f, 0x63, 0xfd, 0xee, 0xd6, 0x14, 0x1d, - 0x63, 0x60, 0x32, 0xe0, 0x37, 0x5e, 0xa4, 0x88, 0x53, 0x4e, 0x6d, 0xfb, 0x64, 0x35, 0xbf, 0xf7, +GATT_DATA(const uint8_t gattdb_uuidtable_128_map[]) = { 0x11, 0x9d, 0x9f, 0x42, 0x9c, 0x4f, 0x9f, 0x95, 0x59, 0x45, 0x3d, 0x26, 0xf5, 0x2e, 0xee, 0x18, 0x12, 0x9d, 0x9f, 0x42, 0x9c, 0x4f, 0x9f, 0x95, 0x59, 0x45, 0x3d, 0x26, 0xf5, 0x2e, 0xee, 0x18, + 0x63, 0x60, 0x32, 0xe0, 0x37, 0x5e, 0xa4, 0x88, 0x53, 0x4e, 0x6d, 0xfb, 0x64, 0x35, 0xbf, 0xf7, }; - -struct bg_gattdb_buffer_with_len - bg_gattdb_data_attribute_field_27_data = { .len = 1, - .data = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - } }; -GATT_DATA(const struct bg_gattdb_attribute_chrvalue bg_gattdb_data_attribute_field_27) = { - .properties = 0x2e, - .index = 6, - .max_len = 247, - .data_varlen = &bg_gattdb_data_attribute_field_27_data, -}; - -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_26) = { .len = 19, - .data = { - 0x2e, 0x1c, 0x00, 0x12, 0x9d, - 0x9f, 0x42, 0x9c, 0x4f, 0x9f, - 0x95, 0x59, 0x45, 0x3d, 0x26, - 0xf5, 0x2e, 0xee, 0x18, - } }; -struct bg_gattdb_buffer_with_len - bg_gattdb_data_attribute_field_25_data = { .len = 1, - .data = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - } }; -GATT_DATA(const struct bg_gattdb_attribute_chrvalue bg_gattdb_data_attribute_field_25) = { - .properties = 0x0a, - .index = 5, - .max_len = 247, - .data_varlen = &bg_gattdb_data_attribute_field_25_data, -}; - -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_24) = { .len = 19, - .data = { - 0x0a, 0x1a, 0x00, 0x11, 0x9d, - 0x9f, 0x42, 0x9c, 0x4f, 0x9f, - 0x95, 0x59, 0x45, 0x3d, 0x26, - 0xf5, 0x2e, 0xee, 0x18, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_23) = { .len = 2, - .data = { - 0xf6, - 0xff, - } }; -GATT_DATA(const struct bg_gattdb_attribute_chrvalue bg_gattdb_data_attribute_field_22) = { - .properties = 0x08, - .index = 4, - .max_len = 0, - .data = NULL, -}; - -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_21) = { .len = 19, - .data = { - 0x08, 0x17, 0x00, 0x63, 0x60, - 0x32, 0xe0, 0x37, 0x5e, 0xa4, - 0x88, 0x53, 0x4e, 0x6d, 0xfb, - 0x64, 0x35, 0xbf, 0xf7, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_20) = { .len = 16, - .data = { - 0xf0, - 0x19, - 0x21, - 0xb4, - 0x47, - 0x8f, - 0xa4, - 0xbf, - 0xa1, - 0x4f, - 0x63, - 0xfd, - 0xee, - 0xd6, - 0x14, - 0x1d, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_19) = { .len = 6, - .data = { - 0x00, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_18) = { .len = 5, - .data = { - 0x02, - 0x14, - 0x00, - 0x23, - 0x2a, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_17) = { .len = 10, - .data = { - 0x42, - 0x6c, - 0x75, - 0x65, - 0x20, - 0x47, - 0x65, - 0x63, - 0x6b, - 0x6f, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_16) = { .len = 5, - .data = { - 0x02, - 0x12, - 0x00, - 0x24, - 0x2a, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_15) = { .len = 12, - .data = { - 0x53, - 0x69, - 0x6c, - 0x69, - 0x63, - 0x6f, - 0x6e, - 0x20, - 0x4c, - 0x61, - 0x62, - 0x73, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_14) = { .len = 5, - .data = { - 0x02, - 0x10, - 0x00, - 0x29, - 0x2a, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_13) = { .len = 2, - .data = { - 0x0a, - 0x18, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_12) = { .len = 2, - .data = { - 0x00, - 0x00, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_11) = { .len = 5, - .data = { - 0x02, - 0x0d, - 0x00, - 0x01, - 0x2a, - } }; -uint8_t bg_gattdb_data_attribute_field_10_data[13] = { - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, -}; -GATT_DATA(const struct bg_gattdb_attribute_chrvalue bg_gattdb_data_attribute_field_10) = { - .properties = 0x0a, - .index = 3, - .max_len = 13, - .data = bg_gattdb_data_attribute_field_10_data, -}; - -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_9) = { .len = 5, - .data = { - 0x0a, - 0x0b, - 0x00, - 0x00, - 0x2a, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_8) = { .len = 2, - .data = { - 0x00, - 0x18, - } }; -uint8_t bg_gattdb_data_attribute_field_7_data[1] = { - 0x00, -}; -GATT_DATA(const struct bg_gattdb_attribute_chrvalue bg_gattdb_data_attribute_field_7) = { - .properties = 0x0a, - .index = 2, - .max_len = 1, - .data = bg_gattdb_data_attribute_field_7_data, -}; - -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_6) = { .len = 5, - .data = { - 0x0a, - 0x08, - 0x00, - 0x29, - 0x2b, - } }; -uint8_t bg_gattdb_data_attribute_field_5_data[16] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_26) = { .len = 16, + .data = { + 0xf0, + 0x19, + 0x21, + 0xb4, + 0x47, + 0x8f, + 0xa4, + 0xbf, + 0xa1, + 0x4f, + 0x63, + 0xfd, + 0xee, + 0xd6, + 0x14, + 0x1d, + } }; +GATT_DATA(sli_bt_gattdb_attribute_chrvalue_t + gattdb_attribute_field_24) = { .properties = 0x2e, + .max_len = 247, + .len = 1, + .data = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + } }; +GATT_DATA(sli_bt_gattdb_attribute_chrvalue_t + gattdb_attribute_field_22) = { .properties = 0x0a, + .max_len = 247, + .len = 1, + .data = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + } }; +GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_20) = { .len = 2, + .data = { + 0xf6, + 0xff, + } }; +GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_19) = { .len = 6, + .data = { + 0x00, + 0x01, + 0x02, + 0x03, + 0x04, + 0x05, + } }; +GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_17) = { .len = 10, + .data = { + 0x42, + 0x6c, + 0x75, + 0x65, + 0x20, + 0x47, + 0x65, + 0x63, + 0x6b, + 0x6f, + } }; +GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_15) = { .len = 12, + .data = { + 0x53, + 0x69, + 0x6c, + 0x69, + 0x63, + 0x6f, + 0x6e, + 0x20, + 0x4c, + 0x61, + 0x62, + 0x73, + } }; +GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_13) = { .len = 2, + .data = { + 0x0a, + 0x18, + } }; +GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_12) = { .len = 2, + .data = { + 0x00, + 0x00, + } }; +GATT_DATA(sli_bt_gattdb_attribute_chrvalue_t gattdb_attribute_field_10) = { + .properties = 0x0a, + .max_len = 13, + .data = { 0x45, 0x6d, 0x70, 0x74, 0x79, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, }, }; -GATT_DATA(const struct bg_gattdb_attribute_chrvalue bg_gattdb_data_attribute_field_5) = { - .properties = 0x02, - .index = 1, - .max_len = 16, - .data = bg_gattdb_data_attribute_field_5_data, +GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_8) = { .len = 2, + .data = { + 0x00, + 0x18, + } }; +GATT_DATA(sli_bt_gattdb_attribute_chrvalue_t gattdb_attribute_field_7) = { + .properties = 0x0a, + .max_len = 1, + .data = { 0x00, }, }; - -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_4) = { .len = 5, - .data = { - 0x02, - 0x06, - 0x00, - 0x2a, - 0x2b, - } }; -uint8_t bg_gattdb_data_attribute_field_2_data[4] = { - 0x00, - 0x00, - 0x00, - 0x00, +GATT_DATA(sli_bt_gattdb_attribute_chrvalue_t gattdb_attribute_field_5) = { + .properties = 0x02, + .max_len = 16, + .data = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, }; -GATT_DATA(const struct bg_gattdb_attribute_chrvalue bg_gattdb_data_attribute_field_2) = { - .properties = 0x20, - .index = 0, - .max_len = 4, - .data = bg_gattdb_data_attribute_field_2_data, +GATT_DATA(sli_bt_gattdb_attribute_chrvalue_t gattdb_attribute_field_2) = { + .properties = 0x20, + .max_len = 4, + .data = { 0x00, 0x00, 0x00, 0x00, }, }; +GATT_DATA(const sli_bt_gattdb_value_t gattdb_attribute_field_0) = { .len = 2, + .data = { + 0x01, + 0x18, + } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_1) = { .len = 5, - .data = { - 0x20, - 0x03, - 0x00, - 0x05, - 0x2a, - } }; -GATT_DATA(const struct bg_gattdb_buffer_with_len bg_gattdb_data_attribute_field_0) = { .len = 2, - .data = { - 0x01, - 0x18, - } }; -GATT_DATA(const struct bg_gattdb_attribute bg_gattdb_data_attributes_map[]) = { - { .uuid = 0x0000, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_0 }, - { .uuid = 0x0002, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_1 }, - { .uuid = 0x000c, .permissions = 0x800, .caps = 0xffff, .datatype = 0x01, .dynamicdata = &bg_gattdb_data_attribute_field_2 }, - { .uuid = 0x000f, - .permissions = 0x807, +GATT_DATA(const sli_bt_gattdb_attribute_t gattdb_attributes_map[]) = { + { .handle = 0x01, + .uuid = 0x0000, + .permissions = 0x801, .caps = 0xffff, + .state = 0x00, + .datatype = 0x00, + .constdata = &gattdb_attribute_field_0 }, + { .handle = 0x02, + .uuid = 0x0002, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x05, + .characteristic = { .properties = 0x20, .char_uuid = 0x0008 } }, + { .handle = 0x03, + .uuid = 0x0008, + .permissions = 0x800, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x01, + .dynamicdata = &gattdb_attribute_field_2 }, + { .handle = 0x04, + .uuid = 0x000b, + .permissions = 0x803, + .caps = 0xffff, + .state = 0x00, .datatype = 0x03, - .configdata = { .flags = 0x02, .index = 0x00, .clientconfig_index = 0x00 } }, - { .uuid = 0x0002, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_4 }, - { .uuid = 0x000d, .permissions = 0x801, .caps = 0xffff, .datatype = 0x01, .dynamicdata = &bg_gattdb_data_attribute_field_5 }, - { .uuid = 0x0002, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_6 }, - { .uuid = 0x000e, .permissions = 0x803, .caps = 0xffff, .datatype = 0x01, .dynamicdata = &bg_gattdb_data_attribute_field_7 }, - { .uuid = 0x0000, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_8 }, - { .uuid = 0x0002, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_9 }, - { .uuid = 0x0004, .permissions = 0x803, .caps = 0xffff, .datatype = 0x01, .dynamicdata = &bg_gattdb_data_attribute_field_10 }, - { .uuid = 0x0002, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_11 }, - { .uuid = 0x0005, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_12 }, - { .uuid = 0x0000, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_13 }, - { .uuid = 0x0002, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_14 }, - { .uuid = 0x0007, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_15 }, - { .uuid = 0x0002, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_16 }, - { .uuid = 0x0008, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_17 }, - { .uuid = 0x0002, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_18 }, - { .uuid = 0x0009, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_19 }, - { .uuid = 0x0000, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_20 }, - { .uuid = 0x0002, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_21 }, - { .uuid = 0x8001, .permissions = 0x802, .caps = 0xffff, .datatype = 0x07, .dynamicdata = &bg_gattdb_data_attribute_field_22 }, - { .uuid = 0x0000, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_23 }, - { .uuid = 0x0002, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_24 }, - { .uuid = 0x8002, .permissions = 0x803, .caps = 0xffff, .datatype = 0x02, .dynamicdata = &bg_gattdb_data_attribute_field_25 }, - { .uuid = 0x0002, .permissions = 0x801, .caps = 0xffff, .datatype = 0x00, .constdata = &bg_gattdb_data_attribute_field_26 }, - { .uuid = 0x8003, .permissions = 0x807, .caps = 0xffff, .datatype = 0x02, .dynamicdata = &bg_gattdb_data_attribute_field_27 }, - { .uuid = 0x000f, + .configdata = { .flags = 0x02, .clientconfig_index = 0x00 } }, + { .handle = 0x05, + .uuid = 0x0002, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x05, + .characteristic = { .properties = 0x02, .char_uuid = 0x0009 } }, + { .handle = 0x06, + .uuid = 0x0009, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x01, + .dynamicdata = &gattdb_attribute_field_5 }, + { .handle = 0x07, + .uuid = 0x0002, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x05, + .characteristic = { .properties = 0x0a, .char_uuid = 0x000a } }, + { .handle = 0x08, + .uuid = 0x000a, + .permissions = 0x803, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x01, + .dynamicdata = &gattdb_attribute_field_7 }, + { .handle = 0x09, + .uuid = 0x0000, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x00, + .constdata = &gattdb_attribute_field_8 }, + { .handle = 0x0a, + .uuid = 0x0002, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x05, + .characteristic = { .properties = 0x0a, .char_uuid = 0x0003 } }, + { .handle = 0x0b, + .uuid = 0x0003, + .permissions = 0x803, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x01, + .dynamicdata = &gattdb_attribute_field_10 }, + { .handle = 0x0c, + .uuid = 0x0002, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x05, + .characteristic = { .properties = 0x02, .char_uuid = 0x0004 } }, + { .handle = 0x0d, + .uuid = 0x0004, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x00, + .constdata = &gattdb_attribute_field_12 }, + { .handle = 0x0e, + .uuid = 0x0000, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x00, + .constdata = &gattdb_attribute_field_13 }, + { .handle = 0x0f, + .uuid = 0x0002, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x05, + .characteristic = { .properties = 0x02, .char_uuid = 0x0005 } }, + { .handle = 0x10, + .uuid = 0x0005, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x00, + .constdata = &gattdb_attribute_field_15 }, + { .handle = 0x11, + .uuid = 0x0002, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x05, + .characteristic = { .properties = 0x02, .char_uuid = 0x0006 } }, + { .handle = 0x12, + .uuid = 0x0006, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x00, + .constdata = &gattdb_attribute_field_17 }, + { .handle = 0x13, + .uuid = 0x0002, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x05, + .characteristic = { .properties = 0x02, .char_uuid = 0x0007 } }, + { .handle = 0x14, + .uuid = 0x0007, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x00, + .constdata = &gattdb_attribute_field_19 }, + { .handle = 0x15, + .uuid = 0x0000, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x00, + .constdata = &gattdb_attribute_field_20 }, + { .handle = 0x16, + .uuid = 0x0002, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x05, + .characteristic = { .properties = 0x0a, .char_uuid = 0x8000 } }, + { .handle = 0x17, + .uuid = 0x8000, + .permissions = 0x803, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x02, + .dynamicdata = &gattdb_attribute_field_22 }, + { .handle = 0x18, + .uuid = 0x0002, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x05, + .characteristic = { .properties = 0x2e, .char_uuid = 0x8001 } }, + { .handle = 0x19, + .uuid = 0x8001, .permissions = 0x807, .caps = 0xffff, + .state = 0x00, + .datatype = 0x02, + .dynamicdata = &gattdb_attribute_field_24 }, + { .handle = 0x1a, + .uuid = 0x000b, + .permissions = 0x803, + .caps = 0xffff, + .state = 0x00, .datatype = 0x03, - .configdata = { .flags = 0x02, .index = 0x06, .clientconfig_index = 0x01 } }, -}; - -GATT_DATA(const uint16_t bg_gattdb_data_attributes_dynamic_mapping_map[]) = { - 0x0003, 0x0006, 0x0008, 0x000b, 0x0017, 0x001a, 0x001c, + .configdata = { .flags = 0x02, .clientconfig_index = 0x01 } }, + { .handle = 0x1b, + .uuid = 0x0000, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x00, + .constdata = &gattdb_attribute_field_26 }, + { .handle = 0x1c, + .uuid = 0x0002, + .permissions = 0x801, + .caps = 0xffff, + .state = 0x00, + .datatype = 0x05, + .characteristic = { .properties = 0x08, .char_uuid = 0x8002 } }, + { .handle = 0x1d, .uuid = 0x8002, .permissions = 0x802, .caps = 0xffff, .state = 0x00, .datatype = 0x07, .dynamicdata = NULL }, }; -GATT_DATA(const uint8_t bg_gattdb_data_adv_uuid16_map[]) = { 0x0 }; -GATT_DATA(const uint8_t bg_gattdb_data_adv_uuid128_map[]) = { 0x0 }; -GATT_HEADER(const struct bg_gattdb_def bg_gattdb_data) = { - .attributes = bg_gattdb_data_attributes_map, - .attributes_max = 29, - .uuidtable_16_size = 16, - .uuidtable_16 = bg_gattdb_data_uuidtable_16_map, - .uuidtable_128_size = 4, - .uuidtable_128 = bg_gattdb_data_uuidtable_128_map, - .attributes_dynamic_max = 7, - .attributes_dynamic_mapping = bg_gattdb_data_attributes_dynamic_mapping_map, - .adv_uuid16 = bg_gattdb_data_adv_uuid16_map, - .adv_uuid16_num = 0, - .adv_uuid128 = bg_gattdb_data_adv_uuid128_map, - .adv_uuid128_num = 0, - .caps_mask = 0xffff, - .enabled_caps = 0xffff, +GATT_HEADER(const sli_bt_gattdb_t gattdb) = { + .attributes = gattdb_attributes_map, + .attribute_table_size = 29, + .attribute_num = 29, + .uuid16 = gattdb_uuidtable_16_map, + .uuid16_table_size = 12, + .uuid16_num = 12, + .uuid128 = gattdb_uuidtable_128_map, + .uuid128_table_size = 3, + .uuid128_num = 3, + .num_ccfg = 2, + .caps_mask = 0xffff, + .enabled_caps = 0xffff, }; - -const struct bg_gattdb_def * bg_gattdb = &bg_gattdb_data; +const sli_bt_gattdb_t * static_gattdb = &gattdb; diff --git a/src/platform/EFR32/gatt_db.h b/src/platform/EFR32/gatt_db.h index 1007bbe901fc3a..209434ff795fac 100644 --- a/src/platform/EFR32/gatt_db.h +++ b/src/platform/EFR32/gatt_db.h @@ -16,6 +16,10 @@ * limitations under the License. */ +/******************************************************************** + * Autogenerated file, do not edit. + *******************************************************************/ + #ifndef __GATT_DB_H #define __GATT_DB_H @@ -23,20 +27,20 @@ extern "C" { #endif -#include "bg_gattdb_def.h" +#include "sli_bt_gattdb_def.h" -extern const struct bg_gattdb_def bg_gattdb_data; +extern const sli_bt_gattdb_t gattdb; #define gattdb_service_changed_char 3 #define gattdb_database_hash 6 #define gattdb_client_support_features 8 #define gattdb_device_name 11 -#define gattdb_ota_control 23 -#define gattdb_CHIPoBLEChar_Rx 26 -#define gattdb_CHIPoBLEChar_Tx 28 +#define gattdb_CHIPoBLEChar_Rx 23 +#define gattdb_CHIPoBLEChar_Tx 25 +#define gattdb_ota_control 29 #if __cplusplus } #endif -#endif +#endif // __GATT_DB_H diff --git a/third_party/efr32_sdk/efr32_sdk.gni b/third_party/efr32_sdk/efr32_sdk.gni index 279fab936f7c03..5ccd4e3758abba 100644 --- a/third_party/efr32_sdk/efr32_sdk.gni +++ b/third_party/efr32_sdk/efr32_sdk.gni @@ -50,7 +50,6 @@ template("efr32_sdk") { # Treat these includes as system includes, so warnings in them are not fatal. _include_dirs = [ "${efr32_sdk_root}", - "${efr32_sdk_root}/util/third_party/freertos/Source/include", "${efr32_sdk_root}/platform/radio/rail_lib/hal", "${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32", "${efr32_sdk_root}/hardware/kit/common/bsp", @@ -75,7 +74,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/emdrv/dmadrv/inc", "${efr32_sdk_root}/platform/emdrv/nvm3/inc", "${efr32_sdk_root}/platform/emdrv/rtcdrv/inc", - "${efr32_sdk_root}/platform/emdrv/sleep/inc", "${efr32_sdk_root}/platform/emlib/inc", "${efr32_sdk_root}/platform/halconfig/inc/hal-config", "${efr32_sdk_root}/platform/radio/rail_lib/common", @@ -87,7 +85,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/service/power_manager/src/", "${efr32_sdk_root}/util/plugin/plugin-common/fem-control", "${efr32_sdk_root}/protocol/bluetooth/inc/", - "${efr32_sdk_root}/util/third_party/freertos/Source/include", "${efr32_sdk_root}/platform/service/mpu/inc", "${efr32_sdk_root}/platform/service/sleeptimer/inc", "${efr32_sdk_root}/platform/service/sleeptimer/config", @@ -102,16 +99,15 @@ template("efr32_sdk") { "${efr32_sdk_root}/hardware/kit/config", "${efr32_sdk_root}/util/silicon_labs/silabs_core/graphics", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/include", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/include/mbedtls", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/include/psa", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/include", - - #"${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/inc", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/config/", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/inc", "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/inc", + "${efr32_sdk_root}/util/third_party/freertos/kernel/include", "${efr32_sdk_root}/util/silicon_labs/silabs_core/memory_manager", "${efr32_sdk_root}/platform/bootloader", ] @@ -140,6 +136,7 @@ template("efr32_sdk") { defines = [ "MBEDTLS_CONFIG_FILE=\"efr32-chip-mbedtls-config.h\"", + "MBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"efr32-mbedtls-psa-crypto-config.h\"", "__STARTUP_CLEAR_BSS", "HARD_FAULT_LOG_ENABLE", "RETARGET_VCOM", @@ -171,7 +168,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/hardware/kit/EFR32MG12_${efr32_board}/config", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Include", "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg1x", - "${efr32_sdk_root}/util/third_party/freertos/Source/portable/GCC/ARM_CM4F", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM4F", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg1x/config", ] @@ -188,9 +185,8 @@ template("efr32_sdk") { "${efr32_sdk_root}/hardware/kit/EFR32MG21_${efr32_board}/config", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Include", "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", - "${efr32_sdk_root}/util/third_party/freertos/Source/portable/GCC/ARM_CM3", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM3", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg21/config", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src", ] libs += [ @@ -234,7 +230,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_default.c", "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_hal_flash.c", "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_lock.c", - "${efr32_sdk_root}/platform/emdrv/sleep/src/sleep.c", "${efr32_sdk_root}/platform/emdrv/uartdrv/src/uartdrv.c", "${efr32_sdk_root}/platform/emdrv/ustimer/src/ustimer.c", "${efr32_sdk_root}/platform/emlib/src/em_adc.c", @@ -265,10 +260,10 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/middleware/glib/glib/glib_rectangle.c", "${efr32_sdk_root}/platform/middleware/glib/glib/glib_string.c", "${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32/hal_efr.c", - "${efr32_sdk_root}/platform/radio/rail_lib/hal/hal_common.c", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_conversions_efr32.c", "${efr32_sdk_root}/platform/service/mpu/src/sl_mpu.c", "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager.c", + "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_debug.c", "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_hal_s0_s1.c", "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_hal_s2.c", "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer.c", @@ -286,6 +281,8 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/camellia.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ccm.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/certs.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/chacha20.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/chachapoly.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cipher.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cipher_wrap.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cmac.c", @@ -316,8 +313,19 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkwrite.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/platform.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/platform_util.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/poly1305.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_cipher.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_client.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_driver_wrappers.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_ecp.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_hash.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_rsa.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_se.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_slot_management.c", + "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_storage.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ripemd160.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/rsa.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/rsa_internal.c", @@ -346,24 +354,33 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509write_csr.c", "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/xtea.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/source/sl_entropy.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/source/sl_mbedtls.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/aes_aes.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_aes.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_ecp.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ccm.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_cmac.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ecdsa_ecdh.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_sha.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_crypto.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_radioaes.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/crypto_management.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_aead.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_cipher.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_hash.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_mac.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_trng_driver.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_driver_common.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_driver_init.c", + "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_trng.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_signature.c", - "${efr32_sdk_root}/util/third_party/freertos/Source/croutine.c", - "${efr32_sdk_root}/util/third_party/freertos/Source/event_groups.c", - "${efr32_sdk_root}/util/third_party/freertos/Source/include/FreeRTOS.h", - "${efr32_sdk_root}/util/third_party/freertos/Source/list.c", - "${efr32_sdk_root}/util/third_party/freertos/Source/queue.c", - "${efr32_sdk_root}/util/third_party/freertos/Source/tasks.c", - "${efr32_sdk_root}/util/third_party/freertos/Source/timers.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/croutine.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/event_groups.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/include/FreeRTOS.h", + "${efr32_sdk_root}/util/third_party/freertos/kernel/list.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/queue.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/tasks.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c", ] if (defined(enable_fem)) { @@ -389,7 +406,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/hardware/kit/common/drivers/mx25flash_spi.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/GCC/startup_efr32mg12p.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/system_efr32mg12p.c", - "${efr32_sdk_root}/util/third_party/freertos/Source/portable/GCC/ARM_CM4F/port.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM4F/port.c", ] } else if (efr32_family == "efr32mg21") { sources += [ @@ -416,7 +433,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", - "${efr32_sdk_root}/util/third_party/freertos/Source/portable/GCC/ARM_CM3/port.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM3/port.c", ] } diff --git a/third_party/efr32_sdk/repo b/third_party/efr32_sdk/repo index 276dfe4ee94e86..3cdcfad31dc4a5 160000 --- a/third_party/efr32_sdk/repo +++ b/third_party/efr32_sdk/repo @@ -1 +1 @@ -Subproject commit 276dfe4ee94e86687b284fd4cd243b1e0badd32f +Subproject commit 3cdcfad31dc4a5a988a4de56d8a1c34728dd86fc