Trim spaces in UUIDs
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
## 0.11.1
|
||||
* Trim spaces in UUIDs
|
||||
|
||||
## 0.11.0
|
||||
* Unify UUID format across all platforms, 128-bit lowercase
|
||||
* Add BleUuidParser utility methods for UUID parsing
|
||||
|
||||
@@ -4,6 +4,7 @@ class BleUuidParser {
|
||||
/// Parse a string to a valid 128-bit UUID.
|
||||
/// Throws `FormatException` if the string does not hold a valid UUID format.
|
||||
static String string(String uuid) {
|
||||
uuid = uuid.trim();
|
||||
if (uuid.length < 4) {
|
||||
throw const FormatException('Invalid UUID');
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
name: universal_ble
|
||||
description: A cross-platform (Android/iOS/macOS/Windows/Linux/Web) Bluetooth Low Energy (BLE) plugin for Flutter
|
||||
version: 0.11.0
|
||||
version: 0.11.1
|
||||
homepage: https://navideck.com
|
||||
repository: https://github.com/Navideck/universal_ble
|
||||
issue_tracker: https://github.com/Navideck/universal_ble/issues
|
||||
|
||||
@@ -59,6 +59,13 @@ void main() {
|
||||
equals('0000180a-0000-1000-8000-00805f9b34fb'),
|
||||
);
|
||||
});
|
||||
|
||||
test('128-bit UUID with trailing space', () {
|
||||
expect(
|
||||
BleUuidParser.string('0000180a-0000-1000-8000-00805f9b34fb '),
|
||||
equals('0000180a-0000-1000-8000-00805f9b34fb'),
|
||||
);
|
||||
});
|
||||
});
|
||||
group('Fails', () {
|
||||
test('Invalid UUID length is less than 4', () {
|
||||
|
||||
Reference in New Issue
Block a user