主题中讨论的其他部件:CC2640R2F, BLE-STACK, CC2650
您好,
我正在使用堆栈版本SimpleLinkCC2640R2 SDK 1.00 .00.22 和CC2640R2F芯片集。
使用的示例项目:C:\TI\simplelink_cc2640r2_SDK_1_00_00_22\examples\RTOS\CC2640R2_LAUNCCHXL\blestack\simple_peripheral</s>2640
我的要求 是:配对+在不绑定的情况下读取加密数据。
对于配对(只能使用),我的配置是:
uINT32_t密钥= 0;//密钥"0万"
UINT8_t pairMode = GAPBOND_Pair_MODE_Initiate;
UINT8_t MITM =假;
UINT8_t ioCap = GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT;
UINT8_t绑定=假;
GAPBondMgr_SetParameter(GAPBOND_DEFAULT_Passcode,sizeof(UINT32_t),
密钥(&P));
GAPBondMgr_SetParameter (GAPBOND_Pair_mode,sizeof(uint8_t),&pairMode);
GAPBondMgr_SetParameter (GAPBOND_MITM_protection,sizeof(uint8_t),&MItm);
GAPBondMgr_SetParameter (GAPBOND_IO_Capabilities,sizeof(uint8_t),&ioCap);
GAPBondMgr_SetParameter (GAPBOND_Bonding_enabled,sizeof (uint8_t),&Bonding);
对于GATT配置文件中的加密,我的配置为 :
静态gattAttribute_t simpleProfileAttrTbL[SERVAPP_NUM_ATTR_SUPPORTE]=
{
//简单配置文件服务
{
{ ATT_BT_UUUID_SIZE,primaryServiceUUID },/* type */
GATT_permit_encrypt_read, /*权限*/
0, /*句柄*/
(UINT8 *)&simpleProfileService /* pValue */
},
//特性1声明
{
{ ATT_BT_UUID_SIZE,字符UUID },
GATT许可加密读取,
0,
&simpleProfileChar1Props
},
//特性值1
{
{ ATT_BT_UUID_SIZE,simpleProfilechar1UUID },
GATT_permit_encrypt_read | GATT_permit_write,
0,
&simpleProfileChar1.
},
//特性1用户描述
{
{ ATT_BT_UUID_SIZE,charUserDescUUID },
GATT许可加密读取,
0,
simpleProfileChar1UserDesp
},
//特性2声明
{
{ ATT_BT_UUID_SIZE,字符UUID },
GATT许可加密读取,
0,
&simpleProfileChar2Props
},
//特性值2.
{
{ ATT_BT_UUID_SIZE,simpleProfilechar2UUID },
GATT许可加密读取,
0,
&simpleProfileChar2.
},
//特性2用户描述
{
{ ATT_BT_UUID_SIZE,charUserDescUUID },
GATT许可加密读取,
0,
simpleProfileChar2UserDesp
},
//特性3声明
{
{ ATT_BT_UUID_SIZE,字符UUID },
GATT许可加密读取,
0,
&simpleProfileChar3Props
},
//特性值3.
{
{ ATT_BT_UUID_SIZE,simpleProfilechar3UUID },
GATT许可写入,
0,
&simpleProfileChar3.
},
//特性3用户描述
{
{ ATT_BT_UUID_SIZE,charUserDescUUID },
GATT许可加密读取,
0,
simpleProfileChar3UserDesp
},
//特性4声明
{
{ ATT_BT_UUID_SIZE,字符UUID },
GATT许可加密读取,
0,
&simpleProfileChar4Props
},
//特性值4.
{
{ ATT_BT_UUID_SIZE,simpleProfilechar4UUID },
0,
0,
&simpleProfileChar4.
},
//特性4配置
{
{ ATT_BT_UUID_SIZE,clientCharCfgUUID },
GATT_permit_encrypt_read | GATT_permit_write,
0,
(UINT8 *)&simpleProfileChar4Config
},
//特性4用户描述
{
{ ATT_BT_UUID_SIZE,charUserDescUUID },
GATT许可加密读取,
0,
simpleProfileChar4UserDesp
},
//特性5声明
{
{ ATT_BT_UUID_SIZE,字符UUID },
GATT许可加密读取,
0,
&simpleProfileChar5Props
},
//特性值5.
{
{ ATT_BT_UUID_SIZE,simpleProfilechar5UUID },
GATT许可加密读取,
0,
simpleProfileChar5.
},
//特性5用户描述
{
{ ATT_BT_UUID_SIZE,charUserDescUUID },
GATT许可加密读取,
0,
simpleProfileChar5UserDesp
},
};
观察:
对于上述配置,在将我的设备(外围设备)与中央设备配对后,每当我尝试连接时,我的设备(外围设备)都挂起,并且无法恢复。
重置后,它将再次开始广告。
如果我通过 在Bond Manager (绑定管理器)部分进行以下更改启用绑定以及配对+数据加密,
UINT8_t绑定=真;
GAPBondMgr_SetParameter (GAPBOND_Bonding_enabled,sizeof (uint8_t),&Bonding);
其余配置未更改。
simpleProfileAttrTbl中没有变化。
观察:
对于上述配置,将设备(外围设备)与中央设备配对后,每当我尝试连接时,我的设备(外围设备)都已正确连接,并且我可以读取和写入数据。
既然我的要求是配对+不绑定读取加密数据,有人能建议如何处理这种情况吗?
谢谢,此致,
Jayachandran R