Services and Characteristics

Hi there,

First of all I have to say that I am new to BLE technology development. I tried something using your tutorial and I think I succeeded. 
The board can advertise with 128bit UUID. I can send and receive data using nrf connect app. I have no problem so far.
But something does not fit in my head.
What are services and characteristics?
Why do we need them? I mean why we do not send the data directly?
Do we have to add at least one characteristic in a service?
Last but not least, how many byte can we send in one characteristic?
 
Thanks in advance.
Parents
  • Hi,

    What are services and characteristics?
    Why do we need them? I mean why we do not send the data directly?
    Do we have to add at least one characteristic in a service?

    I suggest this short intro to Bluetooth services and characteristics. You do need at least one characteristic in a service, yes. A service is a collection of characteristics. All data is communicated sent/received or read/written via a characteristic.

    Last but not least, how many byte can we send in one characteristic? 

    The Nordic SDK's contain a custom BLE service called the Nordic UART Service, which is a simple data channel. If that is what you want, I suggest you refer to these examples. For peripheral side, that would be Bluetooth: Peripheral UART if using the nRF Connect SDK, and UART/Serial Port Emulation over BLE if using the older nRF5 SDK.

    This depends on several factors, like the capabilities of the two devices communicating and the configuration. Also, it depends on which layer in the protocol stack you are looking at. The absolute maximum size of a characteristic is 512 bytes. however, if you want data in a single link layer packet, and use data length extension, the maximum number size of the GATT packet is 247 bytes, giving you 244 as the maximum user data payload. If you need to send more data, send more packets (as notifications, if you want to maximize throughput / minimize overhead).

Reply
  • Hi,

    What are services and characteristics?
    Why do we need them? I mean why we do not send the data directly?
    Do we have to add at least one characteristic in a service?

    I suggest this short intro to Bluetooth services and characteristics. You do need at least one characteristic in a service, yes. A service is a collection of characteristics. All data is communicated sent/received or read/written via a characteristic.

    Last but not least, how many byte can we send in one characteristic? 

    The Nordic SDK's contain a custom BLE service called the Nordic UART Service, which is a simple data channel. If that is what you want, I suggest you refer to these examples. For peripheral side, that would be Bluetooth: Peripheral UART if using the nRF Connect SDK, and UART/Serial Port Emulation over BLE if using the older nRF5 SDK.

    This depends on several factors, like the capabilities of the two devices communicating and the configuration. Also, it depends on which layer in the protocol stack you are looking at. The absolute maximum size of a characteristic is 512 bytes. however, if you want data in a single link layer packet, and use data length extension, the maximum number size of the GATT packet is 247 bytes, giving you 244 as the maximum user data payload. If you need to send more data, send more packets (as notifications, if you want to maximize throughput / minimize overhead).

Children
No Data
Related