Part Number: CC2340R5
Hi TI Experts ,
Using two CC2340R5 boards with the data_stream example (Central & Peripheral roles), how can the Central side find the right req.handle for enabling notifications or sending data? Is there an API for handle discovery?
SDK 9.14.2.16
void EnableNotification(char *index){
attWriteReq_t req;
bStatus_t status;
uint8 configData[2] = {0x01,0x00};
req.pValue = GATT_bm_alloc(app_connection_handle, ATT_WRITE_REQ, 2, NULL);
// Enable notify for outgoing data
if (req.pValue != NULL)
{
req.handle = 47;//????
req.len = 2;
memcpy(req.pValue, configData, 2);
req.cmd = TRUE;
req.sig = FALSE;
status = GATT_WriteNoRsp(app_connection_handle, &req);
if ( status != SUCCESS )
{
GATT_bm_free((gattMsg_t *)&req, ATT_WRITE_REQ);
}
}
}
static gattAttribute_t dss_attrTbl[] =
{
/*--------------------type-------------------*/ /*------------permissions-------------*/ /*------------------pValue--------------------*/
// Data Stream Service
GATT_BT_ATT( primaryServiceUUID, GATT_PERMIT_READ, (uint8 *) &dss_service ),
// DataIn Characteristic Properties
GATT_BT_ATT( characterUUID, GATT_PERMIT_READ, &dss_dataIn_props ),
// DataIn Characteristic Value
GATT_ATT( dss_dataIn_UUID, GATT_PERMIT_WRITE, &dss_dataIn_val ),
// DataIn Characteristic User Description
GATT_BT_ATT( charUserDescUUID, GATT_PERMIT_READ, dss_dataIn_userDesp ),
// DataOut Characteristic Properties
GATT_BT_ATT( characterUUID, GATT_PERMIT_READ, &dss_dataOut_props ),
// DataOut Characteristic Value
GATT_ATT( dss_dataOut_UUID, 0, &dss_dataOut_val ),
// DataOut Characteristic configuration
GATT_BT_ATT( clientCharCfgUUID, GATT_PERMIT_READ | GATT_PERMIT_WRITE, (uint8 *) &dss_dataOut_config ),
// DataOut Characteristic User Description
GATT_BT_ATT( charUserDescUUID, GATT_PERMIT_READ, dss_dataOut_userDesp ),
};