This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

changing the BLE device name, BLE service and GATT Characteristics dynamically

Hi, I am using nRF52832 module (GAP peripheral, GATT server) with nRF5SDK, ble_app_uart_pca10040_s112 application.

I need some help on dynamically changing the BLE device name, BLE service and GATT Characteristics.

What I tried:
In main(), I initialized only the UART module. Once UART is up, the nRF module receives data from an application chip (MCU).
In uart_event_handle function, I use a function call to process the received data and set the BLE device name accordingly, inside this function call I am initializing BLE stack, GAP parameters, GATT Init, Services Init followed by BLE advertisement.

This way, I was successfully able to set BLE device name and Services dynamically. However, after few minutes of communication with a GATT client, incorrect/incomplete data is being transmitted to that peer device.

Is it good to initialize BLE this way? If not, what should be done?

Also, I have found few of the forum discussions on how to change the BLE Device name in run time, but not seen anything related to changing GATT characteristics dynamically.
Please help, Thank you in advance.

Parents
  • Hi,

    It is possible to add BLE service and characteristics dynamically, but it is not possible to remove them. It is required to send a service change notification to let the gatt client know that the attribute table has been updated.
    Regarding the device name, it is possible to change device name using sd_ble_gap_device_name_set().

    Best regards,
    Dejan

  • I would like to mention that I wanted to change the BLE service and characteristics dynamically so that nRF module connects with different GATT client in run time. In this case, may I know how service change notification would help? Please share any references if possible.

    What I tried:
    In main(), I initialized only the UART module. Once UART is up, the nRF module receives data from an application chip (MCU).
    In uart_event_handle function, I use a function call to process the received data and set the BLE device name accordingly, inside this function call I am initializing BLE stack, GAP parameters, GATT Init, Services Init followed by BLE advertisement.

    This way, I was successfully able to set BLE device name and Services dynamically. However, after few minutes of communication with a GATT client, incorrect/incomplete data is being transmitted to that peer device.

    Is it good to initialize BLE this way? If not, what should be done?

    Also, I would like to know if this method which I followed is correct or not. 

    Please help, Thanks.

  • Hi,

    Could you be more specific about your use case? Is there a specific reason why you need to do it dynamically?

    I have added the use case in this nRF_usecase document, please check. Thank you.

  • Hi,

    In addition to the name, could you provide more information about service and characteristics?
    How do you want to change characteristics dynamically and when (in relation to the reset)?

    Best regards,
    Dejan

  • Hi,

    I have added additional information on how I'm changing services and characteristics w.r.t reset in this updated_pseudocode text file. Kindly check.

    Thank you!

  • Hi,

    Your case has been looked into internally. I'll get back to you when I get new information.

    Best regards,
    Dejan

  • Okay, sure. Thank you for the support!

Reply Children
Related