RobotPajamas / SwiftyTeeth

A simple, lightweight library intended to take away some of the cruft and tediousness of using CoreBluetooth
Apache License 2.0
23 stars 8 forks source link

Create send/receive queues #20

Closed sureshjoshi closed 6 years ago

sureshjoshi commented 6 years ago

Block-based API calls are fine - but without some sort of underlying queue to manage, it's easy to trip over the serial nature of the Bluetooth GATT

sureshjoshi commented 6 years ago

Need to make sure queue is cleared out on disconnections, and some simple house-keeping - but fundamentally, the Queue appears to work rather well. No more needing to worry about race conditions about when each write/read command is issued.

Note: Haven't decided how to handle subscriptions yet - they're kinda strange, in that they just react to what the peripheral sends - which means they, themselves, are not an item on a task.