CC2541
本帖最后由 一只耳朵怪 于 2018-6-7 14:21 编辑
我用2541添加了一个新的服务,新的服务里包括一个notify特征值,但是读不到传来的数据,句柄设置的应该没有问题,我觉得我服务添加的有问题,麻烦大神帮我改一下。bStatus_t SimpleProfile_AddService( uint32 services )
{
uint8 status;
// Allocate Client Characteristic Configuration table
simpleProfileChar4Config = (gattCharCfg_t *)osal_mem_alloc( sizeof(gattCharCfg_t) *
linkDBNumConns );
simpleProfileChar6Config = (gattCharCfg_t *)osal_mem_alloc( sizeof(gattCharCfg_t) *
linkDBNumConns );
if ( simpleProfileChar4Config == NULL )
{
return ( bleMemAllocError );
}
if ( simpleProfileChar6Config == NULL )
{
return ( bleMemAllocError );
}
// Initialize Client Characteristic Configuration attributes
GATTServApp_InitCharCfg( INVALID_CONNHANDLE, simpleProfileChar4Config );
if ( services & SIMPLEPROFILE_SERVICE )
{
// Register GATT attribute list and CBs with GATT Server App
status = GATTServApp_RegisterService( simpleProfileAttrTbl,
GATT_NUM_ATTRS( simpleProfileAttrTbl ),
GATT_MAX_ENCRYPT_KEY_SIZE,
&simpleProfileCBs );
status = GATTServApp_RegisterService( simpleProfileAttrTb2,
GATT_NUM_ATTRS( simpleProfileAttrTb2 ),
GATT_MAX_ENCRYPT_KEY_SIZE,
&simpleProfileCBs );
}
else
{
status = SUCCESS;
}
return ( status );
}
已退回2积分
更多回帖