Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface INetManager

interface INetManager
Extends com.amazon.apmf.IStandard The INetManager interface provides APIs to manage network interfaces in the system. Using the API, a Kepler Native application can perform the following:
  • Manage network interfaces (Wi-Fi, Ethernet, etc.)
  • Query network status
  • Monitor network connections and network events

Methods

addNetworkEventListener()

void addNetworkEventListener(INetworkEventListener* listener)
Register a INetworkEventListener to be notified of network events. The caller must implement a INetworkEventListener to receive notifications about changes in the network status and captive portal state.

Parameters

listener
INetworkEventListener* — Required INetworkEventListener to register.

removeNetworkEventListener()

void removeNetworkEventListener()
Unregister INetworkEventListener.

getNetworkInterfaces()

com.amazon.kepler.net.common.INetworkInterface*[] getNetworkInterfaces(com.amazon.kepler.net.common.NetworkInterfaceType* interfaceType)
Get network interfaces in the system. This is used to query network interfaces for the given network interface type. If NetworkInterfaceType.NONE is given, all network interfaces in the system are returned.

Parameters

interfaceType
com.amazon.kepler.net.common.NetworkInterfaceType* — Required NetworkInterfaceType to query. NetworkInterfaceType.NONE can be used to query all network interfaces.

Returns

com.amazon.kepler.net.common.INetworkInterface*[] the network interfaces that are matched with the given NetworkInterfaceType.

getActiveNetworkInterface()

com.amazon.kepler.net.common.INetworkInterface? getActiveNetworkInterface()
Get the default active network interface for Internet access.

Returns

com.amazon.kepler.net.common.INetworkInterface? The return value is optional and might be absent. the default active network interface.

enableNetworkInterface()

void enableNetworkInterface(u8 networkInterfaceId, bool enable, bool persist)
Enable or disable a network interface.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface to enable or disable. Use Constants.DEFAULT_NETWORK_INTERFACE_ID_ID for the default network interface.
enable
bool — Required true to enable the network interface or false to disable.
persist
bool — Required true to store the setting persistently after device restart. Requires com.amazon.network.privilege.net-admin

isNetworkInterfaceEnabled()

void isNetworkInterfaceEnabled(u8 networkInterfaceId, out bool* enable, out bool* persist)
Check whether the network interface is enabled.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface to check. Use Constants.DEFAULT_NETWORK_INTERFACE_ID for the default network interface.
enable (out)
bool* — Required true if the network interface is enabled.
persist (out)
bool* — Required true if the network interface is persistent after restart.

getIpConfig()

com.amazon.kepler.net.common.IIpConfiguration? getIpConfig(u8 networkInterfaceId, com.amazon.kepler.net.common.IpVersion* ipVersion)
Get the specified network interface IP configuration.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface. Use Constants.DEFAULT_NETWORK_INTERFACE_ID for the default network interface.
ipVersion
com.amazon.kepler.net.common.IpVersion* — Required IpVersion.

Returns

com.amazon.kepler.net.common.IIpConfiguration? The return value is optional and might be absent. ipInfo IIpConfiguration that contains the IP information.

createIIpConfiguration()

com.amazon.kepler.net.common.IIpConfiguration* createIIpConfiguration()
Make a new IIpConfiguration object to configure the network interface.

Returns

com.amazon.kepler.net.common.IIpConfiguration* IIpConfiguration.

setIpConfig()

void setIpConfig(u8 networkInterfaceId, com.amazon.kepler.net.common.IIpConfiguration* ipConfiguration)
Set IP configuration on the specified network interface.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface. Use Constants.DEFAULT_NETWORK_INTERFACE_ID for the default network interface.
ipConfiguration
com.amazon.kepler.net.common.IIpConfiguration* — Required IIpConfiguration that contains the IP configuration to set on the network interface. Requires com.amazon.network.privilege.net-admin

getNetworkState()

com.amazon.kepler.net.common.NetworkState getNetworkState(u8 networkInterfaceId, com.amazon.kepler.net.common.IpVersion* ipVersion)
Get network state of the specified network interface.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface. Use Constants.DEFAULT_NETWORK_INTERFACE_ID for the default network interface.
ipVersion
com.amazon.kepler.net.common.IpVersion* — Required ipVersion.

Returns

com.amazon.kepler.net.common.NetworkState state NetworkState.

getMacAddress()

string getMacAddress(u8 networkInterfaceId)
Get the MAC address of the specified network interface.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface. Use Constants.DEFAULT_NETWORK_INTERFACE_ID for the default network interface.

Returns

string the MAC address of the network interface. Requires com.amazon.privilege.restricted-net-info

evaluateCaptivePortal()

void evaluateCaptivePortal(u8 networkInterfaceId)
Evaluate a captive portal asynchronously. onCaptivePortalEvaluated() is called back on registered NetworkEventCallback when the captive portal evaluation is completed.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface. Use Constants.DEFAULT_NETWORK_INTERFACE_ID for the default network interface. Requires com.amazon.network.privilege.net-admin

getCaptivePortalState()

com.amazon.kepler.net.common.CaptivePortalState getCaptivePortalState(u8 networkInterfaceId)
Get the current captive portal state of the specified network interface. Return the current captive portal state without initiating a new captive portal evaluation.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface. Use Constants.DEFAULT_NETWORK_INTERFACE_ID for the default network interface.

Returns

com.amazon.kepler.net.common.CaptivePortalState CaptivePortalState.

getNetworkCapabilities()

com.amazon.kepler.net.common.NetworkCapabilities[] getNetworkCapabilities(u8 networkInterfaceId)
Get network capabilities of the specified network interface.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface to get network capabilities. Use Constants.DEFAULT_NETWORK_INTERFACE_ID for the default network interface.

Returns

com.amazon.kepler.net.common.NetworkCapabilities[] Upon success, an array of NetworkCapabilities is returned. Upon failure, it throws an excpetion.

getLinkSpeed()

u64 getLinkSpeed(u8 networkInterfaceId)
Get the link speed of the specified network interface in bps.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface to get the link speed.

Returns

u64 the link speed in bps.

createNetworkProxyInfo()

com.amazon.kepler.net.common.INetworkProxyInfo* createNetworkProxyInfo()
Make a new INetworkProxyInfo object.

Returns

com.amazon.kepler.net.common.INetworkProxyInfo* INetworkProxyInfo.

setNetworkProxy()

void setNetworkProxy(u8 networkInterfaceId, com.amazon.kepler.net.common.INetworkProxyInfo* networkProxyInfo)
Set network proxy configuration to the specified network interface.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface. Use Constants.DEFAULT_NETWORK_INTERFACE_ID for the default network interface.
networkProxyInfo
com.amazon.kepler.net.common.INetworkProxyInfo* — Required INetworkProxyInfo that contains network proxy information to be set on the network interface Requires com.amazon.network.privilege.net-admin

getNetworkProxy()

com.amazon.kepler.net.common.INetworkProxyInfo? getNetworkProxy(u8 networkInterfaceId)
Get network proxy configuration of the specified network interface.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface. Use Constants.DEFAULT_NETWORK_INTERFACE_ID for the default network interface.

Returns

com.amazon.kepler.net.common.INetworkProxyInfo? The return value is optional and might be absent. INetworkProxyInfo that contains network proxy configuration of the specified network interface.

getNetworkSpeed()

u64 getNetworkSpeed(u8 networkInterfaceId)
Get the expected network throughput/speed of the specified network interface in bps.

Parameters

networkInterfaceId
u8 — Required the identifier of the network interface to query.

Returns

u64 the expected network throughput/speed in bps.
Last modified on October 29, 2026