Hi,
I'm currently working my way around the tutorials provided for the DA14585 Pro Kit on SDK 6.0.6. In fact, I'm using a Pro Kit with a DA14580DEVKIT in order to perform the tutorials. I'm having a few problems on the ble_security_example_v.1.2 that I would like to point out here for later fixes and to get a better understanding on the topic.
1 - Going through the tutorial document, I've found a lot of references that are not present on the ble_app_security files. They are:
@file user_config.h
#define USER_CFG_PAIR_METHOD_PASSKEY - It's possible to define it without any errors being added tho. I think changed this step to something related to USER_CFG_FEAT_SEC_REQ
#if defined (USER_CFG_PAIR_METHOD_PASSKEY) - Doesn't exists. There's a #if defined (USER_CFG_FEAT_SEC_REQ), that I think works similarly
#if defined (USER_CFG_PAIR_METHOD_JUST_WORKS) || defined (USER_CFG_PAIR_METHOD_PASSKEY) || defined (USER_CFG_PAIR_METHOD_OOB) - Doesn't exists. There's a #if defined (USER_CFG_FEAT_INIT_KDIST) that probably works similarly.
#if defined (USER_CFG_PAIR_METHOD_JUST_WORKS) || defined (USER_CFG_PAIR_METHOD_PASSKEY) || defined (USER_CFG_PAIR_METHOD_OOB) - Doesn't exists. There's a #if defined (USER_CFG_FEAT_RESP_KDIST) that probably works similarly
@user_callback_config.h
.app_on_tk_exch_nomitm = user_app_on_tk_exch_nomitm - Doesn't exists. If the user try to add it on the user_app_callbacks, several errors are added on the program.
user_app_on_pairing_succeeded - Doesn't exists. If the user try to add it on the user_app_callbacks, several errors are added on the program.
user_app_on_encrypt_req_ind - Doesn't exists. If the user try to add it on the user_app_callbacks, several errors are added on the program.
2 - After adding what's asked on tutorial (or not adding, in the cases I've mentioned earlier) I still cannot run the tutorial. Whenever I try to connect to the device, an "Connection Alert. The peripheral disconnected while being interrogated." error is shown. Any tips?
Thanks in advance.
嗨TMiranda,
The SDK 6.0.6 is just released, the tutorials are based on the SDK 6.0.4, if you check the files in the 6.0.4 you will be able to find the defined pairing methods that the tutorial mentions, like the USER_CFG_PAIR_METHOD_PASSKEY. There is a difference between the two SDK examples, in SDK 6.0.4 the security requirements in order to achive the pairing methods are previously defined by those three definitions USER_CFG_PAIR_METHOD_JUST_WORKS, USER_CFG_PAIR_METHOD_PASSKEY, USER_CFG_PAIR_METHOD_OOB, those defines control the values are are going to be inserted to the security structures in order for the 585 to achieve the desired schema. In 6.0.6 this method is depricated (since there is support for the LE connections) and the user is able of controlling the type of pairing required via the USER_CFG_FEAT_AUTH_REQ as you said. So in the new SDK you will have to change the value of USER_CFG_FEAT_AUTH_REQ and apply the corresponding bitmap in order to apply the desired authorization for your device, for example, as the device is, it supports Secure connection scheme if you remove that flag you will switch to the Legacy paring. For example for the standard legacy pass key entry all you have to do is remove the GAP_AUTH_SEC from the USER_CFG_FEAT_AUTH_REQ and the device will print a number on the UART which you should use in order to connect to the device. If for example you would like to have only the just works you will have to leave only the GAP_AUTH_BOND and define GAP_IO_CAP_NO_INPUT_NO_OUTPUT in the USER_CFG_FEAT_IO_CAP definition.
The USER_CFG_FEAT_INIT_KDIST is for declaring which keys should be involved in the distribution during the pairing method.
The .app_on_tk_exch_nomitm is the app_on_tk_exch on the new SDK, user_app_on_paring_succeded and user_app_on_encrypt_req_ind have been replaced by the corresponding default functions.
So try running the SDK 6.0.6 and the ble_app_security as is, with the tips i provided above you should be able to perform the legacy pass key entry scheme, if that is what you are looking for.
Thanks MT_dialog