Skip to content

Commit

Permalink
set uart service for demo gear
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Dec 29, 2024
1 parent 3f68111 commit c199d99
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Frontend/Widgets/scan_for_new_device.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@ class _ScanForNewDevice extends ConsumerState<ScanForNewDevice> {
baseStoredDevice = BaseStoredDevice(value.uuid, "DEV${value.deviceType.name}", value.deviceType.color(ref: ref).value)..name = getNameFromBTName(value.btName);
statefulDevice = BaseStatefulDevice(value, baseStoredDevice);
statefulDevice.deviceConnectionState.value = ConnectivityState.connected;
if (value.deviceType == DeviceType.ears) {
statefulDevice.bluetoothUartService.value = uartServices.firstWhere(
(element) => element.label == "Legacy Ears",
);
} else {
statefulDevice.bluetoothUartService.value = uartServices.firstWhere(
(element) => element.label == "TailCoNTROL",
);
}
int code = Random().nextInt(899999) + 100000;
baseStoredDevice.conModePin = code.toString();
if (!ref.read(knownDevicesProvider).containsKey(baseStoredDevice.btMACAddress)) {
Expand Down

0 comments on commit c199d99

Please sign in to comment.