Skip to content

Implementation of Bluetooth Low Energy communication using Flow Controllers to make asynchronous code clean

License

Notifications You must be signed in to change notification settings

wojciech-kulik/SwiftBluetooth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BuyMeACoffee

SwiftBluetooth

Implementation of Bluetooth Low Energy communication using Flow Controllers to make asynchronous code clean.

You can read more in this article: Swift – Bluetooth Low Energy communication using Flow Controllers

Structure

BluetoothService:

  • BluetoothService.swift
    Only very basic operations - state, connect, disconnect, startScan, stopScan and property to assign FlowController.
  • BluetoothConnectionHandler.swift
    Extension to handle delegate methods related with connection like didConnect, didDisconnectPeripheral, didDiscover etc.
  • BluetoothEventsHandler.swift
    Extension to handle delegate methods related with Bluetooth events like didDiscoverServices, didUpdateValueFor etc.
  • BluetoothCommands.swift
    Extension to wrap preparing requests like binary payloads.

Flows implementation:

  • FlowController.swift
  • PairingFlow.swift
  • SynchronizationFlow.swift (example - not implemented)
  • ConfigurationFlow.swift (example - not implemented)

About

Implementation of Bluetooth Low Energy communication using Flow Controllers to make asynchronous code clean

Topics

Resources

License

Stars

Watchers

Forks

Languages