请问GATTServApp_ProcessCCCWriteReq这个函数具体是干什么用的?
static bStatus_t battWriteAttrCB( uint16 connHandle, gattAttribute_t *pAttr,
uint8 *pValue, uint8 len, uint16 offset )
{
bStatus_t status = SUCCESS;
uint16 uuid = BUILD_UINT16( pAttr->type.uuid[0], pAttr->type.uuid[1]);
switch ( uuid )
{
case GATT_CLIENT_CHAR_CFG_UUID:
status = GATTServApp_ProcessCCCWriteReq( connHandle, pAttr, pValue, len,
offset, GATT_CLIENT_CFG_NOTIFY );
if ( status == SUCCESS )
{
uint16 charCfg = BUILD_UINT16( pValue[0], pValue[1] );
if ( battServiceCB )
{
(*battServiceCB)( (charCfg == GATT_CFG_NO_OPERATION) ?
BATT_LEVEL_NOTI_DISABLED :
BATT_LEVEL_NOTI_ENABLED);
}
}
break;
default:
status = ATT_ERR_ATTR_NOT_FOUND;
break;
}
return ( status );
}
新人求问,请问高亮部分的函数GATTServApp_ProcessCCCWriteReq到底是干嘛用的?看到好几个应用在写notify 的configuration UUID的时候地方都用到。
/**
* @brief Process the client characteristic configuration
* write request for a given client.
*
* @param connHandle - connection message was received on.
* @param pAttr - pointer to attribute.
* @param pValue - pointer to data to be written.
* @param len - length of data.
* @param offset - offset of the first octet to be written.
* @param validCfg - valid configuration.
*
* @return Success or Failure
*/
extern bStatus_t GATTServApp_ProcessCCCWriteReq( uint16 connHandle, gattAttribute_t *pAttr,
uint8 *pValue, uint8 len, uint16 offset,
uint16 validCfg );
如果一个服务中有多个特征值被设置位Notify,这个函数需要区分不一样的特征值分别处理吗?