@@ -143,7 +143,7 @@ class _OnDiscoveredServices extends _$OnDiscoveredServices {
143143 //Subscribes to all characteristics
144144 for (BluetoothService service in event.services) {
145145 BluetoothUartService ? bluetoothUartService = uartServices.firstWhereOrNull (
146- (element) => element.bleDeviceService.toLowerCase () == service.serviceUuid.str .toLowerCase (),
146+ (element) => element.bleDeviceService.toLowerCase () == service.serviceUuid.str128 .toLowerCase (),
147147 );
148148 if (bluetoothUartService != null ) {
149149 BaseStatefulDevice ? statefulDevice = ref.read (knownDevicesProvider)[event.device.remoteId.str];
@@ -319,7 +319,7 @@ class _OnCharacteristicReceived extends _$OnCharacteristicReceived {
319319 }
320320
321321 Future <void > listener (OnCharacteristicReceivedEvent event) async {
322- _bluetoothPlusLogger.info ('onCharacteristicReceived ${event .device .advName } ${event .characteristic .uuid .str } ${event .value }' );
322+ _bluetoothPlusLogger.info ('onCharacteristicReceived ${event .device .advName } ${event .characteristic .uuid .str128 } ${event .value }' );
323323
324324 BluetoothDevice bluetoothDevice = event.device;
325325 BluetoothCharacteristic bluetoothCharacteristic = event.characteristic;
@@ -332,7 +332,7 @@ class _OnCharacteristicReceived extends _$OnCharacteristicReceived {
332332 }
333333 if (bluetoothCharacteristic.characteristicUuid.str.toLowerCase () == "2a19" ) {
334334 statefulDevice.batteryLevel.value = values.first.toDouble ();
335- } else if (bluetoothCharacteristic.characteristicUuid.str .toLowerCase () == "5073792e-4fc0-45a0-b0a5-78b6c1756c91" ) {
335+ } else if (bluetoothCharacteristic.characteristicUuid.str128 .toLowerCase () == "5073792e-4fc0-45a0-b0a5-78b6c1756c91" ) {
336336 try {
337337 String value = const Utf8Decoder ().convert (values);
338338 statefulDevice.messageHistory.add (MessageHistoryEntry (type: MessageHistoryType .receive, message: value));
@@ -342,7 +342,7 @@ class _OnCharacteristicReceived extends _$OnCharacteristicReceived {
342342 statefulDevice.messageHistory.add (MessageHistoryEntry (type: MessageHistoryType .receive, message: "Unknown: ${values .toString ()}" ));
343343 return ;
344344 }
345- } else if (statefulDevice.bluetoothUartService.value != null && bluetoothCharacteristic.characteristicUuid.str .toLowerCase () == statefulDevice.bluetoothUartService.value! .bleRxCharacteristic.toLowerCase ()) {
345+ } else if (statefulDevice.bluetoothUartService.value != null && bluetoothCharacteristic.characteristicUuid.str128 .toLowerCase () == statefulDevice.bluetoothUartService.value! .bleRxCharacteristic.toLowerCase ()) {
346346 String value = "" ;
347347 try {
348348 value = const Utf8Decoder ().convert (values);
@@ -560,9 +560,9 @@ Future<void> sendMessage(BaseStatefulDevice device, List<int> message, {bool wit
560560 BluetoothDevice ? bluetoothDevice = flutterBluePlus.connectedDevices.firstWhereOrNull ((element) => element.remoteId.str == device.baseStoredDevice.btMACAddress);
561561 if (bluetoothDevice != null && device.bluetoothUartService.value != null ) {
562562 BluetoothCharacteristic ? bluetoothCharacteristic = bluetoothDevice.servicesList
563- .firstWhereOrNull ((element) => element.uuid.str .toLowerCase () == device.bluetoothUartService.value! .bleDeviceService.toLowerCase ())
563+ .firstWhereOrNull ((element) => element.uuid.str128 .toLowerCase () == device.bluetoothUartService.value! .bleDeviceService.toLowerCase ())
564564 ? .characteristics
565- .firstWhereOrNull ((element) => element.characteristicUuid.str .toLowerCase () == device.bluetoothUartService.value! .bleTxCharacteristic.toLowerCase ());
565+ .firstWhereOrNull ((element) => element.characteristicUuid.str128 .toLowerCase () == device.bluetoothUartService.value! .bleTxCharacteristic.toLowerCase ());
566566 if (bluetoothCharacteristic == null ) {
567567 _bluetoothPlusLogger.warning ("Unable to find bluetooth characteristic to send command to" );
568568 return ;
0 commit comments