我看到您给的例子里面,使能notify写的很简单,
然后我又看到个官方做蓝牙I2C Bridge的例子,把使能notify写在了CYBLE_EVT_GATTS_WRITE_CMD_REQ里面,不知道是什么意思?是要在手机那边发了什么才能响应然后再使能notify吗?
case CYBLE_EVT_GATTS_WRITE_CMD_REQ:
wrReqParam = (CYBLE_GATTS_WRITE_REQ_PARAM_T *) eventParam;
/* Handling Notification Enable */
if(wrReqParam->handleValPair.attrHandle == CYBLE_I2C_READ_I2C_READ_DATA_CLIENT_CHARACTERISTIC_CONFIGURATION_DESC_HANDLE)
{
CYBLE_GATT_HANDLE_VALUE_PAIR_T I2CNotificationCCDHandle;
uint8 I2CCCDValue[2];
/* Extract CCCD Notification enable flag */
sendNotifications = wrReqParam->handleValPair.value.val[0];
/* Write the present I2C notification status to the local variable */
I2CCCDValue[0] = sendNotifications;
I2CCCDValue[1] = 0x00;
/* Update CCCD handle with notification status data*/
I2CNotificationCCDHandle.attrHandle = CYBLE_I2C_READ_I2C_READ_DATA_CLIENT_CHARACTERISTIC_CONFIGURATION_DESC_HANDLE;
I2CNotificationCCDHandle.value.val = I2CCCDValue;
I2CNotificationCCDHandle.value.len = 2;
/* Report data to BLE component for sending data when read by Central device */
CyBle_GattsWriteAttributeValue(&I2CNotificationCCDHandle, 0, &cyBle_connHandle, CYBLE_GATT_DB_LOCALLY_INITIATED);
}
break;
那个 /* Extract CCCD Notification enable flag */ 这里是什么意思呢??