Overview
Bluejay is a simple Swift library designed to simplify the use of Core Bluetooth. It enables stronger typing, easier operation, and removes classic Bluetooth issues. The library helps Swift developers create a richer Bluetooth experience for users.
Installation
Bluejay can be installed via Swift Package Manager, CocoaPods or Carthage, Whit the following commands
- Swift Package Manager: Copy the URL of the Bluejay repo and add it as a Swift package dependency.
- CocoaPods: Include ‘pod ‘Bluejay” in your Podfile.
- Carthage: Include “github “steamclock/bluejay” in your Cartfile.
Features
Bluejay simplifies Core Bluetooth tasks through various features:
- Strong typing of services and characteristics.
- Simplified discover services and discover characteristics flow.
- Background task handling for long running tasks.
- Centrally managed disconnection and error handling.
- Connection timeouts and robust error debugging capabilities.
- Easy to read Bluetooth log which can be copied and shared.
Usage
For making efficient use of Bluejay, following steps can be observed:
- Make an instance of the Bluejay object.
- Before connecting to a peripheral, begin scanning for it.
- After discovering the peripheral, stop scanning and connect using the connect(_:,timeout:) method.
- Once connected, you can communicate with the bluetooth device and call disconnect() when done.
Contributing
Contributions to the Bluejay library are welcomed. Contributors are requested to follow the established GitHub pull request process and ensure all code meets the style guide.
License
Bluejay is released under an MIT License, which allows free usage in commercial applications. Please see the LICENSE file for more information.