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