BlueSwift
BlueSwift copied to clipboard
Support macOS
Title
Support macOS
Motivation
It'll be good to support macOS because macOS supports Bluetooth. It'll also help with testing.
Task Description
There are two changes:
- Refactoring
ConnectionSerivce.connect():centralManager.validateState()failed when tested on macOS. I don't think testing the state as soon as we create theCBCentralManagermakes sense. We should test the state incentralManagerDidUpdateState()and we are doing it there already. - Make
AdvertisementErroroptional: I made it optional to call the error handler even on success. We are doing the same inConnectionSerivce.connect()and it tells the app whether the advertisement succeeds.
Also, updated Package.swift to support macOS.