Commit Graph

55 Commits

Author SHA1 Message Date
Foti Dim ceda9a31f7 Background service support on Android (#215)
* - Added support for BLE scanning from background services on Android.
- Enhanced `PermissionHandler` to be activity-aware, allowing silent success for already granted permissions when no activity is available.
- Updated README with best practices for requesting permissions in foreground before background operations.

* Simplify implementation
2026-02-04 19:12:12 +01:00
Foti Dim 60a4e2277f Add web app to app showcase 2026-01-16 07:37:35 +01:00
Foti Dim 8557a46d05 Add auto-connect support (#206)
* Add autoConnect support

* Enhance autoConnect functionality for Bluetooth devices

- Added support for managing a set of auto-connect devices in both Android and iOS implementations.
- Updated connection and disconnection logic to handle auto-reconnect scenarios appropriately.
- Improved cleanup processes to prevent unwanted reconnections when devices are manually disconnected.

* Refactor connection button and add auto-reconnect toggle

- Updated the connection button layout for better UI consistency.
- Introduced an auto-reconnect toggle to manage automatic reconnections when devices become available.
- Enhanced connection and disconnection logic to respect the auto-connect setting.

* Update version to 1.2.0 and add CHANGELOG for new features

- Bumped version to 1.2.0.
- Added CHANGELOG.md detailing new features including support for `autoConnect` and UI updates for automatic reconnection.

* Improve readme

* Refactor variable naming for clarity in Bluetooth connection logic

- Changed variable name from `isAutoConnect` to `shouldAutoConnect` for better readability and understanding of its purpose in the connection state handling.

* Refactor connection handling in UniversalBlePlugin

- Simplified connection logic by always cleaning up internal state before sending connection change callbacks.
- Ensured GATT resources are only closed when autoConnect is disabled, allowing for better management of Bluetooth connections.

* Refactor disconnection handling in UniversalBlePlugin

- Introduced a new method `handlePeripheralDisconnection` to encapsulate disconnection logic, improving code readability and maintainability.
- Updated the `centralManager` methods to utilize the new disconnection handler, ensuring consistent behavior across connection state changes.

* Update darwin/Classes/UniversalBlePlugin.swift

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Foti Dim <fotios.dimanidis@a2zebra.de>
Co-authored-by: Navideck Labs <130186950+navidecklabs@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-16 11:36:24 +05:30
EricKwok 1adfa9b485 Implement readRSSI on Android and Darwin (#203) 2026-01-05 17:49:55 +01:00
Foti Dim a7e280be29 Add icon 2025-12-17 23:23:52 +01:00
Navideck Labs d26e752e73 Update README and BLE API documentation for MTU handling (#202)
- Clarified MTU request behavior and platform limitations in README.md.
- Added best practices for MTU management in cross-platform BLE applications.
- Enhanced documentation for `requestMtu` method in UniversalBle and BleDeviceExtension to reflect best-effort nature of MTU requests and platform-specific behaviors.

Co-authored-by: Foti Dim <foti@navideck.com>
2025-12-15 07:08:01 +01:00
Foti Dim 01b4511704 Update readme 2025-12-14 12:22:45 +01:00
Rohit Sangwan 89abb3bf03 Implement Logging (#199)
* Implement Logging

* Add timestamp in OnValueChanged

* improve web and linux logging

* Implement windows and format pigeon

* Fix windows build and unity log level

* Log commands with timestamp

* Fix code doc

* Remove unnecessary import

* Update docs

* Fix crash on windows 11 because of failed pairing

* Update changelog

* Fix native code formatting
2025-12-12 18:56:43 +05:30
Rohit Sangwan 970db165dd Implement requestPermission API (#190)
* Implement requestPermission api

* Update example ios podfile

* Update example windows dependencies

* Update Readme and Changelog

* Resolve Ai Comments

* Improve bluetooth permission handling

* Update Readme

* Improve readme

---------

Co-authored-by: Foti Dim <foti@navideck.com>
2025-11-13 17:22:17 +01:00
Rohit Sangwan 2adcc06ca6 Add reset instructions (#189) 2025-11-12 14:58:38 +01:00
Rohit Sangwan 34b39597fd Implement isScanning api (#188)
* Implement isScanning api

* Improve IOS scanning api

* Update Readme and Changelog
2025-11-12 14:57:44 +01:00
Rohit Sangwan acfa3200ca Implement unified and type safe error messages (#186)
* Implement unified and type safe error messages

* Fix Apple error handling

* improve linux exception handling

* improve web exception handling

* fix window imports

* update pigeon generated files

* Fix compilaton issue

* Fix windows error parsing

* Fix windows compilation

* Improve error handling on dart side

* rename _wrapFuture to _executeWithErrorHandling

* Add pigeon generation script and format generated dart file

* Update changelog

* Update readme

---------

Co-authored-by: Foti Dim <foti@navideck.com>
2025-11-11 19:34:29 +01:00
Rohit Sangwan af873b3153 Implement exclusion filter (#175)
* Implement exclusion filter

* Fix web filters

* Apply Ai Suggestions

* Fix scanFilterTest

* Resolve Ai comments

* Update readme and changelog

* Update CHANGELOG.md

Co-authored-by: Foti Dim <foti@navideck.com>

* Update exclusion filter doc

* Fix wording

---------

Co-authored-by: Foti Dim <foti@navideck.com>
Co-authored-by: Foti Dim <fotios.dimanidis@a2zebra.de>
2025-09-01 10:31:56 +03:00
Rohit Sangwan 71e19988a9 Add clear queue api (#171)
* Add clear queue api

* Minor improvement

* Update changelog

---------

Co-authored-by: Foti Dim <foti@navideck.com>
2025-07-16 12:36:39 +02:00
Rohit Sangwan 0f4bae71e1 Add timeout argument to all APIs (#172)
* Add timeout argument to all apis

* Update Version and changelog

* Bump version

* Update readme

---------

Co-authored-by: Foti Dim <foti@navideck.com>
2025-07-16 11:47:48 +02:00
Rohit Sangwan 0758f5e91d Add high level API (#160)
* Add high-level api extensions for BleDevice and Characteristic

* Add doc comments and move few files to utils

* Add advance documentation

* Make the high level APIs the new default in the readme

* More readme cleanups

* Add pair api, improve notifications apis and deprecate writeValue

* Use highLevel apis in Example

* Rename HighLevel isPaired api to hasPairing api

* Update Readme

* Rename low level readValue api to read and update Readme

* Update UniversalBle to use new apis instead of deprecated internally

* Split queueCommand and queueCommandWithoutTimeout

* Split setNotifiable into subscribeNotifications, subscribeIndications and unsubscribe

* Fix web imports

* Update changelog

* Switch back to isPaired

Co-authored-by: Rohit Sangwan <rohitsangwan647@gmail.com>

* Fix BleDevice toString method

* Switch back to isPaired

* Change peripheral to device

* Rename cached to preferCached

* Remove preferCached from discoverServices()

* Update changelog

* Use cached services

* Add ///

* Reverse withoutResponse to withResponse to avoid negation

* Link to low level API

* Move connectionState to public readme

* Rename disableSubscriptions to unsubscribe

* Improve documentation

* Fix getService cache

* Add NotFoundException

---------

Co-authored-by: Foti Dim <foti@navideck.com>
2025-06-19 13:02:14 +02:00
Foti Dim e9f97d1085 Improve readme clarity 2025-05-30 11:21:06 +02:00
Foti Dim 2101c1ac8b Improve Android runtime permissions docs (#157) 2025-05-29 08:33:57 +02:00
Foti Dim cd4e45b4ec Add app showcase in Readme 2025-05-16 19:42:04 +02:00
Rohit Sangwan 8069ff52d5 Implement streams to get updates (#155)
* Implement streams to get updates

* Resolve comments

* Update Readme

* Apply suggestions from code review

Co-authored-by: Foti Dim <foti@navideck.com>

* Update Changelog

* Update Readme

---------

Co-authored-by: Foti Dim <foti@navideck.com>
2025-05-08 12:52:18 +02:00
Foti Dim f26951834d Improve pairing section in readme 2025-03-22 09:44:08 +01:00
Foti Dim 334bc1c680 Improve docs for isPaired 2025-03-19 22:17:06 +01:00
Foti Dim a9f396bb4a Improve Android permission documentation (#147)
* Improve Android permission documentation

* Add snap instruction

* Improve Android permissions guide
2025-03-18 07:49:02 +01:00
Foti Dim 3170b4b77b Improve requestMTU() docs (#140)
* Improve requestMTU() docs

* Update Linux info
2025-02-17 08:20:43 +01:00
Foti Dim 2c0d36b9d1 Improve ManufacturerDataFilter (#139)
* Improve-ManufacturerDataFilter-docs

* Improve ManufacturerDataFilter namings and code

* Perform more renamings
Add tests
2025-02-17 06:42:28 +01:00
Foti Dim 6443915fc3 Improve readme
Update changelog
2025-02-12 10:18:57 +01:00
Rohit Sangwan f3411280e9 Enhance getSystemDevice API on macOS with Broader Default Services Fi… (#121)
* Enhance getSystemDevice API on macOS with Broader Default Services Filter

* Update docs

* Update darwin/Classes/UniversalBlePlugin.swift

Co-authored-by: Foti Dim <foti@navideck.com>

* Reorder fields

* Use ScanFilter ui for getting system devices

---------

Co-authored-by: Foti Dim <fdimanidis@gmail.com>
Co-authored-by: Foti Dim <foti@navideck.com>
2025-01-02 15:58:51 +05:30
Rohit Sangwan 1292199426 Add API to disable Bluetooth (#113)
* Add api to disable Bluetooth

* Implement Android support

* Fix apple build

* Update Readme

* Combine rows

---------

Co-authored-by: Foti Dim <fdimanidis@gmail.com>
2024-12-09 21:18:01 +05:30
Rohit Sangwan b77d0aaeb4 Add error in connection updates (#89)
* Add error in connection updates

* implement windows

* Update changelog and Docs

* minor fix in connect()

* Add default timeout in connect

* Document new pair and connect API

* Fix Connect and Pair apis to throw proper errors and Improve logging

* remove import

* Rename PairingException and update Exception doc

* Update changelog

* Update comments

---------

Co-authored-by: Foti Dim <fdimanidis@gmail.com>
2024-09-26 23:08:25 +02:00
Rohit Sangwan 7dc22c58a5 Improve scan filter api (#78)
* Improve scan filter api

* Implement Windows filters

* Add manufacturerDataList and deprecate manufacturerData

* Fix Windows

* Update Readme and changelog

* Remove import

* Fix Linux

* Update readme and changelog

* Cleanup Todo

* Improve ManufacturerData

* Rename webConfig and Manufacturer.data

* Return false for receivesAdvertisements on Linux/Web

* Add delay in discoverServices on Linux

* Remove import

* Update changelog

---------

Co-authored-by: fotidim <foti@navideck.com>
2024-09-16 23:43:51 +02:00
Rohit Sangwan f7c05b2490 Remove error from onPairingStateChange (#75)
* Remove error from onPairingStateChange

* Update ChangeLog and Readme

* Update Changelog
2024-08-13 16:19:21 +02:00
Foti Dim 40819d5796 Return pair result 2024-08-12 21:15:56 +02:00
Foti Dim 7606e8fd29 Implement pairing on Apple (#59) 2024-08-09 22:42:40 +02:00
Rohit Sangwan 0d6b612497 Receive advertisement events on web (#63)
* Fix web manufacturer discovery

* Minor Fixes

* Cleanups

* Add canWatchAdvertisements api

* Improve Cleanups

* Improve code level documentation

* Improve documentation

---------

Co-authored-by: Foti Dim <fdimanidis@gmail.com>
2024-07-19 10:39:49 +02:00
Foti Dim efaa72acbd Improve BleUuid API and tests (#62)
* Improve tests

* Fix tests

* More improvements and ToDos

* Final API changes
Add tests

* Update readme

---------

Co-authored-by: Rohit Sangwan <rohitsangwan647@gmail.com>
2024-07-15 05:59:30 +02:00
Foti Dim 86f3836d5d Update readme and changelog 2024-07-12 09:24:27 +02:00
Rohit Sangwan 9bb209f8b5 Unify UUID formatting (#55)
* Unify UUID formatting

* Update Readme

* Update Readme

* Apply suggestions from code review

Co-authored-by: Foti Dim <foti@navideck.com>

* Resolve Comments

* Add test and support 32bit uuid parsing

* Add a toString() method to the BleDevice class for easier debugging and logging

* Rename Uuid to BleUuid

* Rename uuid file to ble_uuid

* Update Readme

---------

Co-authored-by: Foti Dim <foti@navideck.com>
2024-07-05 17:53:55 +02:00
Rohit Sangwan 8d0cfe98d9 Add connecting and disconnecting states to BleConnectionState (#54)
* Add connecting and disconnecting state

* Replace BleConnectionState with boolean in onConnectionChanged callback

* Improve Docs and Changelog

* Implement GetConnectionState in Windows

* Update CHANGELOG.md

Co-authored-by: Foti Dim <foti@navideck.com>

* Add  code level doc of connectionState getter

---------

Co-authored-by: Foti Dim <foti@navideck.com>
2024-06-20 20:47:02 +02:00
Foti Dim 15453eb28f Rename onConnectionChanged and onValueChanged
Update changelog
Format files
2024-06-15 09:13:01 +02:00
Foti Dim 6361574b77 Add connection properties in BleDevice (#50)
* Rename to BleDevice

* Add isConnected property

* Make isConnected true

* Add isConnected api

* Implement Windows

* Merge add-isConnected-api

* Rename getConnectedDevices to getSystemDevices

* Add code level Doc for isConnected

* Add isPaired

* Revert isPaired

* Add isSystemDevice property in BleDevice

* Return enum instead of bool

---------

Co-authored-by: Rohit Sangwan <rohitsangwan647@gmail.com>
2024-06-13 16:14:54 +02:00
Rohit Sangwan 2fe21962d2 Add queue per device (#48)
* Add queue per device

* Improve API and documentation

* Update lib/src/universal_ble.dart

* Update lib/src/ble_command_queue.dart

---------

Co-authored-by: Foti Dim <fdimanidis@gmail.com>
Co-authored-by: Foti Dim <foti@navideck.com>
2024-06-07 20:55:46 +05:30
Rohit Sangwan 5847bbffc5 Add name prefix filtering (#45)
* Add name filter

* Change name filter to "prefix"

* Implement namePrefix filtering

* Update lib/src/universal_ble_platform_interface.dart

* Update lib/src/universal_ble_platform_interface.dart

---------

Co-authored-by: fotidim <foti@navideck.com>
2024-05-17 15:49:30 +02:00
Foti Dim 3fbd2e2422 Add info about discovering services 2024-03-28 09:49:27 +01:00
Foti Dim 4f22fe56cd Fix readme typo 2024-03-25 09:36:43 +01:00
Foti Dim 7e19329bd5 Add info about Bluetooth adapters on Windows and Linux 2024-03-23 15:08:12 +01:00
Rohit Sangwan 870defea86 Update readme and improve logs (#28)
* Update readme and improve logs

* Apply suggestions from code review

Co-authored-by: Foti Dim <foti@navideck.com>

* Add changelog

* Update Readme

* Update lib/src/universal_ble_web/universal_ble_web.dart

* Improve readme

* Update README.md

* Keep web section

---------

Co-authored-by: Foti Dim <foti@navideck.com>
2024-03-19 09:22:54 +01:00
Rohit Sangwan fe0a654f36 Implement requestMtu in Linux (#22)
* Implement requestMtu in Linux

* Minor fixes

* Improve requestMtu
2024-03-17 11:48:33 +01:00
fotidim 8108f9dfe4 Add windows capabilities instructions 2024-03-16 22:26:11 +01:00
Foti Dim 3a1c76be8c Fix typo 2024-03-13 21:36:36 +01:00
Rohit Sangwan 1f7ba287ef Implement ScanFilter (#17)
* Implement ScanFilter

* Add windows implementation

* Fix Linux and cleanups

* Update Readme, Changelog and Version

* Minor fixes from AI comments

* Fix windows crash and update pigeon

* Fix UUID parsing

* Apply suggestions from code review

Co-authored-by: Foti Dim <foti@navideck.com>

---------

Co-authored-by: Foti Dim <foti@navideck.com>
2024-03-05 22:37:14 +05:30