GDSC-HSU / gateway

[Top 3] 2022 Solution Challenge an IoT apporch include Flutter & embedded devices, network protocol, solving/helping covid-19 situation
MIT License
23 stars 9 forks source link

fix: `ble_scan_android` hot fix scanning mode, location services in android platfrom #58

Closed truonghoangduy closed 2 years ago

truonghoangduy commented 2 years ago

https://github.com/PhilipsHue/flutter_reactive_ble https://github.com/PhilipsHue/flutter_reactive_ble/issues/87 docs

flutter_reactive_ble README for android

Scan for BLE peripherals advertising the services specified in [withServices] or for all BLE peripherals, if no services is specified. It is recommended to always specify some services.

There are two Android specific parameters that are ignored on iOS:

[scanMode] allows to choose between different levels of power efficient and/or low latency scan modes. [requireLocationServicesEnabled] specifies whether to check if location services are enabled before scanning. When set to true and location services are disabled, an exception is thrown. Default is true. Setting the value to false can result in not finding BLE peripherals on some Android devices.