I am trying to follow the security example training_05_ble_security_example_v1.1
This is outdated and some of the definitions/declarations of functions have not been updated on the PDF.
void default_app_on_tk_exch_nomitm(uint8_t connection_idx,structgapc_bond_req_indconst*param)
{
//uint32_t pin_code= app_sec_gen_tk();
//app_easy_security_set_tk( connection_idx, (uint8_t*) &pin_code, 4 );
app_easy_security_tk_exch(connection_idx);
}
在SDK 5.0.4
void default_app_on_tk_exch_nomitm(uint8_t connection_idx, struct gapc_bond_req_ind const *param)
{
// Generate the pass key
uint32_t pass_key = app_sec_gen_tk();
// Store 32-bit number to local buffer
uint8_t buf[sizeof(uint32_t)];
for (uint8_t i = 0; i < sizeof(uint32_t); i++)
{
buf[i] = pass_key & 0xFF;
pass_key = pass_key >> 8;
}
// Provide the TK to the host
app_easy_security_tk_exch(connection_idx, buf, sizeof(uint32_t));
}
app_easy_security_tk_exch has a new definition
custs1_att_db also is different, there are no write attributes(easy copy paste but hard to follow)
Thanks
Hi bruce_loco,
That is true, the tutorials are based in the 5.0.3 SDK and the documents are not yet updated to the latest 5.0.4 SDK, will be soon though, thanks for the indication.
Best Regards MT_dialog
Hi
I followed all examples without issue, but I am mostly interested in this one.
Can you provide just the base code changes for the tutorial?
at least it will make it work.
Thanks
Bruno
Hi bruce_loco
我想,你是interested on the pin code case, in the SDK 5.0.4 there is an example called ble_app_security that implements different cases of the security schemes that the 580 supports, including the pin code, so please check that demo. You will be able to toggle through different schemes from the user_config.h file via defining different flags (USER_CFG_PAIR_METHOD_JUST_WORKS, USER_CFG_PAIR_METHOD_PASSKEY, USER_CFG_PAIR_METHOD_OOB).
Thanks MT_dialog