atmotuber 0.1.4 atmotuber: ^0.1.4 copied to clipboard
A new Flutter package for BLE comunication with ATMOTUBE Pro.
atmotuber #
A Flutter package to deal with Atmotube Bluetooth API directly via BLE connection and make data ready to use within your app.
usage #
To use the package:
- add the dependency to your pubspec.yaml file
dependencies:
flutter:
sdk: flutter
atmotuber:
- (ios only) go to ios/Runner/Info.plist and add the following
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Need BLE permission</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Need BLE permission</string>
- (android only) go to android/app/src/main/AndroidManifest.xml
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
To connect to Atmotube Pro:
// init
Atmotuber atm = Atmotuber();
// connect
await atm.searchAtmotube();
To read real-time data:
await atm.wrapper(callback: (streams) {
dataGot.value = streams;
}
To read history data:
await atm.hist_wrapper(callback: (streams) {
history.value = streams;
}
To disconnect from Atmotube Pro:
// disconnect
await atm.dropConnection();