Receiving the data via updates

Keyboard Shortcuts

Reading a value from a Bluetooth LE device’s characteristic is useful. But what might be more efficient is being notified when the value changes. This may save a lot of performance on the app side as well as have a smaller drain on the battery life. Only being notified by the device when the value has changed is accomplished via Core Bluetooth.

- [Instructor] So now we've seen…how to read data from the device manually.…We used a timer to do it every five seconds,…however if the data doesn't change for a long time,…this can be unnecessary and inefficient,…especially for battery life of both devices.…Imagine that the device is in a dark room…and the light doesn't change for a long time,…then someone walks in, and suddenly the light changes,…that's when we care about the new value.…If we can have a situation where the peripheral…updates the manager with the new value…only when it changes, that would be ideal.…

And that's possible for some characteristics.…You can set the notify value to be true,…and only when the value change will the central be updated.…However, it always does depend…on the specific implementation of the device you're using.…In our case for the sensor tag,…the light sensor updates still come in at a timed interval.…But if we look at the documentation,…we can see that there are other characteristics…that have the notification permission.…

Resume Transcript Auto-Scroll

Author

Released

4/5/2018

iOS devices are equipped with Bluetooth low energy (BLE) capabilities, but—for many developers—creating an app that communicates with devices that are equipped with BLE wireless technology can seem a bit daunting. This course provides practical solutions for enterprise developers seeking to utilize BLE. Discover how to use the Core Bluetooth framework from Apple to detect BLE devices, connect to them, and read and write their data. Plus, learn how to create an app that serves as a peripheral for other connections.