网上有很多抄的CC2541 simple_peripheral的代码,用CC2640R2F实现不生效,我用的simplelink_cc2640r2_sdk_1_40_00_45,网上说直接在callback里面加
static gapRolesCBs_t SimpleBLEPeripheral_gapRoleCBs =
{
SimpleBLEPeripheral_stateChangeCB, // GAPRole State Change Callbacks
simpleBLEPeripheralRssiCB
};
但是gapRolesCBs_t 在peripheral.h中定义为
typedef struct
{
gapRolesStateNotify_t pfnStateChange; //!< Whenever the device changes state
} gapRolesCBs_t;
需要使用peripheral_broadcaster.h中的定义
typedef struct
{
gapRolesStateNotify_t pfnStateChange; //!< Whenever the device changes state
gapRolesRssiRead_t pfnRssiRead; //!< When a valid RSSI is read from controller
} gapRolesCBs_t;
.h换了很多东西都要跟着换,然而测试并没有进入回调,希望有大神指导一下