csr867x开启配对密码的方法(适用于qcc系列)
csr867x开启配对密码的方法(适用于qcc系列)以前的csr8635 csra64215可以直接通过pstool实现开启密码功能,csr867x需要改代码。
方法适用于qcc系列芯片,qcc300x,qcc30xx,qcc51xx
**** Hidden Message *****
if(version >= bluetooth4_1 && (flags & CONNECTION_FLAG_SC_ENABLE))
{
message->options |= DM_SM_INIT_SECURE_CONNECTIONS;
if(flags & CONNECTION_FLAG_SCOM_ENABLE)
{
message->config |=DM_SM_SEC_MODE_CONFIG_SC_ONLY_MODE;
message->options |=DM_SM_INIT_CONFIG;
}
}
message->write_auth_enable=cl_sm_wae_acl_owner_none;
if(version >= bluetooth2_1)
{
message->options |=DM_SM_INIT_WRITE_AUTH_ENABLE;
message->security_mode = sec_mode4_ssp;/*修改方法直接将sec_mode4_ssp替换为sec_mode2_service即可*/
message->mode3_enc = hci_enc_mode_pt_to_pt_and_bcast;
}
else if (version == bluetooth2_0)
{
/* As per the documentation for DM_SM_INIT_REQ_T in dm_prim.h
* write auth enable applies to security mode 2.
* mode3 encryption doesn't apply in this mode.
* No clue why mode 3 encryption is enabled.
*/
message->options |=DM_SM_INIT_WRITE_AUTH_ENABLE;
message->security_mode = sec_mode2_service;
message->mode3_enc = hci_enc_mode_pt_to_pt;
}
else
{
message->security_mode = sec_mode2_service;
message->mode3_enc = hci_enc_mode_pt_to_pt;
}
Good! 支持LZ! 路過學習,感謝樓主分享! 感谢分享:) 感谢分享 路過學習,感謝樓主分享! 学习,感谢!
路過學習,感謝樓主分享!:lol:lol 棒棒棒,待会去玩一玩,看一下效果怎么样 :handshake