iOS Bluetooth Device in pheripheral mode send request to one central device - ios

iOS Bluetooth Smart.
We have few central devices and one pheripheral devices. How to send from pheripheral device request to one of centrals?
iOS support something like "direct advertising"?

Bluetooth peripherals are supposed to be used as advertisers that the Centrals can find and connect to. Not the other way around. Basically you need to set up your peripheral with service/s that the Central is scanning for. After the central discovers the peripheral, it can then choose to connect, and then exchange additional data between the devices.
Check out the Bluetooth Developer Site for more information.

Related

How to clone BLE device (configurations,charcterstics etc)and share it with other

I am working on an app that gets data from the BLE device, I am able to code to get the app to connect with the BLE device. But further characteristics read is an issue as I don't physically have the device
i came across an app named nRF Connect for Mobile . It has the functionality to clone BLE if paired. the video for a BLE clone is shown here but export and import is not avaible
Is there any way I can get the BLE cloned say some configuration file, which then imported in certain app create then same BLE device .i can use to read all the characteristics and other properties
Why don't you just connect to the device in for example nRF Connect, write down the services, characteristics and descriptors you see (usually isn't that many). Then just set up a local GATT server with the same content.
If I understood your question and your video correctly, you would like to copy the advertisement data of a BLE peripheral and use it to advertise on an iOS device yourself.
Maybe CBPeripheralManager can help you do that.
You can call startAdvertising([String:Any]?) and advertise a BLE peripheral.
But iOS limits on a system level which keys you can advertise.
From a short look in the documentation, it seems only the keys
CBAdvertisementDataLocalNameKey
CBAdvertisementDataServiceUUIDsKey
are supported.
But if you'd want to include more information about your peripheral, you could still create an own CBMutableService "deviceInfo" and send information within a characteristic after having established a connection.

Can a single BLE central connect with multiple BLE peripherals via bluetooth low energy?

I am using core bluetooth framework in my iOS application project. I have following questions regarding bluetooth low energy-
Is it possible for a single central to connect multiple peripherals in iOS?
Can multiple central device connect with a single peripheral?
Can a single iOS device act as central as well as peripheral at the same time?
If yes, then what will happen if both of 2 such devices try to connect as central to each other?
Can we communicate via BLE when the app is in background?
Is it possible for a single central to connect multiple peripherals in iOS?
Yes.
Can multiple central device connect with a single peripheral?
That completely depends on whether the peripheral supports it (but for most common embedded devices, no).
Can a single iOS device act as central as well as peripheral at the same time?
Yes.
If yes, then what will happen if both of 2 such devices try to connect as central to each other?
They'll generally connect twice. In one connection, one will be central and one will be peripheral. In the other connection, the reverse. This is a pretty unusual way to design a system, but it is legal will often work, despite being illegal (see Youssif's comment below for reference).
Can we communicate via BLE when the app is in background?
Yes, within various restrictions.
Yes, it's possible to connect one Central to multiple Peripherals.
Not confirmed.But single Peripheral can connect only with one Central device and multiple Peripherals can connect with one Central.It means that Central can communicate with multiple Peripherals at the same time.
Yes, a single iOS device can work both as Central and Peripheral at the same time.
It communicates one by one.
Yes, we can communicate via BLE in background mode in iOS device.

Bluetooth identifier on iOS

See the image above. I am pairing my iOS app from iphone1 to a single Bluetooth device, say BT1, which is further inter-connected with other similar bluetooth devices via Bluetooth Mesh. As soon as I connect with BT1, I get a uuid1 for the connection.
Now, I need to uniquely identify the paired device uuid. This is essential as I would like to transfer my phone app settings to another iPhone, say iPhone2, via cloud, so that any phone can connect to the original paired BT device. But when I try to pair iPhone2 to Device1, I get a different uuid2 for Device1, because of which, I cannot match it with the uuid1. So if uuid1 = uuid2, then the cloud will send me the original settings.
Question -
1. is it technically possible to ensure that a bluetooth device shares the same uuid to all its client?
2. If #1 is no, is there an alternative?
Thanks in adv.

ios Core BlueTooth Pairing to External BLE Device

I am making an BLE based application.
As I know Bluetooth Pairing is handling ios internally.
Is there any possiblity to get access over bluetooth pairing request in ios . I am getting pairing request from external BLE Device but i am not able to know whether user is paired or cancelled.
Apps like TI SensorTag and Multitool apps are handling the pairing request when user clicks cancel then these apps disconnects the peripheral.
I am not getting any clue how they are handling the pairing.
Please help me in getting this solved.
Thanks
The BLE devices are more then likely handling the cancel on their side. When you click cancel through iOS it does not pair and does not enable encryption. At this point the BLE devices are probably issuing a disconnect because encryption has not been started.
The only time you will see that pairing message is when encryption is being requested.

What, exactly, is a BLE connected device on iOS?

The CBCentralManager retrieveConnectedPeripherals method says it gets "the list of the peripherals currently connected to the system." The definition of system is a bit ambiguous here.
Does this mean I get a list of peripherals connected to my app, or a list of peripherals connected to any app?
If I can get peripherals connected to another app, does this also mean multiple apps can connect to the same peripheral?
Can this only happen if the app is in the foreground, or do I need to allow for the possibility that a background app is sending commands to a peripheral I think my app owns?
BLE 4.0 enabled devices are usually connected with CBCentralManager unboundly. What is bounded and unbounded connection, you can know from this link.
One BLE 4.0 enabled device can be connected with only one master device thus enhancing secured connectivity. You should follow this link.
Whether in foreground of background, if the connection exists, the BLE slave device won't get connected with another app or device.

Resources