npm install @codext/capacitor-blufi
npx cap syncstartScan()stopScan()connectToDevice(...)disconnectFromDevice()resetPlugin()getDeviceInfo()scanWifi()setWifi(...)disconnectWifi()getNetworkStatus()addListener('onBlufiEvent', ...)- Interfaces
startScan() => Promise<void>stopScan() => Promise<{ scanResult: ScanResultItem[]; }>Returns: Promise<{ scanResult: ScanResultItem[]; }>
connectToDevice(options: { deviceId: string; }) => Promise<void>| Param | Type |
|---|---|
options |
{ deviceId: string; } |
disconnectFromDevice() => Promise<void>resetPlugin() => Promise<void>getDeviceInfo() => Promise<void>scanWifi() => Promise<WifiListResult>Returns: Promise<WifiListResult>
setWifi(options: { ssid: string; password: string; }) => Promise<WifiConnectResult>| Param | Type |
|---|---|
options |
{ ssid: string; password: string; } |
Returns: Promise<WifiConnectResult>
disconnectWifi() => Promise<WifiDisconnectResult>Returns: Promise<WifiDisconnectResult>
getNetworkStatus() => Promise<NetworkStatusResult>Returns: Promise<NetworkStatusResult>
addListener(eventName: 'onBlufiEvent', listenerFunc: (event: any) => void) => Promise<PluginListenerHandle>| Param | Type |
|---|---|
eventName |
'onBlufiEvent' |
listenerFunc |
(event: any) => void |
Returns: Promise<PluginListenerHandle>
| Prop | Type |
|---|---|
name |
string |
rssi |
number |
address |
string |
| Prop | Type |
|---|---|
list |
string[] |
| Prop | Type |
|---|---|
success |
boolean |
message |
string |
| Prop | Type |
|---|---|
success |
boolean |
message |
string |
| Prop | Type |
|---|---|
connected |
boolean |
status |
string |
| Prop | Type |
|---|---|
remove |
() => Promise<void> |