public abstract class BaseDevice
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connect to remote device.
|
void |
destroy()
This method should called at onDestroy method of Activity or Fragment to make sure the lifecycle of this object is safe.
|
void |
disconnect()
Disconnect to remote device.
|
boolean |
equals(java.lang.Object obj) |
CommunicationType |
getCommunicationType() |
ConnectionState |
getConnectionState() |
java.lang.String |
getDeviceIp() |
java.lang.String |
getDeviceMacAddr() |
java.lang.String |
getDeviceName() |
java.lang.String |
getDevicePort() |
void |
send(byte[] cmd) |
void |
setCommunicationCallback(CommunicationCallback communicationCallback) |
void |
setDeviceDebugCallback(com.gigatms.DeviceDebugCallback deviceDebugCallback) |
public static final java.lang.String VERSION
public void setCommunicationCallback(CommunicationCallback communicationCallback)
communicationCallback
- set the CommunicationCallbackpublic void setDeviceDebugCallback(com.gigatms.DeviceDebugCallback deviceDebugCallback)
public void connect()
If the connection state if changed, CommunicationCallback
will called didUpdateConnection.
If a message if send, CommunicationCallback
will called didTransceiverSend
.
If a message if send, CommunicationCallback
will called didTransceiverReceive
.
public void disconnect()
If the connection state if changed, CommunicationCallback
will called didUpdateConnection.
public void send(byte[] cmd)
cmd
- Ths command which is going to send to remote device.public java.lang.String getDeviceName()
public CommunicationType getCommunicationType()
public ConnectionState getConnectionState()
public java.lang.String getDeviceMacAddr()
public java.lang.String getDeviceIp()
public java.lang.String getDevicePort()
public void destroy()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object