outdated training_05_ble_security_example

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
bruce_loco
Offline
Last seen:2 years 11 months ago
加入:2017-05-16 20:43
outdated training_05_ble_security_example

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

Device:
MT_dialog
Offline
Last seen:2 months 4 weeks ago
工作人员
加入:2015-06-08 11:34
Hi bruce_loco,

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

bruce_loco
Offline
Last seen:2 years 11 months ago
加入:2017-05-16 20:43
Hi

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

MT_dialog
Offline
Last seen:2 months 4 weeks ago
工作人员
加入:2015-06-08 11:34
Hi bruce_loco

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