Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BLE manager to use indications #20113

Merged
merged 1 commit into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions src/platform/cc13x2_26x2/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,10 +873,6 @@ void BLEManagerImpl::ProcessEvtHdrMsg(QueuedEvt_t * pMsg)

case BLEManagerIMPL_CHIPOBLE_TX_IND_EVT: {
uint8_t dataLen = ((CHIPoBLEIndEvt_t *) (pMsg->pData))->len;
uint16_t i = 0;
void * connHandle;
ConnRec_t * activeConnObj = NULL;
ChipDeviceEvent event;

CHIPoBLEProfile_SetParameter(CHIPOBLEPROFILE_TX_CHAR, dataLen, (void *) (((CHIPoBLEIndEvt_t *) (pMsg->pData))->pData),
BLEManagerImpl::sSelfEntity);
Expand All @@ -885,21 +881,6 @@ void BLEManagerImpl::ProcessEvtHdrMsg(QueuedEvt_t * pMsg)

ICall_free((void *) (((CHIPoBLEIndEvt_t *) (pMsg->pData))->pData));

// Find active connection
for (i = 0; i < MAX_NUM_BLE_CONNS; i++)
{
if (sInstance.connList[i].connHandle != 0xffff)
{
activeConnObj = &sInstance.connList[i];
}
}

connHandle = (void *) &activeConnObj->connHandle;

event.Type = DeviceEventType::kCHIPoBLEIndicateConfirm;
event.CHIPoBLEIndicateConfirm.ConId = connHandle;
PlatformMgr().PostEventOrDie(&event);

dealloc = TRUE;
}
break;
Expand Down Expand Up @@ -967,7 +948,7 @@ void BLEManagerImpl::ProcessEvtHdrMsg(QueuedEvt_t * pMsg)
CHIPoBLEProfile_GetParameter(CHIPOBLEPROFILE_CCCWrite, &cccValue, 1);

// Check whether it is a sub/unsub event. 0x1 = Notifications enabled, 0x2 = Indications enabled
if (cccValue & 1)
if (cccValue & 0x2)
{
// Post event to CHIP
BLEMGR_LOG("BLEMGR: BLE Process Application Message: CHIPOBLE_CHAR_CHANGE_EVT, Subscrbe");
Expand Down
4 changes: 2 additions & 2 deletions src/platform/cc13x2_26x2/chipOBleProfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const uint8 chipOBleProfileRxCharUUID[ATT_UUID_SIZE] = {
static const gattAttrType_t chipoBleProfile = { ATT_BT_UUID_SIZE, chipOBleServUUID };

// CHIPoBLE Tx Characteristic Properties
static uint8_t chipOBleProfileTxCharProps = GATT_PROP_READ | GATT_PROP_NOTIFY;
static uint8_t chipOBleProfileTxCharProps = GATT_PROP_READ | GATT_PROP_INDICATE;

// CHIPoBLE Tx Characteristic Value
static uint8_t chipOBleProfileTxCharVal[CHIPOBLEPROFILE_CHAR_LEN] = { 0x00 };
Expand Down Expand Up @@ -362,7 +362,7 @@ static bStatus_t CHIPoBLEProfile_WriteAttrCB(uint16_t connHandle, gattAttribute_

notifyApp = CHIPOBLEPROFILE_CCCWrite;

status = GATTServApp_ProcessCCCWriteReq(connHandle, pAttr, pValue, len, offset, GATT_CLIENT_CFG_NOTIFY);
status = GATTServApp_ProcessCCCWriteReq(connHandle, pAttr, pValue, len, offset, GATT_CLIENT_CFG_INDICATE);
}
else
{
Expand Down