client side example of LBS using NCS

Back in SDK 17 or so there were code samples for both the client and server side of the LED button service.

What happened to the client/central example when you migrated to NCS?  Is it still available under a different name?

I'm trying to run an nrf5340 as the central (in a dual role setup).  I'd like to call LBS specific discovery functions (i.e. bt_lbs_client_handles_assign() and bt_lbs_client_subscribe_button()) but they don't appear to exist..

Searching the internet, I see examples (likely from old SDK versions) that want me to include <client_LBS.h>  but this file does not exist in the ncs\v3.2.1 directory structure anywhere.

I'm running NCS v3.2.1 in VScode 

Note: your AI assistant directed me the the NUS central example, but it calls bt_nus_handles_assign and bt_nus_subscribe_receive which are exactly the analogous calls I'd like to make for LBS

Parents
  • I did not find the LBS peripheral example helpful for making a central  implementation.

    So the answer is to write my own LBS_Client.  Since my end goal is to migrate from a (working) example of LBS client to a custom service, can I expect to be able to write an entirely custom service client based off NUS_Client or are there assumptions about how a service is organized that I must comply with?

    Also, note, this central is actually a dual role nrf5340 that serves as a peripheral to an upstream host.  Does that change which example I should work with?

  • Hi Dan

    I used Vibe coding (copilot github chat on vs code) to get LBS Central. For some reasons, I named it blinky (as it reminds the nrf Blinky app from nordic, which also implements a central LBS). 

    I tested on NCS 3.2.4 and with two nRF54L15DK. button works in both directions (pushing Button 0 on either DK will trigger an LED on the other DK). 

    The zip includes the code for central. For peripheral LBS, use the one in the SDK. 
    I cannot guarantee it builds on nRF53, and given this is done by AI, take it with a grain of salt.

    I hope it helps. Please also see our DevAcademy Bluetooth course where we show how to build custom service.

    BR
    Lorenzo 

     blinky_central.zip

  • Thank you,  
    This application seems to do what a central_lbs sample would do. It scans for a device advertising with the LBS UUID, connects to it, enables notifications, and it can send data back to the peripheral_lbs.

    Best regards,

    Edvin

Reply Children
No Data
Related