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

BLE - NUS and characteristics

Hi,

I'm little confused regarding BLE NUS and characteristics.

I know that the characteristics are used to expose data, but we also have BLE nus which is used to send and receive data.

Is there any connection between them?

Do they use the same way to send and receive the data?

Thanks!

Parents Reply
  • Thanks, the video is very helpful!

    After watching the GATT part of the video, I didn't understand how does the attributes which represents service/characteristics are sent to the client.

    For example - if we have the heart rate service - how does it send its attributes and rate data? How often? Does it send the whole attributes in the same message (service, characteristics, value, descriptors)?

Children
  • Roei said:
    the video is very helpful!

    I am happy to hear that! :)

    Roei said:
    I didn't understand how does the attributes which represents service/characteristics are sent to the client.
    Roei said:
    For example - if we have the heart rate service - how does it send its attributes and rate data? How often? Does it send the whole attributes in the same message (service, characteristics, value, descriptors)?

    When the a connection is made, the GATT client will initiate attribute discovery of the GATT server, to learn what the GATT server is offering (what profiles, services and characteristics it exposes).
    You can read more about this in the Attribute Discovery section of this blogpost(almost at the bottom).

    Best regards,
    Karl

  • OK, now it's more cleared, thanks!

    What about changes in the values? Let's say - a temperature value which is changed from time to time - how does the server sends this update to the client?

  • Roei said:
    OK, now it's more cleared, thanks!

    Great! :)

    Roei said:
    What about changes in the values? Let's say - a temperature value which is changed from time to time - how does the server sends this update to the client?

    Normally, the client have to poll the characteristics it would like to see, by reading them from time to time. This might however lead to a lot of unnecessary long transmissions, because the value has not changed.
    This is where notifications and indications comes into play. By enabling notification on a characteristic, the client asks the server to notify it whenever the value changes. 

    You can read more about notifications and indications here.

    Best regards,
    Karl

Related