I'm looking for a way to let my device "nrf51822" to be connected only to my own mobile app.
I'm wondring if you have already a Nordic solution that I can use ? (tutorial, source code)
I'm looking for a way to let my device "nrf51822" to be connected only to my own mobile app.
I'm wondring if you have already a Nordic solution that I can use ? (tutorial, source code)
Hi,
I assume that your nRF51 device is going to be the peripheral and that your smartphone will act as central.
I do not know of any solution that lets a peripheral device choose to accept a connection from a central based on what software is running on that central. That kind of behaviour is not supported by the BLE specification. If you want a fully automatic solution I guess it will have to be built on top of BLE, based on some kind of negotiation after initial connection.
You can use directed advertising and/or whitelisting to make your peripheral only advertise to and/or accept connections from a previously known central. See this answer from yesterday. You can use whitelisting by default, but advertise without whitelisting for a short amount of time after the press of a button on the peripheral. This way the user can decide when the peripheral is allowed to pair and bond with new centrals.
You can let your smartphone app choose what peripherals to connect to based on information provided in the advertising packets, but this will not work the other way around as the central is not sharing any custom information as part of the connection request. Directed advertising and whitelisting are the only mechanisms for the peripheral to deny connection requests.
Others might have more ideas for what you can do.
Regards, Terje
Hi,
I assume that your nRF51 device is going to be the peripheral and that your smartphone will act as central.
I do not know of any solution that lets a peripheral device choose to accept a connection from a central based on what software is running on that central. That kind of behaviour is not supported by the BLE specification. If you want a fully automatic solution I guess it will have to be built on top of BLE, based on some kind of negotiation after initial connection.
You can use directed advertising and/or whitelisting to make your peripheral only advertise to and/or accept connections from a previously known central. See this answer from yesterday. You can use whitelisting by default, but advertise without whitelisting for a short amount of time after the press of a button on the peripheral. This way the user can decide when the peripheral is allowed to pair and bond with new centrals.
You can let your smartphone app choose what peripherals to connect to based on information provided in the advertising packets, but this will not work the other way around as the central is not sharing any custom information as part of the connection request. Directed advertising and whitelisting are the only mechanisms for the peripheral to deny connection requests.
Others might have more ideas for what you can do.
Regards, Terje