Skip to content

Commit 79741cc

Browse files
authored
Merge branch 'master' into feature/update_gladdle_8.4
2 parents 69a9ef3 + 64ac2a0 commit 79741cc

11 files changed

Lines changed: 43 additions & 17 deletions

File tree

example/pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ packages:
220220
path: "../packages/flutter_reactive_ble"
221221
relative: true
222222
source: path
223-
version: "5.4.0"
223+
version: "5.4.1"
224224
flutter_test:
225225
dependency: "direct dev"
226226
description: flutter
@@ -464,14 +464,14 @@ packages:
464464
path: "../packages/reactive_ble_mobile"
465465
relative: true
466466
source: path
467-
version: "5.4.0"
467+
version: "5.4.1"
468468
reactive_ble_platform_interface:
469469
dependency: "direct overridden"
470470
description:
471471
path: "../packages/reactive_ble_platform_interface"
472472
relative: true
473473
source: path
474-
version: "5.4.0"
474+
version: "5.4.1"
475475
shelf:
476476
dependency: transitive
477477
description:

example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_reactive_ble_example
22
description: Demonstrates how to use the flutter_reactive_ble plugin.
3-
version: 5.4.0
3+
version: 5.4.1
44
publish_to: 'none'
55

66
environment:
@@ -10,7 +10,7 @@ environment:
1010
dependencies:
1111
flutter:
1212
sdk: flutter
13-
flutter_reactive_ble: ^5.4.0
13+
flutter_reactive_ble: ^5.4.1
1414
functional_data: ^1.0.0
1515
intl: ^0.17.0
1616

packages/flutter_reactive_ble/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 5.4.1
2+
3+
* Prevent index out of range crash when filtering services and characteristics #919
4+
* Improve stack trace of exceptions from read(Characteristic) #896
5+
* Upgraded protobuf to v3 and upgraded the android example to fix the deprecated imperative apply of gradle plugins #871
6+
17
## 5.4.0
28

39
* Support for MacOS #889

packages/flutter_reactive_ble/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,14 +433,14 @@ packages:
433433
path: "../reactive_ble_mobile"
434434
relative: true
435435
source: path
436-
version: "5.4.0"
436+
version: "5.4.1"
437437
reactive_ble_platform_interface:
438438
dependency: "direct main"
439439
description:
440440
path: "../reactive_ble_platform_interface"
441441
relative: true
442442
source: path
443-
version: "5.4.0"
443+
version: "5.4.1"
444444
shelf:
445445
dependency: transitive
446446
description:

packages/flutter_reactive_ble/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_reactive_ble
22
description: Reactive Bluetooth Low Energy (BLE) plugin that can communicate with multiple devices
3-
version: 5.4.0
3+
version: 5.4.1
44
homepage: https://github.com/PhilipsHue/flutter_reactive_ble
55

66
environment:
@@ -21,8 +21,8 @@ dependencies:
2121
sdk: flutter
2222
functional_data: ^1.0.0
2323
meta: ^1.3.0
24-
reactive_ble_mobile: ^5.4.0
25-
reactive_ble_platform_interface: ^5.4.0
24+
reactive_ble_mobile: ^5.4.1
25+
reactive_ble_platform_interface: ^5.4.1
2626

2727
dependency_overrides:
2828
reactive_ble_mobile:

packages/reactive_ble_mobile/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 5.4.1
2+
3+
* Prevent index out of range crash when filtering services and characteristics #919
4+
* Improve stack trace of exceptions from read(Characteristic) #896
5+
* Upgraded protobuf to v3 and upgraded the android example to fix the deprecated imperative apply of gradle plugins #871
6+
17
## 5.4.0
28

39
* Support for MacOS #889

packages/reactive_ble_mobile/darwin/Classes/ReactiveBle/Central.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,21 @@ final class Central {
366366
private func resolve(characteristic characteristicInstance: CharacteristicInstance) throws -> CBCharacteristic {
367367
let peripheral = try resolve(connected: characteristicInstance.peripheralID)
368368

369-
guard let service = peripheral.services?.filter({ $0.uuid == characteristicInstance.serviceID })[Int(characteristicInstance.serviceInstanceID) ?? 0]
369+
let filteredServices = peripheral.services?.filter { $0.uuid == characteristicInstance.serviceID } ?? []
370+
let serviceIndex = Int(characteristicInstance.serviceInstanceID) ?? 0
371+
372+
guard serviceIndex >= 0, serviceIndex < filteredServices.count
370373
else { throw Failure.serviceNotFound(characteristicInstance.serviceID, characteristicInstance.peripheralID) }
371374

372-
guard let characteristic = service.characteristics?.filter({ $0.uuid == characteristicInstance.id })[Int(characteristicInstance.instanceID) ?? 0]
375+
let service = filteredServices[serviceIndex]
376+
377+
let filteredCharacteristics = service.characteristics?.filter {$0.uuid == characteristicInstance.id} ?? []
378+
let characteristicsIndex = Int(characteristicInstance.instanceID) ?? 0
379+
380+
guard characteristicsIndex >= 0, characteristicsIndex < filteredCharacteristics.count
373381
else { throw Failure.characteristicNotFound(characteristicInstance) }
374382

375-
return characteristic
383+
return filteredCharacteristics[characteristicsIndex]
376384
}
377385

378386
private enum Failure: Error, CustomStringConvertible {

packages/reactive_ble_mobile/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ packages:
425425
path: "../reactive_ble_platform_interface"
426426
relative: true
427427
source: path
428-
version: "5.4.0"
428+
version: "5.4.1"
429429
shelf:
430430
dependency: transitive
431431
description:

packages/reactive_ble_mobile/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: reactive_ble_mobile
22
description: Official Android and iOS implementation for the flutter_reactive_ble plugin.
3-
version: 5.4.0
3+
version: 5.4.1
44
homepage: https://github.com/PhilipsHue/flutter_reactive_ble
55

66
environment:
@@ -11,7 +11,7 @@ dependencies:
1111
flutter:
1212
sdk: flutter
1313
protobuf: ^3.0.0
14-
reactive_ble_platform_interface: ^5.4.0
14+
reactive_ble_platform_interface: ^5.4.1
1515

1616
dev_dependencies:
1717
build_runner: ^2.3.3

packages/reactive_ble_platform_interface/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 5.4.1
2+
3+
* Prevent index out of range crash when filtering services and characteristics #919
4+
* Improve stack trace of exceptions from read(Characteristic) #896
5+
* Upgraded protobuf to v3 and upgraded the android example to fix the deprecated imperative apply of gradle plugins #871
6+
17
## 5.4.0
28

39
* Support for MacOS #889

0 commit comments

Comments
 (0)