This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Device Name shows garbage using pc_ble_driver_py

Using pc_ble_driver_py (version 0.15.0) to create a peripheral with a specific Device Name in characteristic 0x2A00 (Generic access service), the resulting device name is garbage. The class "BLEConfigGapDeviceName" is used to try setting the device name in the following way:

This is the result in nRF Connect:

In the log window the following is seen:

Attribute value read, handle: 0x03, value (0x): D4-03-00-20-00-00-00-00-D0-1C

 

This is the complete file:

What am I doing wrong?

Parents Reply Children
  • Hello gnf,

    Thank you for your patience.

    gnf said:
    I found the function "sd_ble_gap_device_name_set". I created a pull request for implementing this feature in pc_ble_driver_py as using it seems to work:

    I am happy to hear that you were able to figure out a way to achieve this. Thank you for submitting the pull request, and sharing the complete code you used to produce this - this will make the debugging part much easier.

    gnf said:
    But then, when should sd_ble_gap_device_name_set be used and when should BLEConfigGapDeviceName be used?

    I've passed this question on to the developers of the pc-ble-driver-py, and I will let you know as soon as they get back to me on this.
    The pc-ble-driver-py is just a python layer for the the pc-ble-driver, which is a serialized version of the SoftDevice API. So, I suppose the difference here really comes down to either using the sd_ble_gap_device_name_set function directly, or using the sd_ble_cfg_set function - this is my initial though anyways, but we will know more once the developers gets back to me.

    Best regards,
    Karl

  • Hello again gnf,

    I just wanted to let you know that the developers in question is currently out of office this week for the national winter's break in Norway. They should be back again on Monday, and I will resume my discussion with them then.

    I will update you as soon as I heard back from them on this issue.

    Best regards,
    Karl

  • Ah, you have "Sportlov" just as we have in Sweden? Great! Hope you still have some snow left.

  • Hehe, yes - only here it is called Vinterferie, but I assume it is essentially the same thing - a vacation to go skiing other snow activities with family and friends! :)
    Unfortunately a lot of the snow disappeared the last few days, but otherwise the weather has been great. Hope it is equally as nice where you are! 

  • Hello again gnf,

    Thank you for your patience with this.

    I have now checked whether there is a difference behind the scenes between calls to sd_ble_gap_device_name_set and sd_ble_cfg_set, and their primary difference is that sd_ble_cfg_set is used to configure the SoftDevice (before the BLE part of the SoftDevice is enabled, as per its API Reference), while the sd_ble_gap_device_name_set may be used to update the GATT db directly, also after the BLE part of the SoftDevice is initialized.
    I also spoke with the lead developer Bjørn today, and he told me that he had been in contact with you directly last week, which was possibly also related to some of your other PR's, as I understood it.

    Did this and you talk with Bjørn answer your questions here, or do you still have any questions related to this?

    Best regards,
    Karl