Interface IWifiInterface
interface IWifiInterface
Extends com.amazon.apmf.IStandard
The IWifiInterface interface provides the API to manage Wi-Fi network
interface. This lets a Kepler Native application scan nearby Wi-Fi access
points, manage Wi-Fi access point profiles, setup Wi-Fi connections and
monitor Wi-Fi connection events.
Methods
addWifiEventListener()
Register a listener for receiving Wi-Fi scan and connection events. SeevoidaddWifiEventListener(IWifiEventListener*listener)
IWifiEventListener.
Parameters
listener
IWifiEventListener* — Required
Listener for receiving Wi-Fi scan and connection events.
removeWifiEventListener()
void removeWifiEventListener()
Unregister the listener for receiving Wi-Fi scan and connection events.
addProfileEventListener()
Register a listener for receiving Wi-Fi Profile change. SeevoidaddProfileEventListener(IProfileEventListener*listener)
IProfileEventListener.
Parameters
listener
IProfileEventListener* — Required
Listener for receiving Wi-Fi profile event.
removeProfileEventListener()
void removeProfileEventListener()
Unregister the listener for receiving Wi-Fi Profile change.
startScan()
void startScan()
Request a Wi-Fi scan asynchronously.
Upon completion of Wi-Fi scan, onScanDone() in the registered
IWifiEventListener is triggered.
Requires com.amazon.wifi.privilege.wifi-scan
getScanResults()
Get the results of the latest Wi-Fi scan.com.amazon.kepler.net.wifi.common.IScanResultItem*[]getScanResults()
Returns
com.amazon.kepler.net.wifi.common.IScanResultItem*[]
the array of access points discovered from the most recent scan.
Requires com.amazon.wifi.privilege.wifi-scan
getProfiles()
Get Wi-Fi Profiles in the system.com.amazon.kepler.net.wifi.common.IProfile*[]getProfiles()
Returns
com.amazon.kepler.net.wifi.common.IProfile*[]
the array of IProfile.
Credential information in each Profile is hidden. With the additional
permission, the credential is displayed.
Requires com.amazon.wifi.privilege.net-info
Requires com.amazon.wifi.privilege.read-wifi-credential for credential
information.
createProfile()
Create a new Wi-Fi Profile.com.amazon.kepler.net.wifi.common.IProfile*createProfile()
Returns
com.amazon.kepler.net.wifi.common.IProfile*
IProfile new Profile.
createIIpConfiguration()
Create a newcom.amazon.kepler.net.common.IIpConfiguration*createIIpConfiguration()
IIpConfiguration to configure the network interface.
Returns
com.amazon.kepler.net.common.IIpConfiguration*
IIpConfiguration.
addProfile()
Add a new Wi-Fi Profile.voidaddProfile(com.amazon.kepler.net.wifi.common.IProfile*profile)
Parameters
profile
com.amazon.kepler.net.wifi.common.IProfile* — Required
new Profile to be added.
Requires com.amazon.network.privilege.net-admin
removeProfile()
Remove a Wi-Fi Profile.voidremoveProfile(stringssid,com.amazon.kepler.net.wifi.common.AuthMode*authMode)
Parameters
ssid
string — Required
the SSID of the profile to be removed.
authMode
com.amazon.kepler.net.wifi.common.AuthMode* — Required
the authentication mode of the Profile to be removed.
authMode can be set to AuthMode.UNKNOWN to match the access point without
authentication mode.
Requires com.amazon.network.privilege.net-admin
saveProfiles()
void saveProfiles()
Save Wi-Fi Profiles in the system.
Requires com.amazon.network.privilege.net-admin
enableProfiles()
Enable or disable all Wi-Fi Profiles.voidenableProfiles(boolenable)
Parameters
enable
bool — Required
if true, enable all Wi-Fi Profiles. If false,
disable all Wi-Fi Profiles.
Requires com.amazon.network.privilege.net-admin
connect()
Connect to the access point stored in Wi-Fi Profiles.voidconnect(stringssid,com.amazon.kepler.net.wifi.common.AuthMode*authMode)
Parameters
ssid
string — Required
SSID of the access point to connect.
authMode
com.amazon.kepler.net.wifi.common.AuthMode* — Required
authentication mode of the access point to connect.
authMode can be set to AuthMode.UNKNOWN to match the access point with
any authentication mode.
Requires com.amazon.network.privilege.net-admin
disconnect()
void disconnect()
Disconnect the connected access point.
Requires com.amazon.network.privilege.net-admin
getConnectionInfo()
Get the current connection information.com.amazon.kepler.net.wifi.common.IConnectionInfo?getConnectionInfo()
Returns
com.amazon.kepler.net.wifi.common.IConnectionInfo?
The return value is optional and might be absent.
the current connection information.
If privilege is not granted, SSID will be masked
as <unknown ssid>, BSSID will be masked to
02:00:00:00:00:00
Requires com.amazon.wifi.privilege.net-info
calculateSignalLevel()
Get the level of the signal strength.i8calculateSignalLevel(i8rssi,i8levels)
Parameters
rssi
i8 — Required
Received Signal Strength Indicator (RSSI) in dBm.
levels
i8 — Required
the number of levels to calculate.
Returns
i8
a level of signal.
getStandard()
com.amazon.kepler.net.wifi.common.Standard getStandard()
Get the supported Wi-Fi Standard.
Returns
com.amazon.kepler.net.wifi.common.Standard
Standard.
getStatisticsInfo()
Get the statistic information.com.amazon.kepler.net.wifi.common.IStatisticsInfo?getStatisticsInfo()
Returns
com.amazon.kepler.net.wifi.common.IStatisticsInfo?
The return value is optional and might be absent.
IStatisticsInfo.

