Part Number:CC2642R
当前环境:
SDK:simplelink_cc13x2_26x2_sdk_4_10_00_78
芯片:cc2642
手机使用苹果,安卓均出现同样问题,使用芯片设置使用指定的配对码进行配对,手机输入配对码后无法配对成功。
配置如下:
/********************************************************************* * Bond Manager Configuration */ uint8_t pairMode=GAPBOND_PAIRING_MODE_WAIT_FOR_REQ; uint8_t mitm=true; uint8_t ioCap=GAPBOND_IO_CAP_DISPLAY_ONLY; uint8_t bonding=true; uint8_t secureConnection=GAPBOND_SECURE_CONNECTION_ALLOW; uint8_t autoSyncWL=false; uint8_t eccReGenPolicy=0; uint8_t KeySize=16; uint8_t removeLRUBond=true; uint8_t KeyDistList=GAPBOND_KEYDIST_MENCKEY | GAPBOND_KEYDIST_MIDKEY | GAPBOND_KEYDIST_MSIGN | GAPBOND_KEYDIST_SENCKEY | GAPBOND_KEYDIST_SIDKEY | GAPBOND_KEYDIST_SSIGN; uint8_t eccDebugKeys=false; void setBondManagerParameters() {// Set Pairing ModeGAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);// Set MITM ProtectionGAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);// Set IO CapabilitiesGAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);// Set BondingGAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);// Set Secure Connection Usage during PairingGAPBondMgr_SetParameter(GAPBOND_SECURE_CONNECTION, sizeof(uint8_t), &secureConnection);// Set Auto Whitelist SyncGAPBondMgr_SetParameter(GAPBOND_AUTO_SYNC_WL, sizeof(uint8_t), &autoSyncWL);// Set ECC Key Regeneration PolicyGAPBondMgr_SetParameter(GAPBOND_ECCKEY_REGEN_POLICY, sizeof(uint8_t), &eccReGenPolicy);// Set Key Size used in pairingGAPBondMgr_SetParameter(GAPBOND_KEYSIZE, sizeof(uint8_t), &KeySize);// Set LRU Bond Replacement SchemeGAPBondMgr_SetParameter(GAPBOND_LRU_BOND_REPLACEMENT, sizeof(uint8_t), &removeLRUBond);// Set Key Distribution list for pairingGAPBondMgr_SetParameter(GAPBOND_KEY_DIST_LIST, sizeof(uint8_t), &KeyDistList);// Set Secure Connection Debug KeysGAPBondMgr_SetParameter(GAPBOND_SC_HOST_DEBUG, sizeof(uint8_t), &eccDebugKeys); } // GAP Bond Manager Callbacks static gapBondCBs_t SimplePeripheral_BondMgrCBs ={SimplePeripheral_passcodeCb, // Passcode callbackSimplePeripheral_pairStateCb // Pairing/Bonding state Callback }; /********************************************************************* * @fnSimplePeripheral_processPasscode * * @briefProcess the Passcode request. * * @return none */ static void SimplePeripheral_processPasscode(spPasscodeData_t *pPasscodeData) {uint32_t passcode = 999999;Display_printf(("%04x, %d, %d, %d,\r\n",pPasscodeData->connHandle,pPasscodeData->uiInputs,pPasscodeData->uiOutputs,pPasscodeData->numComparison));//state code: 0000,0,1,0// Display passcode to userif (pPasscodeData->uiOutputs != 0){Display_printf(("Passcode: %d\r\n",passcode));}// Send passcode responseGAPBondMgr_PasscodeRsp(pPasscodeData->connHandle, SUCCESS,passcode); } //ERR state codecase GAPBOND_PAIRING_STATE_COMPLETE:if (status == SUCCESS){Display_printf(dispHandle, SP_ROW_CONNECTION, 0, "Pairing success");}else{Display_printf(dispHandle, SP_ROW_CONNECTION, 0, "Pairing fail: %d", status);//fail state: 0x0b(11);}break;
在手机上连接并点击配对后,无配对成功记录,安卓苹果均如此,已经在上面查询并尝试了
static gapBondCBs_t SimplePeripheral_BondMgrCBs =
{
NULL, // Passcode callback
SimplePeripheral_pairStateCb // Pairing/Bonding state Callback
};
也无法配对成功,配对完成事件(GAPBOND_PAIRING_STATE_COMPLETE)错误码提示为0x0b(SMP_PAIRING_FAILED_DHKEY_CHECK_FAILED)
我不清楚我还有哪些设置点没有关注到。
麻烦提供一下技术支持,非常感谢!
Kevin Qiu1:
我用SDK5.20及5.30测试均可以配对绑定成功,你用的是什么APP,用simplelink starter试一下
另外你可以用上面的SDK版本试一下,对于新开发的项目,我们始终建议使用最新的SDK,会对此前版本中存在的问题不断修复
,
ming he:
你好,能否使用SDK4.10确认一下问题点;
新项目使用公司原来SDK添加功能,现在切换版本工作量会大大增加。
在5.20上,我使用2652可以成功设置,目前手上的2642原厂开发板不在身边,无法使用5.20的SDK验证。
,
Kevin Qiu1:
我用SDK4.10试了一下也可以绑定成功:
如果第一次失败了,重试一次,第二次应该就可以绑定成功了
,
ming he:
非常感谢,确实如此。
可能是旧工程的一些修改导致了这个问题。但暂时没有找到是哪部分的修改。