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

Which SD and Which Roles Do I Need?

I'm just getting started with the nRF51-DK, and I'm still confused about which SD I need to load, and which roles I need to support aka GAP and GATT.

My end application will look something like this. I will have my board installed inside another device, communicating with it via a serial connection, or in some cases, monitoring and controlling via digital I/O. There is a fairly wide range of devices my board could be installed in, but most are fairly similar. Most of the time, my board will just be monitoring the devices, not even collecting data. There will be several of these devices with my boards together within radio range.

At some point, a person will come in with a smart phone or tablet and open my app, and will be presented with a list of all of the devices within range that contain my board. They will be able to select one of those devices, read the current status of the device from my board, and based on that status give a command to my board that will then be passed to the device.

For this to work, my board has to ??advertise?? or ??broadcast?? its presence fairly frequently, which I think means my board should be a GAP Peripheral. Then the phone has to connect to it to read status and send commands, which I think means my board should be a GATT server.

To make things more complicated, multiple people with multiple phones should be able to be in the same area, and each get the same list of my boards, and each pick a device (but not a device someone else has picked until they have finished with it) and get the device's status and send commands to it.

Also, since mostly this is serial, but also because the digital I/O requires timed pulses, I have to be sure that when my board is communicating with a device that it isn't interrupted (which would break the serial data stream or mess up the timing of digital I/O).

So, is all of this possible, and do I have the right idea about which GAP and GATT roles I need? And if so, which SD do I need to use to implement this? Is S110 appropriate?

Thanks for any input.

Parents
  • There are four GAP roles, explained in Vol 3, Part C, Section 2.2.2 in Bluetooth Core Specification 4.2. These are related to the different states in the link layer, see Table 2.1-

    A Broadcaster can only advertise, while a peripheral can advertise and be in a connection (in the slave role).

    Your evaluation seems correct, you need a peripheral. The phone will be a central.

    There are two GATT roles, explained in Vol 3, Part G, Section 2.2 in the Bluetooth Core Specification 4.2.

    The device with the information is usually the server while the device that wants to access the information is the client, so you evaluation seems correct again, you need a server. The phone will be a client.

    SoftDevice S110 is our peripheral stack, so it is suitable, and most of the SDK examples also implement a server.

    A peripheral can be connected to multiple centrals (phones), but not at the same time. A central can be connected to multiple peripherals at the same time.

    Your interrupt requirement is more complicated. If you are in a connection, maintaining the link has high priority, so some connection events need to be handled, but it is usually not a problem. If you are not in a connection, it should certainly not be a problem, but it depends on the requirements of your serial communication. If you come into trouble on this, I recommend you to raise a separate question.

  • Thank you. This was very helpful. At the top level, the board should not need to talk to both the device and the phone at the same time, it should be more lockstep than that, but there may be lower level things going on with the radio that I don't know about. Hopefully the radio can retry, so that if I need to spend 50 or 100 ms sending a pulse to a device, the radio can recover from the interruption. Until I get farther with the evaluation board to test these things, I won't know for sure if this is a problem or not, and that's probably many weeks away.

    Jeff.

Reply
  • Thank you. This was very helpful. At the top level, the board should not need to talk to both the device and the phone at the same time, it should be more lockstep than that, but there may be lower level things going on with the radio that I don't know about. Hopefully the radio can retry, so that if I need to spend 50 or 100 ms sending a pulse to a device, the radio can recover from the interruption. Until I get farther with the evaluation board to test these things, I won't know for sure if this is a problem or not, and that's probably many weeks away.

    Jeff.

Children
No Data
Related