静态key配对,为什么没有进入SimpleBLECentral_passcodeCB
时间:10-02
整理:3721RD
点击:
1. peripheral端
uint8_t pairMode = GAPBOND_PAIRING_MODE_INITIATE;
uint8_t mitm = TRUE;
uint8_t ioCap = GAPBOND_IO_CAP_KEYBOARD_DISPLAY;
uint8_t bonding = TRUE;
2 central端
uint8_t pairMode = DEFAULT_PAIRING_MODE;
uint8_t mitm = true;
uint8_t ioCap = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
uint8_t bonding = true;
为什么始终不能进入SimpleBLECentral_passcodeCB呢?
可以参考GlucoseCollector这个例程,这个例程是Central设备有绑定过程的代码
注意除了Bound Mgr参数配置以外 还需要有callback添加
// Register with bond manager after starting device
GAPBondMgr_Register((gapBondCBs_t *)&glucCollBondCB);
// Bond Manager Callbacks
static const gapBondCBs_t glucCollBondCB =
{
glucCollCentral_passcodeCB,
glucCollCentral_pairStateCB
};