Skip to content

Commit

Permalink
initial updates for Rotating Device ID
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-tpan committed Feb 23, 2022
1 parent 567875e commit eab3436
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/lock-app/cc13x2x7_26x2x7/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ chip_enable_ota_requestor = true
# BLE options
chip_config_network_layer_ble = true
chip_bypass_rendezvous = false

chip_enable_rotating_device_id = true
chip_enable_additional_data_advertising = true
4 changes: 4 additions & 0 deletions src/platform/cc13x2_26x2/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ void BLEManagerImpl::ConfigureAdvertisements(void)
sInstance.mAdvDatachipOBle[advIndex++] = static_cast<uint8_t>(HI_UINT16(CHIPOBLE_SERV_UUID));
memcpy(&sInstance.mAdvDatachipOBle[advIndex], (void *) &mDeviceIdInfo, static_cast<uint8_t>(sizeof(mDeviceIdInfo)));

#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING
mDeviceIdInfo.SetAdditionalDataFlag(true);
#endif

// Setup and start Advertising
// For more information, see the GAP section in the User's Guide:
// http://software-dl.ti.com/lprf/ble5stack-latest/
Expand Down
31 changes: 31 additions & 0 deletions src/platform/cc13x2_26x2/chipOBleProfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ const uint8 chipOBleProfileRxCharUUID[ATT_UUID_SIZE] = {
CHIPOBLEPROFILE_CHAR_UUID_BASE128(CHIPOBLEPROFILE_RX_CHAR_UUID)
};

#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING
// CHIPoBLE Rx characteristic UUID
const uint8 chipOBleProfileC3CharUUID[ATT_UUID_SIZE] = {
// 0x04, 0x8F, 0x21, 0x83, 0x8A, 0x74, 0x7D, 0xB8, 0xF2, 0x45, 0x72, 0x87, 0x38, 0x02, 0x63, 0x64
CHIPOBLEPROFILE_C3_CHAR_UUID128
};
#endif

/*********************************************************************
* Profile Attributes - variables
*/
Expand Down Expand Up @@ -82,6 +90,17 @@ static uint8_t chipOBleProfileRxCharVal[CHIPOBLEPROFILE_CHAR_LEN] = { 0x00 };
// CHIPoBLE Rx Characteristic User Description
static uint8_t chipOBleProfileRxdDataUserDesp[CHIPOBLEPROFILE_MAX_DESCRIPTION_LEN] = "ChipOBLE Rx Char";

#ifdef CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING
// CHIPoBLE C3 Characteristic Properties
static uint8_t chipOBleProfileC3CharProps = GATT_PROP_READ;

// CHIPoBLE C3 Characteristic Value
static uint8_t chipOBleProfileC3CharVal[CHIPOBLEPROFILE_CHAR_LEN] = { 0x00 };

// CHIPoBLE C3 Characteristic User Description
static uint8_t chipOBleProfileC3dDataUserDesp[CHIPOBLEPROFILE_MAX_DESCRIPTION_LEN] = "ChipOBLE C3 Char";
#endif

/*********************************************************************
* LOCAL VARIABLES
*/
Expand Down Expand Up @@ -121,6 +140,18 @@ static gattAttribute_t chipoBleProfileAttrTbl[] = {

// CHIPoBLE Rx Characteristic User Description
{ { ATT_BT_UUID_SIZE, charUserDescUUID }, GATT_PERMIT_READ, 0, chipOBleProfileRxdDataUserDesp },

#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING
// CHIPoBLE C3 Characteristic Declaration
{ { ATT_BT_UUID_SIZE, characterUUID }, GATT_PERMIT_READ, 0, &chipOBleProfileC3CharProps },

// CHIPoBLE C3 Characteristic Value
{ { ATT_UUID_SIZE, chipOBleProfileC3CharUUID }, GATT_PERMIT_READ, 0, chipOBleProfileC3CharVal },

// CHIPoBLE C3 Characteristic User Description
{ { ATT_BT_UUID_SIZE, charUserDescUUID }, GATT_PERMIT_READ, 0, chipOBleProfileC3dDataUserDesp },
#endif

};

/*********************************************************************
Expand Down
6 changes: 6 additions & 0 deletions src/platform/cc13x2_26x2/chipOBleProfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ extern "C" {
#define CHIPOBLEPROFILE_CHAR_UUID_BASE128(uuid) \
HI_UINT16(uuid), LO_UINT16(uuid), 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18

#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING
// for C3 (additional commissioning-related data); (spec: 4.16.3.2 BTP GATT Service)
#define CHIPOBLEPROFILE_C3_CHAR_UUID128 \
0x04, 0x8F, 0x21, 0x83, 0x8A, 0x74, 0x7D, 0xB8, 0xF2, 0x45, 0x72, 0x87, 0x38, 0x02, 0x63, 0x64
#endif

#define CHIPOBLEPROFILE_TX_CHAR 0 // R uint8 - Profile Characteristic 1 (CHIPOBLE Tx) value
#define CHIPOBLEPROFILE_RX_CHAR 1 // W uint8 - Profile Characteristic 2 (CHIPOBLE Rx) value
#define CHIPOBLEPROFILE_CCCWrite 2 // Client Characteristic Configuration
Expand Down

0 comments on commit eab3436

Please sign in to comment.