PureSwift / GATT

Bluetooth Generic Attribute Profile (GATT) for Swift (Supports Linux)
MIT License
64 stars 18 forks source link

Decrease CPU usage when scanning #18

Closed colemancda closed 2 years ago

colemancda commented 6 years ago

Use a different strategy that doesn't involve sleep() while scanning to improve energy efficiency and decrease unnecessary CPU usage. DispatchSemaphore might be a good solution.

Ponyboy47 commented 6 years ago

I know that there is asyncAfter on DispatchQueues: https://developer.apple.com/documentation/dispatch/dispatchqueue/2300020-asyncafter

Could be handy if you can make the 2nd half of the scan function asynchronous

colemancda commented 2 years ago

The new Swift Concurrency integration fixes this.