init: rough companion app stub
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
// Uses flutter_blue_plus to drive the ESP-IDF Unified Provisioning GATT protocol.
|
||||
// No BLE pairing or password required.
|
||||
//
|
||||
// Android: minSdkVersion must be ≥ 21 in android/app/build.gradle.
|
||||
|
||||
class BleScanResult {
|
||||
const BleScanResult({
|
||||
required this.deviceId,
|
||||
required this.name,
|
||||
required this.rssi,
|
||||
});
|
||||
|
||||
final String deviceId;
|
||||
final String name;
|
||||
final int rssi;
|
||||
}
|
||||
|
||||
class BleProvisioner {
|
||||
// TODO: implement using flutter_blue_plus.
|
||||
// Filter scan by the ESP-IDF provisioning service UUID advertised by your firmware.
|
||||
|
||||
/// Starts a BLE scan and emits discovered ESP32 provisioning devices.
|
||||
Stream<BleScanResult> scan() => throw UnimplementedError();
|
||||
|
||||
Future<void> stopScan() async => throw UnimplementedError();
|
||||
|
||||
/// Connects to [deviceId] and sends WiFi credentials via the ESP-IDF
|
||||
/// Unified Provisioning GATT profile (protobuf over BLE characteristic).
|
||||
Future<void> provision(
|
||||
String deviceId, {
|
||||
required String ssid,
|
||||
required String wifiPassword,
|
||||
}) async =>
|
||||
throw UnimplementedError();
|
||||
|
||||
void dispose() {}
|
||||
}
|
||||
Reference in New Issue
Block a user