Setting up a custom GATT Client

Hello! 

I have a GATT Server in the form of a nrf52840-DK that has been given to me from a company that has a custom service on the server using CCCD. I have the full documentation of the service so all necessary information is available there for me.
However they want me to create a GATT Client, as a part of a thesis work, with another nrf52840-DK to handle the incoming data.
Since I am very new at this I am not really sure what to look for in terms of how to develop this, what is the correct way to do this? Is it called setting up a custom service or what is this called?

I have already finished the BLE academy course so I am somewhat familiar with the terminology but I am not sure what exactly to search for in terms of guides/documentation/walkthroughs to solve this problem.

Thank you in advance for the help and feel free to ask me if something is unclear.

Parents Reply Children
  • Yes they are, I guess I was too much of a beginner to realize that when I was going through the tutorial.
    Final question:
    In my solution, the Server needs to accept Write without response from the client AND Notify the client.
    The client needs to notify the server and do a write without response to the server.
    Is there something special I need to think about when setting up the client and server for this solution?

    -Björn

  • Hi,

    You could keep in mind a few things. On the server side, you need to define the characteristics of your service to include both "Write without response" and "Notify". Please take a look at this ticket. On the client side, you need to use the bt_gatt_discover function to find the write characteristic, and then use bt_gatt_write_without_response to write to it. You also need to subscribe/enable notifications to receive the heartbeat message from the server. You can refer this ticket. Even with notifications and write(without response), there is acknowledgment on the link layer. So if a packet was not received, it will be re-transmitted.

  • Thank you again Priyanka! 
    I have figured most of this out during the weekend but one thing I keep struggling with is where in the attribute table I can find my value.
    So I had implemented the notify characteristic and everything worked fine when I have this function:


    , then I added a write without response and just added it in the service, changed NOTHING else and now the notification does not work anymore, meaning it does not send values.

    I am using the sample bluetooth peripheral and tried using this function to write without response: 


    I have read the Bluetooth academy course and I understand that the values are not sequential but how do I find where in the table the value is being stored?

  • Hi Bjorn,

    Sorry for the delay. Do you still have the issue?

    -Priyanka

Related