love-alarm-ble
v0.0.1
Published
Bluetooth Low Energy (BLE) Plugin for Love Alarm app
Downloads
2
Readme
love-alarm-ble
🔌 Bluetooth Low Energy (BLE) Plugin for Love Alarm app
Install
npm install love-alarm-ble
npx cap syncAPI
initialize(...)advertise()stopAdvertise()scan(...)stopScan()read(...)addListener(string, ...)addListener('onScanResult', ...)- Interfaces
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
| Prop | Type |
| ------------- | ------------------- |
| address | string |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
