MetaWearScanner
public class MetaWearScanner : NSObject
extension MetaWearScanner: CBCentralManagerDelegate
Scanner utility, make is simple to start scanning for MetaWear devices without having to understand all of CoreBluetooth
-
Undocumented
Declaration
Swift
public static let shared: MetaWearScanner
-
Undocumented
Declaration
Swift
public static let sharedRestore: MetaWearScanner
-
Undocumented
Declaration
Swift
public var central: CBCentralManager!
-
All devices that have been discovered in one way or another by this central
Declaration
Swift
public var deviceMap: [CBPeripheral : MetaWear]
-
Undocumented
Declaration
Swift
public var didUpdateState: ((CBCentralManager) -> Void)? { get set }
-
Undocumented
Declaration
Swift
public init(restoreIdentifier: String? = nil)
-
Start the scaning process for MetaWear or MetaBoot devices
Declaration
Swift
public func startScan(allowDuplicates: Bool, callback: @escaping (MetaWear) -> Void)
-
Stop scanning
Declaration
Swift
public func stopScan()
-
List of devices stored via
MetaWear.remember()
Declaration
Swift
public func retrieveSavedMetaWearsAsync() -> Task<[MetaWear]>
-
List of devices that are already connected This is useful to check after state was restored
Declaration
Swift
public func retrieveConnectedMetaWearsAsync() -> Task<[MetaWear]>
-
Undocumented
Declaration
Swift
public let bleQueue: DispatchQueue
-
Undocumented
Declaration
Swift
public func centralManagerDidUpdateState(_ central: CBCentralManager)
-
Undocumented
Declaration
Swift
public func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber)
-
Undocumented
Declaration
Swift
public func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral)
-
Undocumented
Declaration
Swift
public func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?)
-
Undocumented
Declaration
Swift
public func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?)
-
Undocumented
Declaration
Swift
public func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any])