Problem with BLE application
when restarting iphone.
Hello,
We have a ble device of our own design and are
writing an iOS application to work with our device via BLE via CoreBluetooth.
Algorithm of interaction between iOS application and BLE device:
1) If the BLE device (BLE slave) is switched to the permanent connection mode, then
when it is not connected, the BLE network is distributed with 16-bit UUID of our company and custom data
with the largest possible interval.
The distribution interval was set at 1285ms,
guided by the information on item 35.5 in your manual
(https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf)
2) iOS device (BLE
master) with our application knows that the device of our company is switched
to permanent connection mode, and scans in the range of the BLE network with
16-bit UUID of our company;
3) When the BLE-master (iOS device) finds the BLE-slave device, the master
connects to the device, work starts.
4) In case of disconnection, go
to step "1)"
The algorithm of the application for working
with Bluetooth is as follows:
a) In AppDelegate, a class of service is
created, where devices are loaded from the iOS device database
b) Bluetooth classes are created for these devices;
c) When creating these classes, it is checked
in which mode they are;
d) If the BLE device (slave) is in permanent
connection mode, then the distribution of the ble network from the iOS device
is started (in some modes it is necessary) and scanning inside the device class
(centralManager.scanForPeripherals(withServices:
[BluetoothLib.scanService], options: nil))
e) If the required BLE device is
found, then it is connected and initialized.
Problems that I could not find an answer to in the documentation I found:
I would like to clarify how the iOS device scans in the background in order to
understand what interval is optimal for distributing the network, so that the
iOS application in background
finds the slave device within 30 seconds.
2. When I reboot the iOS device, I cannot
understand whether my application starts, because the iPhone log is not
available after the reboot, and the reconnection does not occur to out BLE
device (I control it via UART) (I waited a long time).
(Following the example of other applications that are similar in functionality,
I know that after rebooting, it is possible to restart the Bluetooth
application and reconnect to BLE slave device)
when restarting iphone.
Hello,
We have a ble device of our own design and are
writing an iOS application to work with our device via BLE via CoreBluetooth.
Algorithm of interaction between iOS application and BLE device:
1) If the BLE device (BLE slave) is switched to the permanent connection mode, then
when it is not connected, the BLE network is distributed with 16-bit UUID of our company and custom data
with the largest possible interval.
The distribution interval was set at 1285ms,
guided by the information on item 35.5 in your manual
(https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf)
2) iOS device (BLE
master) with our application knows that the device of our company is switched
to permanent connection mode, and scans in the range of the BLE network with
16-bit UUID of our company;
3) When the BLE-master (iOS device) finds the BLE-slave device, the master
connects to the device, work starts.
4) In case of disconnection, go
to step "1)"
The algorithm of the application for working
with Bluetooth is as follows:
a) In AppDelegate, a class of service is
created, where devices are loaded from the iOS device database
b) Bluetooth classes are created for these devices;
c) When creating these classes, it is checked
in which mode they are;
d) If the BLE device (slave) is in permanent
connection mode, then the distribution of the ble network from the iOS device
is started (in some modes it is necessary) and scanning inside the device class
(centralManager.scanForPeripherals(withServices:
[BluetoothLib.scanService], options: nil))
e) If the required BLE device is
found, then it is connected and initialized.
Problems that I could not find an answer to in the documentation I found:
In step “2)”, if the iOS application is in the background, then the
I would like to clarify how the iOS device scans in the background in order to
understand what interval is optimal for distributing the network, so that the
iOS application in background
finds the slave device within 30 seconds.
2. When I reboot the iOS device, I cannot
understand whether my application starts, because the iPhone log is not
available after the reboot, and the reconnection does not occur to out BLE
device (I control it via UART) (I waited a long time).
(Following the example of other applications that are similar in functionality,
I know that after rebooting, it is possible to restart the Bluetooth
application and reconnect to BLE slave device)