Skip to content

Commit

Permalink
[cc13x2x7_26x2x7] Change to 16Bit UUID for Matter BLE service (#11721)
Browse files Browse the repository at this point in the history
* 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.

* Restyled by whitespace

* Fixed submodule version

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed May 4, 2022
1 parent d24345f commit 51b6830
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/platform/cc13x2_26x2/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ void BLEManagerImpl::ConfigureAdvertisements(void)
/* Default device name is CHIP-<DISCRIMINATOR> */
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,
Expand Down
2 changes: 2 additions & 0 deletions src/platform/cc13x2_26x2/BLEManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 12 additions & 9 deletions src/platform/cc13x2_26x2/chipOBleProfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand All @@ -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";

/*********************************************************************
Expand Down

0 comments on commit 51b6830

Please sign in to comment.