请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:CC2640R2F SDK 4.40、示例外设、它可以用一个字节通知、如何使其更多功能?
我已经尝试修改了它、但失败了。
这是我的更改代码
// Simple Profile Characteristic 4 Properties
//static uint8 simpleProfileChar4Props = GATT_PROP_NOTIFY;
static uint8 simpleProfileChar4Props = GATT_PROP_READ | GATT_PROP_NOTIFY;
// Characteristic 4 Value
//static uint8 simpleProfileChar4 = 0;
static uint8 simpleProfileChar4[SIMPLEPROFILE_CHAR5_LEN] = {0};
// Characteristic Value 4
{
{ ATT_BT_UUID_SIZE, simpleProfilechar4UUID },
//0,
GATT_PERMIT_READ,
0,
simpleProfileChar4
},
//in SimpleProfile_SetParameter
case SIMPLEPROFILE_CHAR4:
//if ( len == sizeof ( uint8 ) )
if ( len <= SIMPLEPROFILE_CHAR5_LEN )
{
//simpleProfileChar4 = *((uint8*)value);
memcpy(simpleProfileChar4,value,len);
// See if Notification has been enabled
int s = GATTServApp_ProcessCharCfg( simpleProfileChar4Config, simpleProfileChar4, FALSE,
simpleProfileAttrTbl, GATT_NUM_ATTRS( simpleProfileAttrTbl ),
INVALID_TASK_ID, simpleProfile_ReadAttrCB );
}
else
{
ret = bleInvalidRange;
}
break;