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

Handle whitelist restriction in iPhone IOS application

Dear Developer Zone,

I am working with nRF51822 and IOS.

My device can only be connected to one central, so to one iPhone. To refuse connection from others centrals, I am using the whitelist functionality which is working well from SDK 5.X and softdevice 6.X.

But, when a central not in the whitelist is trying to establish a connection with the nRF51822, the connection is just refused without error.

In others words, I cannot manage to properly handle a whitelist connection exclusion to display a notification in my IOS app that this iPhone cannot be connected to this peripheral due to a whitelist restriction.

Do you have any idea?

I know that is not a nRF51822 problem, but is there a specifc error code or error type sent by the chip that I could handle in the iPhone app?

Parents
  • When doing a quick test of this, I seem to be getting back error 10 from iOS (7.1 at least); "The connection has failed unexpectedly." I'm not sure I would rely on this error code though, as based on the Specification, I would expect to get Connection Failed to be Established (0x3E).

    An alternative to relying on the error code could perhaps be to check the time it takes from you call connect until you get the error. In the case of whitelist failing, that will be short (i.e. < 200 ms), which shouldn't really be sufficient for a lot of other errors to happen.

Reply
  • When doing a quick test of this, I seem to be getting back error 10 from iOS (7.1 at least); "The connection has failed unexpectedly." I'm not sure I would rely on this error code though, as based on the Specification, I would expect to get Connection Failed to be Established (0x3E).

    An alternative to relying on the error code could perhaps be to check the time it takes from you call connect until you get the error. In the case of whitelist failing, that will be short (i.e. < 200 ms), which shouldn't really be sufficient for a lot of other errors to happen.

Children
Related