请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:CC2652P7 你好
我尝试使用我具有的密码来保护我的设备
www.ti.com/.../swru393e.pdf 5.4.4.3密码条目
配对可与 Android 配合使用、但如果我取消配对。 重建(使用双扫描仪)和当 Android 请求配对时、我回复取消、连接被接收到、我可以读取 Carpetictique
如何为未配对的设备拒绝连接或特性读取/写入?
uint8_t pairMode = GAPBOND_PAIRING_MODE_INITIATE;
uint8_t mitm = true;
uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
uint8_t bonding = true;
uint8_t secureConnection = GAPBOND_SECURE_CONNECTION_ONLY;
uint8_t authenPairingOnly = true;
uint8_t autoSyncWL = false;
uint8_t eccReGenPolicy = 0;
uint8_t KeySize = 16;
uint8_t removeLRUBond = false;
uint8_t KeyDistList = GAPBOND_KEYDIST_MENCKEY | GAPBOND_KEYDIST_MIDKEY | GAPBOND_KEYDIST_MSIGN | GAPBOND_KEYDIST_SENCKEY | GAPBOND_KEYDIST_SIDKEY | GAPBOND_KEYDIST_SSIGN;
uint8_t allowDebugKeys = false;
uint8_t eraseBondWhileInConn = false;
void setBondManagerParameters()
{
// Set Pairing Mode
GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
// Set MITM Protection
GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);
// Set IO Capabilities
GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
// Set Bonding
GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);
// Set Secure Connection Usage during Pairing
GAPBondMgr_SetParameter(GAPBOND_SECURE_CONNECTION, sizeof(uint8_t), &secureConnection);
// Set Authenticated Pairing Only mode
GAPBondMgr_SetParameter(GAPBOND_AUTHEN_PAIRING_ONLY, sizeof(uint8_t), &authenPairingOnly);
// Set Auto Whitelist Sync
GAPBondMgr_SetParameter(GAPBOND_AUTO_SYNC_WL, sizeof(uint8_t), &autoSyncWL);
// Set ECC Key Regeneration Policy
GAPBondMgr_SetParameter(GAPBOND_ECCKEY_REGEN_POLICY, sizeof(uint8_t), &eccReGenPolicy);
// Set Key Size used in pairing
GAPBondMgr_SetParameter(GAPBOND_KEYSIZE, sizeof(uint8_t), &KeySize);
// Set LRU Bond Replacement Scheme
GAPBondMgr_SetParameter(GAPBOND_LRU_BOND_REPLACEMENT, sizeof(uint8_t), &removeLRUBond);
// Set Key Distribution list for pairing
GAPBondMgr_SetParameter(GAPBOND_KEY_DIST_LIST, sizeof(uint8_t), &KeyDistList);
// Set Allow Debug Keys
GAPBondMgr_SetParameter(GAPBOND_ALLOW_DEBUG_KEYS, sizeof(uint8_t), &allowDebugKeys);
// Set the Erase bond While in Active Connection Flag
GAPBondMgr_SetParameter(GAPBOND_ERASE_BOND_IN_CONN, sizeof(uint8_t), &eraseBondWhileInConn);
}