public class RestSoftAPConnector
extends com.microej.example.wifi.setup.SoftAPConnector
SoftAPConfiguration
using rest endpoints. Three endpoints are available:
ScanEndPoint
at url /scan
JoinEndPoint
at url /join
DiagnosticEndPoint
at url /diagnostic
Modifier and Type | Class and Description |
---|---|
static class |
RestSoftAPConnector.STATE
The server states.
|
Constructor and Description |
---|
RestSoftAPConnector()
Instantiates a
RestSoftAPConnector . |
RestSoftAPConnector(com.microej.example.wifi.setup.ConfigurationManager configurationManager)
Instantiates a RestSoftAPConnector with a
ConfigurationManager . |
RestSoftAPConnector(com.microej.example.wifi.setup.ConfigurationManager configurationManager,
int port)
Instantiates a RestSoftAPConnector with a
ConfigurationManager . |
RestSoftAPConnector(com.microej.example.wifi.setup.ConfigurationManager configurationManager,
int port,
ej.net.util.wifi.WifiNetworkManager manager)
Instantiates a RestSoftAPConnector with a
ConfigurationManager . |
RestSoftAPConnector(int port)
Instantiates a
RestSoftAPConnector with a given port. |
Modifier and Type | Method and Description |
---|---|
protected void |
addEnpoints(RestartableServer server)
Adds the server endpoints.
|
java.lang.String |
getAccesses()
Gets the access point in cache.
|
java.lang.String |
getJoined()
Gets the cached joined.
|
int |
getServerPort()
Gets the server port.
|
RestSoftAPConnector.STATE |
getState()
Gets the server state.
|
protected void |
onMount(ej.ecom.wifi.SoftAPConfiguration softAPConfiguration) |
protected void |
onSuccessfulJoin(ej.net.util.wifi.AccessPointConfiguration accessPointConfiguration) |
protected void |
onUnmount() |
void |
setServerPort(int serverPort)
Sets the server port.
|
void |
start() |
void |
stop() |
void |
triggerJoin(ej.net.util.wifi.AccessPointConfiguration accessPointConfiguration)
Triggers a join.
|
void |
triggerUpdateAccess()
Triggers an update of the access points.
|
protected void |
unmountSoftAP() |
public RestSoftAPConnector() throws java.io.IOException
RestSoftAPConnector
.java.io.IOException
- When initialisation fails.public RestSoftAPConnector(int port) throws java.io.IOException
RestSoftAPConnector
with a given port.port
- the server port.java.io.IOException
- When initialisation fails.public RestSoftAPConnector(com.microej.example.wifi.setup.ConfigurationManager configurationManager) throws java.io.IOException
ConfigurationManager
.configurationManager
- the ConfigurationManager
managing access points configuration..java.io.IOException
- When initialisation fails.public RestSoftAPConnector(com.microej.example.wifi.setup.ConfigurationManager configurationManager, int port) throws java.io.IOException
ConfigurationManager
.configurationManager
- the ConfigurationManager
.port
- the server port.java.io.IOException
- When initialisation fails.public RestSoftAPConnector(com.microej.example.wifi.setup.ConfigurationManager configurationManager, int port, @NonNull ej.net.util.wifi.WifiNetworkManager manager) throws java.io.IOException
ConfigurationManager
.configurationManager
- the ConfigurationManager
.port
- the server port.manager
- the WifiNetworkManager
to use.java.io.IOException
- When initialisation fails.public void start() throws java.io.IOException
start
in class com.microej.example.wifi.setup.SoftAPConnector
java.io.IOException
public void stop()
stop
in class com.microej.example.wifi.setup.SoftAPConnector
public int getServerPort()
public void setServerPort(int serverPort)
serverPort
- the server portpublic RestSoftAPConnector.STATE getState()
public void triggerUpdateAccess()
WifiNetworkManager.supportScanWhileSoftAP()
public void triggerJoin(ej.net.util.wifi.AccessPointConfiguration accessPointConfiguration)
accessPointConfiguration
- the configuration to join.WifiNetworkManager.getCapabilities()
public java.lang.String getAccesses()
public java.lang.String getJoined()
protected void onSuccessfulJoin(ej.net.util.wifi.AccessPointConfiguration accessPointConfiguration)
onSuccessfulJoin
in class com.microej.example.wifi.setup.SoftAPConnector
protected void onMount(ej.ecom.wifi.SoftAPConfiguration softAPConfiguration)
onMount
in class com.microej.example.wifi.setup.SoftAPConnector
protected void unmountSoftAP() throws java.io.IOException
unmountSoftAP
in class com.microej.example.wifi.setup.SoftAPConnector
java.io.IOException
protected void onUnmount()
onUnmount
in class com.microej.example.wifi.setup.SoftAPConnector
protected void addEnpoints(RestartableServer server) throws java.io.IOException
server
- the server.java.io.IOException
- if the endpoints could not be added.