As with a central requesting value change update notifications, peripherals need to handle these subscriptions and send out the updates when applicable. The app can be notified when a given central subscribes to updates for a given characteristic. The app can send out the updates to a given central or to all that have subscribed.
- [Instructor] So we've looked at how to handle…read requests in our peripheral…and even subscriptions to notifications of updates.…Now let's look at how to handle…write requests to our peripheral.…In order to write to a characteristic,…we need to update the read/write properties and permissions.…We've seen it already with read and notify,…now we just have to add write.…There's a callback on the CBPeripheralManagerDelegate,…for did receive write requests that we can handle,…access the data that's been cast to our peripheral…and stored in our characteristic.…
Then we can respond to that request…similarly to how we did with the read request.…So let's look back at our IOS peripheral app…and update our characteristic to be able to be writable.…From line 20, we already have the…properties of read and notify.…We can just add write here but the…permissions need to be updated, too.…Currently for our characteristic, it's only readable.…So on line 21, we'll add a permissions set, as well.…
We'll type let permissions and that's…
Author
Released
4/5/2018- Bluetooth Low Energy (BLE) basics
- Core Bluetooth key classes
- Scanning for peripherals
- Discovering services and characteristics
- Writing to a characteristic
- Reconnecting to peripherals
- Apps as peripherals
Skill Level Intermediate
Duration
Views
Related Courses
-
Introduction
-
Welcome1m 10s
-
Exercise files33s
-
-
1. BLE Basics
-
BLE overview1m 29s
-
BLE communication workflow1m 18s
-
SensorTag overview1m 38s
-
-
2. Scanning, Connecting, and Discovering
-
Bluetooth project setup4m 30s
-
Scan for peripherals4m 54s
-
Connect to peripheral3m 13s
-
-
3. Writing to a Characteristic
-
Adding additional features10m 43s
-
4. An App as a Peripheral
-
Central app on Mac4m 19s
-
Peripheral iOS app7m 47s
-
Creating a characteristic2m 42s
-
Central read requests4m 6s
-
Central write requests4m 21s
-
-
Conclusion
-
Next steps1m 7s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Sending updates to characteristic values