From 599136ef205cd7c01f2bf4515f1efb2335d156d2 Mon Sep 17 00:00:00 2001 From: Anders Bang Poulsen Date: Thu, 11 Nov 2021 09:17:50 +0100 Subject: [PATCH 1/3] Changed to 16 bit UUID for CHIPoBLE service as per spec. Corrected a length bug in the BLE name that cut the advertised name short. --- src/platform/cc13x2_26x2/BLEManagerImpl.cpp | 2 +- src/platform/cc13x2_26x2/BLEManagerImpl.h | 2 ++ src/platform/cc13x2_26x2/chipOBleProfile.c | 21 ++++++++++++--------- third_party/cirque/repo | 2 +- third_party/zap/repo | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/platform/cc13x2_26x2/BLEManagerImpl.cpp b/src/platform/cc13x2_26x2/BLEManagerImpl.cpp index 8f8905c96c5254..15d28f75ffef88 100644 --- a/src/platform/cc13x2_26x2/BLEManagerImpl.cpp +++ b/src/platform/cc13x2_26x2/BLEManagerImpl.cpp @@ -430,7 +430,7 @@ void BLEManagerImpl::ConfigureAdvertisements(void) /* Default device name is CHIP- */ deviceDiscriminator = mDeviceIdInfo.GetDeviceDiscriminator(); - localDeviceNameLen = strlen(CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX) + sizeof(deviceDiscriminator); + localDeviceNameLen = strlen(CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX) + CHIPOBLE_DEVICE_DESC_LENGTH; memset(sInstance.mDeviceName, 0, GAP_DEVICE_NAME_LEN); snprintf(sInstance.mDeviceName, GAP_DEVICE_NAME_LEN, "%s%04u", CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX, diff --git a/src/platform/cc13x2_26x2/BLEManagerImpl.h b/src/platform/cc13x2_26x2/BLEManagerImpl.h index 1bb256bb79f9bc..76c055cec4a069 100644 --- a/src/platform/cc13x2_26x2/BLEManagerImpl.h +++ b/src/platform/cc13x2_26x2/BLEManagerImpl.h @@ -71,6 +71,8 @@ using namespace chip::Ble; #define CHIPOBLE_ADV_DATA_MAX_SIZE (GAP_DEVICE_NAME_LEN + CHIPOBLE_SCANRES_SIZE_NO_NAME) +#define CHIPOBLE_DEVICE_DESC_LENGTH (4) + // How often to read current current RPA (in ms) #define READ_RPA_EVT_PERIOD 3000 diff --git a/src/platform/cc13x2_26x2/chipOBleProfile.c b/src/platform/cc13x2_26x2/chipOBleProfile.c index 0cc8e66b317701..27d96eabf1372c 100644 --- a/src/platform/cc13x2_26x2/chipOBleProfile.c +++ b/src/platform/cc13x2_26x2/chipOBleProfile.c @@ -38,7 +38,10 @@ * GLOBAL VARIABLES */ // CHIPoBLE GATT Profile Service UUID -const uint8 chipOBleServUUID[ATT_UUID_SIZE] = { CHIPOBLEPROFILE_SERV_UUID_BASE128(CHIPOBLE_SERV_UUID) }; +const uint8 chipOBleServUUID[ATT_BT_UUID_SIZE] = { + // 0xF6, 0xFF + LO_UINT16(CHIPOBLE_SERV_UUID), HI_UINT16(CHIPOBLE_SERV_UUID) +}; // CHIPoBLE Tx characteristic UUID const uint8 chipOBleProfileTxCharUUID[ATT_UUID_SIZE] = { @@ -56,27 +59,27 @@ const uint8 chipOBleProfileRxCharUUID[ATT_UUID_SIZE] = { * Profile Attributes - variables */ -// Remote Display Profile Service attribute -static const gattAttrType_t chipoBleProfile = { ATT_UUID_SIZE, chipOBleServUUID }; +// CHIPoBLE GATT Profile Service attribute +static const gattAttrType_t chipoBleProfile = { ATT_BT_UUID_SIZE, chipOBleServUUID }; -// ChipOBLE Tx Characteristic Properties +// CHIPoBLE Tx Characteristic Properties static uint8_t chipOBleProfileTxCharProps = GATT_PROP_READ | GATT_PROP_NOTIFY; -// ChipOBLE Tx Characteristic Value +// CHIPoBLE Tx Characteristic Value static uint8_t chipOBleProfileTxCharVal[CHIPOBLEPROFILE_CHAR_LEN] = { 0x00 }; -// ChipOBLE Tx Characteristic User Description +// CHIPoBLE Tx Characteristic User Description static uint8_t chipOBleProfileTxdDataUserDesp[CHIPOBLEPROFILE_MAX_DESCRIPTION_LEN] = "ChipOBLE Tx Char"; static gattCharCfg_t * chipOBleProfileTxStateDataConfig; -// ChipOBLE Rx Characteristic Properties +// CHIPoBLE Rx Characteristic Properties static uint8_t chipOBleProfileRxCharProps = GATT_PROP_WRITE; -// ChipOBLE Rx Characteristic Value +// CHIPoBLE Rx Characteristic Value static uint8_t chipOBleProfileRxCharVal[CHIPOBLEPROFILE_CHAR_LEN] = { 0x00 }; -// ChipOBLE Rx Characteristic User Description +// CHIPoBLE Rx Characteristic User Description static uint8_t chipOBleProfileRxdDataUserDesp[CHIPOBLEPROFILE_MAX_DESCRIPTION_LEN] = "ChipOBLE Rx Char"; /********************************************************************* diff --git a/third_party/cirque/repo b/third_party/cirque/repo index 262ea772466722..f174b03ac52d1e 160000 --- a/third_party/cirque/repo +++ b/third_party/cirque/repo @@ -1 +1 @@ -Subproject commit 262ea7724667229f0d21d6a1c1e96d90415f0906 +Subproject commit f174b03ac52d1e0b4728bc45576c2fd923750e15 diff --git a/third_party/zap/repo b/third_party/zap/repo index 98b43b32758cbf..0376d5eb812d0f 160000 --- a/third_party/zap/repo +++ b/third_party/zap/repo @@ -1 +1 @@ -Subproject commit 98b43b32758cbfd8f643ef0a365cab9e0d9dcfde +Subproject commit 0376d5eb812d0f3d5585861b0b88b2480799e92e From 7ffa6bb48aadd3476c467997d4d225e96a615d07 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 12 Nov 2021 07:11:43 +0000 Subject: [PATCH 2/3] Restyled by whitespace --- src/platform/cc13x2_26x2/chipOBleProfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/cc13x2_26x2/chipOBleProfile.c b/src/platform/cc13x2_26x2/chipOBleProfile.c index 27d96eabf1372c..a653d0f525a654 100644 --- a/src/platform/cc13x2_26x2/chipOBleProfile.c +++ b/src/platform/cc13x2_26x2/chipOBleProfile.c @@ -38,9 +38,9 @@ * GLOBAL VARIABLES */ // CHIPoBLE GATT Profile Service UUID -const uint8 chipOBleServUUID[ATT_BT_UUID_SIZE] = { +const uint8 chipOBleServUUID[ATT_BT_UUID_SIZE] = { // 0xF6, 0xFF - LO_UINT16(CHIPOBLE_SERV_UUID), HI_UINT16(CHIPOBLE_SERV_UUID) + LO_UINT16(CHIPOBLE_SERV_UUID), HI_UINT16(CHIPOBLE_SERV_UUID) }; // CHIPoBLE Tx characteristic UUID From 97d67ea7515cd967cd4e6f29ba0655486a2d86d7 Mon Sep 17 00:00:00 2001 From: Anders Bang Poulsen Date: Fri, 12 Nov 2021 08:15:04 +0100 Subject: [PATCH 3/3] Fixed submodule version --- third_party/cirque/repo | 2 +- third_party/zap/repo | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/cirque/repo b/third_party/cirque/repo index f174b03ac52d1e..262ea772466722 160000 --- a/third_party/cirque/repo +++ b/third_party/cirque/repo @@ -1 +1 @@ -Subproject commit f174b03ac52d1e0b4728bc45576c2fd923750e15 +Subproject commit 262ea7724667229f0d21d6a1c1e96d90415f0906 diff --git a/third_party/zap/repo b/third_party/zap/repo index 0376d5eb812d0f..98b43b32758cbf 160000 --- a/third_party/zap/repo +++ b/third_party/zap/repo @@ -1 +1 @@ -Subproject commit 0376d5eb812d0f3d5585861b0b88b2480799e92e +Subproject commit 98b43b32758cbfd8f643ef0a365cab9e0d9dcfde