Last active
January 24, 2021 18:13
-
-
Save Kdan/a04cabdb211aa4cafe76e3b7dff3fe01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// A Facade for the CBCentralManager. | |
protocol CentralManager { | |
/// The state of the central manager. | |
var state: CBManagerState { get } | |
/// Call this function to scan for bluetooth peripherals. | |
func scanForPeripherals(withServices serviceUUIDs: [CBUUID]?, options: [String : Any]?) | |
/// Connect to a peripheral. | |
func connect(_ peripheral: CBPeripheral, options: [String : Any]?) | |
} | |
extension CBCentralManager: CentralManager { } | |
/// A Facade for the CBPeripheral. | |
protocol Peripheral { | |
/// The name of the peripheral | |
var name: String? { get } | |
} | |
extension CBPeripheral: Peripheral { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment