Bluefruit.setName("Test") is writable

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Post Reply
User avatar
holgus
 
Posts: 2
Joined: Wed Jun 29, 2022 2:31 am

Bluefruit.setName("Test") is writable

Post by holgus »

Is there a possibility to set the peripheral Device Name, which is set with

Code: Select all

Bluefruit.setName("Test")  
, to non-writable?

Currently I can change the name, but that is a problem for the planned app.
Thanks a lot.
Attachments
Screenshot 2022-06-30 234125.png
Screenshot 2022-06-30 234125.png (127.21 KiB) Viewed 60 times

User avatar
mikeysklar
 
Posts: 8139
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bluefruit.setName("Test") is writable

Post by mikeysklar »

Good question. I suspect there are some mask pins or something buried in the library to make the BLE name non-writable.

Are you using a nRF52 based board or other Adafruit BLE device? Which specific model ada#?

User avatar
holgus
 
Posts: 2
Joined: Wed Jun 29, 2022 2:31 am

Re: Bluefruit.setName("Test") is writable

Post by holgus »

I am using the Adafruit Feather nRF52840 Sense.
https://learn.adafruit.com/adafruit-feather-sense

User avatar
mikeysklar
 
Posts: 8139
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bluefruit.setName("Test") is writable

Post by mikeysklar »

I'm still not sure the best way to change the BLE device name to non-writable, but I did dig up some clues.

First one from the nRF52 Nordic forum:
And last, how do I configure the profile/characteristic/etc for making the Device Name characteristic read only?
Set CONFIG_BT_DEVICE_NAME_GATT_WRITABLE=n
https://devzone.nordicsemi.com/f/nordic ... -read-only

Then you can see this structure where *p_value is pointing to:

volatile memory (RAM) == writable
non-volatile (flash) == non-writable

Code: Select all

typedef struct
{
  ble_gap_conn_sec_mode_t  write_perm;   /**< Write permissions. */
  uint8_t                  vloc:2;       /**< Value location, see @ref BLE_GATTS_VLOCS.*/
  uint8_t                 *p_value;      /**< Pointer to where the value (device name) is stored or will be stored. */
  uint16_t                 current_len;  /**< Current length in bytes of the memory pointed to by p_value.*/
  uint16_t                 max_len;      /**< Maximum length in bytes of the memory pointed to by p_value.*/
} ble_gap_cfg_device_name_t;
https://github.com/adafruit/Adafruit_nR ... ap.h#L1426

Post Reply
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”