/capacitor-wifi

Connect to Wifi through your capacitor plugin. Good for IoT device connections.

Primary LanguageJava

ln-capacitor-wifi

Connect to Wifi through your capacitor plugin. Good for IoT device connections.

Install

npm install ln-capacitor-wifi
npx cap sync

API

scanWifi()

scanWifi() => Promise<ScanWifiResult>

Returns: Promise<ScanWifiResult>


getCurrentWifi()

getCurrentWifi() => Promise<GetCurrentWifiResult>

Returns: Promise<GetCurrentWifiResult>


connectToWifiBySsidAndPassword(...)

connectToWifiBySsidAndPassword(connectToWifiRequest: ConnectToWifiRequest) => Promise<ConnectToWifiResult>
Param Type
connectToWifiRequest ConnectToWifiRequest

Returns: Promise<ConnectToWifiResult>


connectToWifiBySsidPrefixAndPassword(...)

connectToWifiBySsidPrefixAndPassword(connectToWifiPrefixRequest: ConnectToWifiPrefixRequest) => Promise<ConnectToWifiResult>
Param Type
connectToWifiPrefixRequest ConnectToWifiPrefixRequest

Returns: Promise<ConnectToWifiResult>


checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


requestPermissions()

requestPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


disconnectAndForget()

disconnectAndForget() => Promise<void>

Interfaces

ScanWifiResult

Prop Type
wifis WifiEntry[]

WifiEntry

Prop Type
bssid string
capabilities WifiCapability[]
ssid string
level number
isCurrentWifi boolean

GetCurrentWifiResult

Prop Type
currentWifi WifiEntry

ConnectToWifiResult

Prop Type
wasSuccess true
wifi WifiEntry

ConnectToWifiRequest

Prop Type
ssid string
password string

ConnectToWifiPrefixRequest

Prop Type
ssidPrefix string
password string

PermissionStatus

Prop Type
LOCATION PermissionState
NETWORK PermissionState

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

Enums

WifiCapability

Members Value
WPA2_PSK_CCM 'WPA2-PSK-CCM'
RSN_PSK_CCMP 'RSN-PSK-CCMP'
RSN_SAE_CCM 'RSN-SAE-CCM'
WPA2_EAP_SHA1_CCM 'WPA2-EAP/SHA1-CCM'
RSN_EAP_SHA1_CCMP 'RSN-EAP/SHA1-CCMP'
ESS 'ESS'
ES 'ES'
WP 'WP'

SpecialSsid

Members Value
HIDDEN '[HIDDEN_SSID]'