A Swift framework for communicating with dive computers via Bluetooth Low Energy (BLE). Built on top of libdivecomputer, this package provides a modern Swift API for iOS and macOS applications to interact with various dive computers.
- 🔍 BLE device scanning and management
- 📱 Support for Suunto and Shearwater dive computers
- 📥 Efficient dive log retrieval with fingerprint system
- 📊 Comprehensive dive data parsing
- 🛠 Built-in error handling and logging
- 📈 Progress tracking for long operations
- iOS 15.0+ / macOS 12.0+
- Swift 5.10+
- Xcode 15.0+
Add LibDC-Swift to your project using Swift Package Manager:
dependencies: [
.package(url: "https://github.com/latishab/libdc-swift", from: "1.0.0")
]
import LibDCSwift
// Initialize and start scanning
let manager = CoreBluetoothManager.shared
manager.startScanning()
// Connect to a device
let success = DeviceConfiguration.openBLEDevice(
name: deviceName,
deviceAddress: deviceUUID
)
// Retrieve dive logs
let viewModel = DiveDataViewModel()
DiveLogRetriever.retrieveDiveLogs(
from: devicePtr,
deviceName: name,
viewModel: viewModel
) { success in
if success {
// Handle retrieved dive logs
}
}
All dive computer brands that supports BLE connectivity according to libdivecomputer
For detailed documentation, please visit our Wiki.
Key topics covered in the wiki:
- Detailed setup and configuration
- Advanced usage examples
- Data structures and handling
- Error handling strategies
- Logging system
- Contribution guidelines
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the GNU Lesser General Public License v2.1 - see the LICENSE file for details.
This project builds upon libdivecomputer, providing Swift bindings and additional functionality for iOS and macOS applications.