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
  • Hello,

    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?

    Yes, BLE NUS is actually short for BLE Nordic UART Service, which implements a service with two characteristics simulating the RX and TX pins of a physical UART interface. You can see the BLE NUS demonstrated in the BLE NUS example from the SDK.
    The service contains the two characteristics which are used to actually exchange the information between the devices, by notifying data on the two RX and TX characteristics.

    Please do not hesitate to ask if anything still should be unclear, or if you have further questions!

    Best regards,
    Karl

Reply
  • Hello,

    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?

    Yes, BLE NUS is actually short for BLE Nordic UART Service, which implements a service with two characteristics simulating the RX and TX pins of a physical UART interface. You can see the BLE NUS demonstrated in the BLE NUS example from the SDK.
    The service contains the two characteristics which are used to actually exchange the information between the devices, by notifying data on the two RX and TX characteristics.

    Please do not hesitate to ask if anything still should be unclear, or if you have further questions!

    Best regards,
    Karl

Children
  • Thanks for your answer, it helps me a lot!

    Actually - I have another question:

    What about other characteristics which are discovered by other side? How can they be transmitted if not via BLE NUS?

  • Roei said:
    Thanks for your answer, it helps me a lot!

    No problem at all, I am happy to help! 

    Roei said:
    What about other characteristics which are discovered by other side? How can they be transmitted if not via BLE NUS?

    I am not sure that I understand your questions here. Could you elaborate?
    The services and characteristics are discovered during the "service discovery" phase of the connection, and afterwards the devices may for example enable notification on a characteristics (such as done in the BLE NUS examples). Notifications / notify means that the connected device will be sent the new value of the characteristic any time it is updated.

    Best regards,
    Karl

  • I think the service discovery is the thing I don't understand well.

    How does it happen? Does the Nordic device transmit those services via data channels, so they will be discovered? Or via advertisement channels? Should the other side ask for the Nordic device to transmit this data?

    Thanks!

  • Roei said:

    I think the service discovery is the thing I don't understand well.

    How does it happen?

    The discovery of services and characteristics happens the same way as most other exchanges in the BLE communication - one of the devices sends a request packet to the other device, which fulfills the request by providing information about its services and characteristics. This is done until the entire GATT database has been discovered.
    This sequence diagram shows how the exchanges for discovering characteristics work, for example.

    Roei said:
    Or via advertisement channels?

    Service and characteristics discovery does not happen on the advertising channels, no. This only happens when already in a connection.
    The primary thing transferred on the advertisements channels is advertisements, scan responses, scan requests and connection requests.

    Roei said:
    Should the other side ask for the Nordic device to transmit this data?

    Yes, the central device will need to initiate the discovery, like shown in the message sequence charts I referenced earlier.
    You can see this done in most of the central examples from the SDK as part of the BLE_GAP_EVT_CONNECTED event handler.

    Best regards,
    Karl

  • Does discovery service related to NUS or device information service? Or is it a separate service which doesn't need to be declared?

    Thanks!

Related