This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

what API functions to use in this Bluetooth mesh application?

I am very new to Nordic boards, so my apologies first for my ignorance.I recently bought Nrf52840 boards and I want to build a very simple Bluetooth mesh application but I am overwhelmed with the amount of information in the documentations.

What I want to do

I simply want to have one board act as a master and 3 or more other boards acting as slaves. Each slave will have 4 buttons and upon pushing one button on the slave,a message(button number ) should be sent to the master.So basically the master will only receive messages from slaves when a button is pushed on slaves.For example if i have 3 slaves A,B and C, if i push button 3 on slave B i should get a message 3( string or int doesn't matter) on master node.

Question

I have tried to go through the API reference but there is so much information, and I still I don't know which API functions to use. Can someone guide me on a high level this,(leaving provision part out) which API functions should I use for this task.If somebody can provide a simple sketch that would help me  get started, I would greatly appreciate it.

Thank you in advance

Parents Reply Children
  • I'm sorry, but I don't have any high-level guide for our API nor any tutorials (strangely). I would, however, given that you are new to the boards, recommend having a look at NovelBits tutorial on Mesh. It covers theory in the first three parts and then goes over to our SDK from part four. 

    If you find out that mesh is not the way to go, then I recommend looking at our SDK documentation which includes other examples (maybe more or less fitting). Also, have a look at this thread. But you must be aware that SDK for Mesh uses models instead of services in BLE (standard SDK).

  • Thank you but, I  already went through that Novelbits tutorial,my apologies I should have mentioned in my previous post.

    Let me make the question very specific, in Light switch example, generic_onoff_client_set function in client publish the message to the server model in On/Of (0/1) fashion, so not sure if that is enough for what I want. What function would I use to publish a  message string say "abc"  to the server model? And on the server model (subscribing to that particular address) what API function would I use to get the message sent by the client?

  • Next week, week 15 will have less staffing due to Easter Holiday. You may expect a delayed answer from the support team.


    davidm said:
    Thank you but, I  already went through that Novelbits tutorial,my apologies I should have mentioned in my previous post.

     Ok, I see. No worries, then you have the basic knowledge about the Mesh SDK.

    davidm said:
    What function would I use to publish a  message string say "abc"  to the server model? And on the server model (subscribing to that particular address) what API function would I use to get the message sent by the client?

    You have to change the following in

    models\model_spec\generic_onoff\include\generic_onoff_common.h

    /** Structure containing value of the OnOff state */
    typedef struct
    {
        //bool on_off;                                            /**< State to set */
        uint8_t on_off;
        uint8_t tid;                                            /**< Transaction ID */
    } generic_onoff_state_t;
    
    /** Mandatory parameters for the Generic OnOff Set message. */
    typedef struct
    {
        //bool on_off;                                            /**< State to set */
        uint8_t on_off;
        uint8_t tid;                                            /**< Transaction ID */
    } generic_onoff_set_params_t;


    Also, have a look at these files

    examples\common\include\app_onoff.h
    examples\common\src\app_onoff.c


    Unfortunately, I have not been able to test it yet due to the support load. 

Related