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

Implicate blinky in relay example

Hey,

I'm currently doing the relay example on the nordic info centre. I'm trying to manipulate the example so that I can transform it into a range extender.

The goal here is to get one peripheral blinky to connect to relay and the relay to connect to the central. In result will have peripheral send signal directly to central with a range extender (relay)

In the relay example I need call, set the blinky example.

infocenter.nordicsemi.com/index.jsp

I noticed in the above website is that I need to call these functions. Can someone show me how to call these functions in the relay example and make it the relay connect to a central/peripheral?

Parents
  • My suggetion is:

    • Start with the ble_app_blinky_c central code
    • Add advertising from the peripheral code
    • Add service setup from the peripheral code
    • Inside lbs_c_evt_handler() when receive BLE_LBS_C_EVT_BUTTON_NOTIFICATION, instead of printing out on UART, you send a notification , like what we have in the button_event_handler() in the peripheral code (where we call ble_lbs_on_button_change() ). This will forward the notification from the peripheral to the central via the relay.
    • On the opposite direction, you implement led_write_handler() in your relay code so that instead of setting the LED on or off you send a ble_lbs_led_status_send() like what you have in the button_event_handler() in relay code. Of course you need to remove button_event_handler() in the relay code.

    That's it. I think above is the fundamental that you can follow to create your own relay code. Please also refer to what we have inside the relay example.

Reply
  • My suggetion is:

    • Start with the ble_app_blinky_c central code
    • Add advertising from the peripheral code
    • Add service setup from the peripheral code
    • Inside lbs_c_evt_handler() when receive BLE_LBS_C_EVT_BUTTON_NOTIFICATION, instead of printing out on UART, you send a notification , like what we have in the button_event_handler() in the peripheral code (where we call ble_lbs_on_button_change() ). This will forward the notification from the peripheral to the central via the relay.
    • On the opposite direction, you implement led_write_handler() in your relay code so that instead of setting the LED on or off you send a ble_lbs_led_status_send() like what you have in the button_event_handler() in relay code. Of course you need to remove button_event_handler() in the relay code.

    That's it. I think above is the fundamental that you can follow to create your own relay code. Please also refer to what we have inside the relay example.

Children
No Data
Related