public class Server
extends java.lang.Thread
| Constructor | Description |
|---|---|
Server(Token tk,
int deviceId,
java.lang.String model,
java.lang.String firmware,
java.lang.String hardware,
org.json.JSONObject network,
java.lang.String macAddress,
long lifeTime,
org.json.JSONObject accessPoint) |
Create a simple de.sg_o.app.miio.server.
|
| Modifier and Type | Method | Description |
|---|---|---|
org.json.JSONObject |
getAccessPoint() |
|
int |
getDeviceId() |
|
java.lang.String |
getFirmware() |
|
java.lang.String |
getHardware() |
|
long |
getLifeTime() |
|
java.lang.String |
getMacAddress() |
|
java.lang.String |
getModel() |
|
org.json.JSONObject |
getNetwork() |
|
Token |
getTk() |
|
void |
registerOnServerEventListener(OnServerEventListener listener) |
Register a listener that handles device specific commands.
|
void |
run() |
Start the de.sg_o.app.miio.server.
|
void |
setAccessPoint(org.json.JSONObject accessPoint) |
|
void |
setLifeTime(long lifeTime) |
|
void |
setNetwork(org.json.JSONObject network) |
|
void |
terminate() |
Terminate the de.sg_o.app.miio.server.
|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic Server(Token tk, int deviceId, java.lang.String model, java.lang.String firmware, java.lang.String hardware, org.json.JSONObject network, java.lang.String macAddress, long lifeTime, org.json.JSONObject accessPoint) throws java.net.SocketException
tk - The token to encrypt the communication with.deviceId - The devices ID used during communication.model - The devices model identification.firmware - The devices firmware version.hardware - The devices hardware version.network - The network the device is connected to.macAddress - The devices mac address.lifeTime - The total time the device has been running foraccessPoint - The access point the device is connected to.java.net.SocketException - When something went wrong during the creation of the listening socket.public void registerOnServerEventListener(OnServerEventListener listener)
listener - The listener to add.public void terminate()
public void run()
run in class java.lang.Threadpublic int getDeviceId()
public Token getTk()
public java.lang.String getModel()
public java.lang.String getFirmware()
public java.lang.String getHardware()
public java.lang.String getMacAddress()
public org.json.JSONObject getNetwork()
public void setNetwork(org.json.JSONObject network)
network - The network the device is connected to.public long getLifeTime()
public void setLifeTime(long lifeTime)
lifeTime - The total time the device has been running forpublic org.json.JSONObject getAccessPoint()
public void setAccessPoint(org.json.JSONObject accessPoint)
accessPoint - The access point the device is connected to.Copyright © 2018. All rights reserved.