ailink
##中文
AiLink probe and probe box protocol data processing Flutter library.
Necessary condition
- Acquired AILink Bluetooth communication protocol
- Have smart devices that support AILink Bluetooth module
- Have knowledge of Flutter development and debugging
UUID Description
- FFE1: Write A7 data
- FFE2: Monitor A7 data changes
- FFE3: Write A6 data and monitor A6 data changes
Android
- Add
maven { url 'https://jitpack.io' }in android/build.gradle file
allprojects {
repositories {
google()
mavenCentral()
//add
maven { url 'https://jitpack.io' }
}
}
- Modify
minSdkVersion 21in the android/app/build.gradle file
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.elinkthings.ailink_food_probe_example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21 //flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
- To use the flutter_blue_plus library, you need to add the required permissions to android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
iOS
- When using the flutter_blue_plus library, you need to add the required permissions to ios/Runner/Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<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>
</dict>
</plist>
Flutter
ElinkProbeCmdUtils
Probe Command Related
- Get version information:
final cmd = getVersion();
- Sync time:
syncTime({DateTime? dateTime})
- Get battery level:
final cmd = getBattery();
- Switch unit:
final cmd = switchUnit(unit); //0: °C, 1: °F
- Set data:
import 'package:ailink_food_probe/model/elink_probe_info.dart';
ElinkProbeInfo probeInfo;
final cmd = setProbeInfo(probeInfo);
- Get data:
final cmd = getProbeInfo();
- Clear data:
final cmd = clearProbeInfo();
Probe Box Command Related
- Switch unit:
final cmd = switchUnitBox(unit); //0: °C, 1: °F
- Get probe data (based on the probe's MAC address):
List<int> probeMac;
final cmd = getBoxProbeInfo(probeMac);
- Set probe data (only the alarm temperature in the probe data is processed by the device, other data is not processed):
import 'package:ailink_food_probe/model/elink_probe_info.dart';
ElinkProbeInfo probeInfo;
final cmd = setBoxProbeInfo(probeInfo);
- Clear probe data (based on the probe's MAC address):
List<int> probeMac;
final cmd = clearBoxProbeInfo(probeMac);
For specific usage, please see example
Libraries
- ailink_food_probe
- ailink_food_probe_method_channel
- ailink_food_probe_platform_interface
- model/elink_probe_box_info
- model/elink_probe_info
- model/elink_probe_real_time
- utils/elink_probe_a6_data_parse_utils
- utils/elink_probe_a7_data_parse_utils
- utils/elink_probe_cmd_utils
- utils/elink_probe_config
- utils/elink_probe_data_parse_utils