0.0.1 ā¢ Published 2 years ago
love-alarm-ble
š Bluetooth Low Energy (BLE) Plugin for Love Alarm app
Install
npm install love-alarm-ble
npx cap sync
API
initialize(...)
initialize(options: InitOptions) => Promise<void>
Param | Type |
---|
options | InitOptions |
advertise()
advertise() => Promise<void>
stopAdvertise()
stopAdvertise() => Promise<void>
scan(...)
scan(callback: (result: ScanResult) => void) => Promise<void>
Param | Type |
---|
callback | (result: ScanResult) => void |
stopScan()
stopScan() => Promise<void>
read(...)
read(options: ReadOptions) => Promise<ReadResult>
Param | Type |
---|
options | ReadOptions |
Returns: Promise<ReadResult>
addListener(string, ...)
addListener(eventName: string, listenerFunc: (event: any) => void) => PluginListenerHandle
Param | Type |
---|
eventName | string |
listenerFunc | (event: any) => void |
Returns: PluginListenerHandle
addListener('onScanResult', ...)
addListener(eventName: 'onScanResult', listenerFunc: (result: any) => void) => PluginListenerHandle
Param | Type |
---|
eventName | 'onScanResult' |
listenerFunc | (result: any) => void |
Returns: PluginListenerHandle
Interfaces
InitOptions
Prop | Type |
---|
advertising | string |
ScanResult
Prop | Type |
---|
address | any |
name | string |
ReadResult
Prop | Type |
---|
address | string |
name | string |
profile | string |
ReadOptions
PluginListenerHandle
Prop | Type |
---|
remove | () => Promise<void> |