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

which works better: a single bi-directional GATT characteristic or two uni-directinal GATT characteristics?

Which works better:

  1. a single GATT characteristic using 'write without response' for transmission from the central to the nRF51822/S110 peripheral and 'notifications' on the same characteristic for transmission from the nRF51822/S110 peripheral back to the central? or
  2. two characteristics, one using 'write without response' for transmission from the central to the peripheral and a second characteristic using 'notifications' for transmission from the peripheral back to the central? (This is what was done in the NORDIC BLE UART service example. Why?)

This is not a 'discussion' question. hopefully the NORDIC monitor will step in and clarify the issue base on knowledge of the S110 soft device internals.

  • Hi Joestraney,

    I would need to have more clarification on what "better" mean.

    Regarding the through put, two approach has the same through put.

    The first approach has smaller memory size when only one characteristic needed.

    However, with the first approach, it's hard to keep track of what should be in the value of the characteristic. What should be returned when you call sd_ble_gatts_value_get() ? It will be the value of the last command either the notification command or the write command.

    If you only base your application on the events and doesn't care about the value in the characteristics. It's fine to follow approach one, and save some (little) memory.

    If you need to read back the value at some points, it's better to do it with 2 separated characteristics.

  • Very good. Your assumption as to the meaning of "better" was exactly the meaning I intended.

    You looked at and answered all relevant sides of the question. I consider the question closed. Thanks.

    joestraney

  • @joestraney: My pleasure. You can accept the answer by click on the check button next to the answer. You can also close the case with the close button on the question.

    I already done that for you.

Related