pushinbr/pam-native-bluetooth

Lifecycle-safe Bluetooth LE scanning, GATT and notifications for PAM Native.

Maintainers

Package info

github.com/push-in/pam-native-bluetooth

Language:Kotlin

Type:pam-native-plugin

pkg:composer/pushinbr/pam-native-bluetooth

Transparency log

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-08-01 05:31 UTC

This package is auto-updated.

Last update: 2026-08-01 06:08:47 UTC


README

Production-oriented Bluetooth Low Energy for PAM Native. Scan by service UUID, connect, discover services, read and write characteristics, subscribe to notifications, and consume a bounded native event queue that survives PHP request boundaries.

composer require pushinbr/pam-native-bluetooth
pam mobile prepare
$bluetooth->scan(['180d'], fn (bool $ok, ?string $error) => null);
$bluetooth->poll(function (array $events) use ($bluetooth) {
    foreach ($events as $event) {
        if ($event->kind === BluetoothEventKind::DeviceFound) {
            $bluetooth->connect($event->deviceId, fn () => null);
        }
    }
});

Android 12+ requires runtime grants for Nearby Devices. Android 11 and earlier may require location permission for discovery. iOS displays the Bluetooth purpose string supplied by this plugin. Device identifiers are opaque and must not be treated as MAC addresses.

The native queue holds at most 256 events and drops the oldest event under sustained backpressure. Applications should poll regularly and perform protocol framing, authentication, retry policy, and firmware-specific validation at the application layer.