Description Resource Path Location Type
unresolved symbol GATT_Notification, first referenced in <whole-program> ble5_simple_peripheral_cc2640r2lp_app_oad_offchip C/C++ Problem
Description Resource Path Location Type
unresolved symbol GATTServApp_RegisterService, first referenced in <whole-program> ble5_simple_peripheral_cc2640r2lp_app_oad_offchip C/C++ Problem
Susan Yang:
您是直接编译的例程?我试了一下并没有类似错误
YiKai Chen:
你用得SDK跟CCS版本是?
user5985452:
回复 Susan Yang:
我是用的simple_peripheral_oad_offchip工程添加了一个自定义服务,自定义函数中用到了这两个函数,GATT_Notification和GATTServApp_RegisterService
void USER_Profile_Notify(uint8_t nUSER_Param, uint16_t nUSER_ConnHandle, uint8_t *pUSER_Value, uint8_t nUSER_Len)
{attHandleValueNoti_t stUSER_Noti;uint16_t nUSER_Value;switch(nUSER_Param){case USERPROFILE_CHAR1:{nUSER_Value = GATTServApp_ReadCharCfg(nUSER_ConnHandle, USERProfile_Char1_Config);if(nUSER_Value & GATT_CLIENT_CFG_NOTIFY){stUSER_Noti.pValue = GATT_bm_alloc(nUSER_ConnHandle, ATT_HANDLE_VALUE_NOTI, nUSER_Len, NULL);//USERPROFILE_CHAR1_LENif(stUSER_Noti.pValue != NULL){stUSER_Noti.handle = USERProfileAttrTbl[ATTRTBL_USER_CHAR1_IDX].handle;stUSER_Noti.len = nUSER_Len;memcpy( stUSER_Noti.pValue, pUSER_Value, nUSER_Len);stated = GATT_Notification(nUSER_ConnHandle, &stUSER_Noti, FALSE);if (stated != SUCCESS){GATT_bm_free((gattMsg_t *)&stUSER_Noti, ATT_HANDLE_VALUE_NOTI);} else{//GATT_bm_free((gattMsg_t *)&stUSER_Noti, ATT_HANDLE_VALUE_NOTI);}} }break;}default:break;}
}bStatus_t USERProfile_AddService( uint32 services )
{uint8 status = SUCCESS;// Allocate Client Characteristic Configuration tableUSERProfile_Char1_Config = (gattCharCfg_t *)ICall_malloc( sizeof(gattCharCfg_t) *linkDBNumConns );if ( USERProfile_Char1_Config == NULL ){return ( bleMemAllocError );}
// Initialize Client Characteristic Configuration attributesGATTServApp_InitCharCfg( INVALID_CONNHANDLE, USERProfile_Char1_Config );if ( services & USERPROFILE_SERVICE ){// Register GATT attribute list and CBs with GATT Server Appstatus = GATTServApp_RegisterService( USERProfileAttrTbl, GATT_NUM_ATTRS( USERProfileAttrTbl ), GATT_MAX_ENCRYPT_KEY_SIZE, &USERProfileCBs );}return ( status );
}
user5985452:
回复 YiKai Chen:
SDK是1.4;CCS用的是7.3
YiKai Chen:
回复 user5985452:
你用的SDK跟CCS版本都很舊了,建議你先更新到最新的SDK還有CCS9.3
user5985452:
回复 Susan Yang:
没有包含gatt.h的头文件
Susan Yang:
回复 user5985452:
包含该文件之后,现在可以正常成功编译了?
user5985452:
回复 Susan Yang:
可以了