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

Set up specific BLE devices to communicate either without pairing or with automaticly pairing

Hello. I have several nRF51 devices (nRF51 Dongle, pca10031) I wish to use as BLE link between robots.

  1. Is there any examples or tutorials that show how I can do this without having to pair the devices manually using some sort of software first?

  2. I was thinking about hard coding the addresses in but I am not sure if this is the best solution or even feasible?

  3. What would be the best option, broadcast to all or send to specific device?

Edit: I am not bound to use BLE, I can use the radio "alone" as well

Parents
  • The robots would be peripherals and the pc would be a central device.

    So you can put some information in the advertising packets that the central will recognize.

    It could be the addresses of the peripherals, one or more UUIDs, one or more device names, or something else.

  • Sure. That works, I just thought it would be easier to have one application.

    You can use one of the methods in my answer to connect to the robots. After your are connected the connections are identified with the connection handle that you get with the BLE_GAP_EVT_CONNECTED event, and this is what you use for further communication. So you can just tie the connection handle together with the device addresses. When you send a command you would know what connection handle to use if you get match on device address in your switch statement. And when you get data from a robot, you can use the connection handle to identify the which robot it comes from, because you know the device address.

    Sending and receiving data over the links every 200 ms for three links shouldn't be a problem. It depends on the amount of data of course.

Reply
  • Sure. That works, I just thought it would be easier to have one application.

    You can use one of the methods in my answer to connect to the robots. After your are connected the connections are identified with the connection handle that you get with the BLE_GAP_EVT_CONNECTED event, and this is what you use for further communication. So you can just tie the connection handle together with the device addresses. When you send a command you would know what connection handle to use if you get match on device address in your switch statement. And when you get data from a robot, you can use the connection handle to identify the which robot it comes from, because you know the device address.

    Sending and receiving data over the links every 200 ms for three links shouldn't be a problem. It depends on the amount of data of course.

Children
No Data
Related