GTL over UART - Device Name set in both host and DA1458x code (host_proxr_sdk / prox_reporter_ext)

8 posts / 0 new
Last post
abremen
Offline
Last seen:4 years 2 months ago
加入:2015-02-10 17:44
GTL over UART - Device Name set in both host and DA1458x code (host_proxr_sdk / prox_reporter_ext)

Dear support,

I have ported over the host code (GTL over UART) from project host_proxr_sdk from the DA1458x SDK 5.0.3 (folder DA1458x_SDK\5.0.3\projects\host_apps\windows\proximity\reporter\host_proxr_sdk), and I have built and loaded project prox_reporter_ext into the DA14580 without making any modifications at all (folder DA1458x_SDK\5.0.3\projects\target_apps\ble_examples\prox_reporter_ext\Keil_5).

In function app_adv_start (app.c) the device name is set (APP_DFLT_DEVICE_NAME, i.e. "FE_PROXR"). For completeness sake I must mention that I did not port over the conditional code sections within this function (NVDS_SUPPORT, BLE_APP_HT, BLE_APP_NEB).

Everything works as expected; When I use an App (Android phone), as for example BlueLoupe or BLE Scanner, I can see the FE_PROXR device popping up. However when I connect to the device and read the Generic Access service Device Name attribute, I get "DIALOG_PRXR". I recognized this value from #define USER_DEVICE_NAME within file user_config.h of project prox_reporter_ext.

Is this behaviour as intended? To me it seems strange that I would have to set the device name in both host code and DA1458x code. This means that both projects have to be touched whenever I want to update the Device Name and thus a mismatch can easily occur. If this is by design, can you please explain why? I would rather only set the Device Name once, from the host code.

Looking forward to your response.

Kind regards,
Arjan

Device:
MT_dialog
Offline
Last seen:1 week 5 days ago
Staff
加入:2015-06-08 11:34
Hi abremen,

Hi abremen,

设备名称是different from the name in the advertising string, this is done on purpose for no particular reason. If you want to change this you can alter the device name in the GAP server before advertising by using the command GAPM_SET_DEV_NAME_CMD. You can find more info about the command in the RW_BLE_GAP_IS.pdf

Thanks MT_dialog

abremen
Offline
Last seen:4 years 2 months ago
加入:2015-02-10 17:44
@MT_dialog

@MT_dialog

Thanks, just what I needed :-). I will implement the command asap and let you know the result.

Kind regards,
Arjan

abremen
Offline
Last seen:4 years 2 months ago
加入:2015-02-10 17:44
@MT_dialog

@MT_dialog

I just implemented the GAPM_SET_DEV_NAME_CMD and everything functions as expected.

In the GAPM_SET_DEV_CONFIG command complete event (of the GAPM_CMP_EVT message) I send the GAPM_SET_DEV_NAME_CMD, in the GAPM_SET_DEV_NAME command complete event I then send the application state to CONNECTABLE, wait for 100ms and send a GAPM_START_ADVERTISE_CMD message to start advertising (in other words, the code that was previously handled in the CMP_EVT handler of the GAPM_SET_DEV_CONFIG command).

I was just wondering whether or not I should change the order, so set the DEV_NAME first and then the DEV_CONFIG. As this same sequence is re-initiated at disconnect, by the handler of the GAPC_DISCONNECT_IND message (send a GAPM_SET_DEV_CONFIG_CMD message to TASK_GAPM to (re)set the device configuration, and now the device name as well).

Thanks,
Arjan

MT_dialog
Offline
Last seen:1 week 5 days ago
Staff
加入:2015-06-08 11:34
Hi abremen,

Hi abremen,

I cant see any difference in sending the commands in reverse order.

Thanks MT_dialog

abremen
Offline
Last seen:4 years 2 months ago
加入:2015-02-10 17:44
Hi MT_dialog,

Hi MT_dialog,

Perhaps I should have explained myself better :-). What I meant was am I supposed to reset the device name as well on disconnect, as in the host example (Windows) project for the proximity reporter in function gapc_disconnect_ind_handler the GAPM_SET_DEV_CONFIG_CMD message is sent again. When I reverse the order on startup (so device name first, then device config), the device name is no longer (re)set on disconnect.

In other words, can you please explain the purpose of resending the device config on disconnect and would you advise to resend the device name as well on disconnect?

Kind regards,
Arjan

MT_dialog
Offline
Last seen:1 week 5 days ago
Staff
加入:2015-06-08 11:34
Hi abremen,

Hi abremen,

There no specific reason for sending the GAPM_SET_DEV_CONFIG_CMD command in the disconnection event. The device name will stay the same when the device disconnects, you dont have to sent the GAPM_SET_DEV_NAME command again unless you reset the peripheral after disconnection. If you reset your device will go back to the name that has in firmware.

Thanks MT_dialog

abremen
Offline
Last seen:4 years 2 months ago
加入:2015-02-10 17:44
Thanks for the explanation.

Thanks for the explanation. You may close this topic now.

Kind regards,
Arjan

Topic locked