This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

connection handle values in central role

are connection handles assigned sequentially in central role, up to the maximum number of connections (which is 3, i believe)???

said another way, will the connection handle *always* have the value 0, 1, or 2 if a (new) link has been successfully established???

in short, my app will be maintaining multiple connections simultaneously and i'd like to use the connection handle as an index into an array of per-link data structures

thanks,

bob.

  • Hi there,

    I want to do the same as Bob.

    I want to periodically establish a new connection to a maximum number of ten slaves. Limitied to three connections at a time, of course. I think there are a few logical mistakes in my program so far, but just to exclude this source of error I want to know more about the connection handle.

    At the moment I pair to 10 specific devices whoose addresses I store in an array of structs.

    Any time a connection is established I compare the address from tpEvent->linkCmpl.devAddr with my stored addresses. Then I store the connection Handle from tpEvent->linkCmpl.connectionHandle to the same array.

    Every time the GAP or GATT Layer sets an event I look for the used connection handle and decide what to do next with the handle and the state of the connected device.

    Is this procedure correct, or does the connection Handle change e.g. when another connection is dropped?

    I also got another question:

    My goal is to read up to ten sensor values from 10 slave devices. Every sensor should be refreshed every 100ms.

    I've got two approaches to afford this. First idea is the above described procedure with up to 3 parallel connections.

    But since the connection interval must be way more longer than for serial connections the second approach is to serially connect to the devices.

    Data is read in a multiple read request/response and fits in one data packet. Connections must be established - broadcasting is no alternative.

    Does anybody have experience with a project like mine? Maybe you could tell me which way is the better!

    Best regards

    Soenke