lb_bluetooth 1.1.1 lb_bluetooth: ^1.1.1 copied to clipboard
Logbot bluetooth HPS client to connect and setup an IoT via a local bluetooth connection
Logbot Bluetooth SDK for Flutter #
This is a package that a bluetooth client for short range connection to Logbot IoTs
This Dart package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.1
- Build package: org.openapitools.codegen.languages.DartClientCodegen
Requirements #
Dart 2.17 or later
Installation & Usage #
Add the dependencies from pub.dev:
dependencies:
lb_bluetooth:
For Android, add the following properties to your Android Manifest:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
For iOS, add the following properties to Info.plist
:
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Need BLE permission</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Need BLE permission</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Need Location permission</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Need Location permission</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Need Location permission</string>
User must prompted for permissions:
LogbotBlePermissionsManager().checkPermissions();
To use the SDK on you application see the example below:
import 'package:lb_auth/lb_auth.dart';
import 'package:lb_bluetooth/lb_bluetooth.dart';
class Example {
Future<void> run() async {
LogbotBluetooth.client.invokeAPI(
"/info/test",
"GET",
[],
"",
{"accept": "application/json"},
{},
"application/json"
);
}
}
Tests #
To run all tests:
flutter test
Author #
Logbot SRL info@logbot.cloud