BlueSwift icon indicating copy to clipboard operation
BlueSwift copied to clipboard

Support macOS

Open conanoc opened this issue 1 year ago • 0 comments

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:

  1. Refactoring ConnectionSerivce.connect(): centralManager.validateState() failed when tested on macOS. I don't think testing the state as soon as we create the CBCentralManager makes sense. We should test the state in centralManagerDidUpdateState() and we are doing it there already.
  2. Make AdvertisementError optional: I made it optional to call the error handler even on success. We are doing the same in ConnectionSerivce.connect() and it tells the app whether the advertisement succeeds.

Also, updated Package.swift to support macOS.

conanoc avatar Jul 09 '24 05:07 conanoc