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

Best example project to adapt to my application? peripheral to peripheral connection with individual bonded centrals

Hello all,

I'm curious if anyone could lend some thoughts.

I'm just in the research stage and going through a few examples but getting a little overwhelmed.

I'm trying to have two devices connected to their own phones and one is receiving and one is transmitting advertising data, and when the connection is established between the devices each device updates their host. this can be through a ble uart app on the nrf toolbox. 

Is there a example that is more suited to this application I can learn from? or should i Frankenstein the ble_uart example to support a  new peripheral connnection?

Thanks for the help!

Parents
  • Hi George, 

    I don't see any problem with your solution. You can find in our ble_central_and_peripheral examples we do similar task. 

    Another option is to use proprietary RF protocol (ESB for example) to connect between two devices. You can have BLE and ESB concurrently. You can have a look here. This is only needed if you find that you don't want to have BLE communication between your two device. For example, if you don't want to establish connection between two devices, or if you have several devices you want to communicate. 

Reply
  • Hi George, 

    I don't see any problem with your solution. You can find in our ble_central_and_peripheral examples we do similar task. 

    Another option is to use proprietary RF protocol (ESB for example) to connect between two devices. You can have BLE and ESB concurrently. You can have a look here. This is only needed if you find that you don't want to have BLE communication between your two device. For example, if you don't want to establish connection between two devices, or if you have several devices you want to communicate. 

Children
  • Hi Hung, thanks for the quick answer, one quick followup though, If i have an open ble uart connection how does that impact the role of advertising and receiving at the same time?   what function of the software handles the order of accepting and listening while a simultaneous connection is happening?  i guess im a bit confused on if it's an automatic process or if i have to manually close other connections first before starting to scan or bodcast?

  • Hi George, 

     

    Our softdevice will handle that for you. We have a scheduler inside the softdevice that can handle up to 20 connections at the same time. It's all automatic, just start advertising/scanning after you established a connection. 

     

  • Hi Hung,

    Decided to jump back on this.

    So I've got a central and peripheral relay example gutted, and it's acting as a central to my other peripheral device. this central finds a peripheral name and waits until its rssi value is high enough to send a message to the host.

    My issue now, is that I've added the BLE_UART example code (without changing anything)  into it and while I am connecting I can recieve UART data but I cannot seem to send any characters to a phone. when debugging I can see that it is trying to execute a (ble_nus_string_send) but nothing shows up on the phone uart viewer.  I'm not able to get any data over bluetooth it seems.

    additionally the added blue_uart example code seems to have taken over my advertising and scanning, only whne i manually disconnect the ble uart connection from the phone does the program resume with central responsibilities..   you mentioned a scheduler above, is that something I have to be modifying to get it to have a simultaneous BLE uart connection as well as scanning for other devices?

    Thanks Hung.

Related