This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

Sending data

Hi all,

I have a small question. If a GATT server needs to send data to a GATT client(about 65 bytes), does it have to create a service first and then adds characteristic, or it can use directly sd_gap_gatts_hvx function()?

Regards,

mohBOSS.

Parents
  • Hi there,

    You will need to add a service and a characteristic to send arbitrary data. Once you have the handle to the characteristic you can use sd_ble_gatts_hvx() to send data. Alternatively, if it's easier for you, you can add the service and characteristic on the peer device and use sd_ble_gattc_write() to send data, acting as a GATT client.

    Carles

  • Hi, please I have some questions.

    1. When adding a service then a characteristic, this enables the SoftDevice to send BLE events to the application whenever a client wants to use the characteristic. Is that right ?
    2. If a client wants to read data (without authorization) from the server, then how can the server use sd_ble_gatts_hvx() if there is no event generated for a Read Request without Authorization to notify the application?

    I hope that you understand me. Thanks a lot.

    mohBOSS.

Reply
  • Hi, please I have some questions.

    1. When adding a service then a characteristic, this enables the SoftDevice to send BLE events to the application whenever a client wants to use the characteristic. Is that right ?
    2. If a client wants to read data (without authorization) from the server, then how can the server use sd_ble_gatts_hvx() if there is no event generated for a Read Request without Authorization to notify the application?

    I hope that you understand me. Thanks a lot.

    mohBOSS.

Children
No Data
Related