public abstract class MultiplexBaseTransport extends Object
| Modifier and Type | Field and Description |
|---|---|
String |
connectedDeviceAddress |
protected String |
connectedDeviceName |
static String |
DEVICE_ADDRESS |
static String |
DEVICE_NAME |
static String |
ERROR_REASON_KEY |
protected Handler |
handler |
static String |
LOG |
protected int |
mState |
static byte |
REASON_NONE |
static byte |
REASON_SPP_ERROR |
static int |
STATE_CONNECTED |
static int |
STATE_CONNECTING |
static int |
STATE_ERROR |
static int |
STATE_LISTEN |
static int |
STATE_NONE |
protected TransportRecord |
transportRecord |
protected TransportType |
transportType |
| Modifier | Constructor and Description |
|---|---|
protected |
MultiplexBaseTransport(Handler handler,
TransportType transportType) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAddress() |
String |
getDeviceName() |
int |
getState()
Return the current connection state.
|
TransportRecord |
getTransportRecord()
Should only be called after a connection has been established
|
boolean |
isConnected() |
protected void |
setState(int state) |
protected void |
setState(int state,
Bundle bundle) |
void |
stop() |
protected abstract void |
stop(int state) |
protected void |
stop(int state,
byte error) |
abstract void |
write(byte[] out,
int offset,
int count) |
public static final int STATE_NONE
public static final int STATE_LISTEN
public static final int STATE_CONNECTING
public static final int STATE_CONNECTED
public static final int STATE_ERROR
public static final String ERROR_REASON_KEY
public static final byte REASON_SPP_ERROR
public static final byte REASON_NONE
public static final String LOG
public static final String DEVICE_NAME
public static final String DEVICE_ADDRESS
protected int mState
protected final Handler handler
protected final TransportType transportType
protected TransportRecord transportRecord
protected String connectedDeviceName
public String connectedDeviceAddress
protected MultiplexBaseTransport(Handler handler, TransportType transportType)
protected void setState(int state)
protected void setState(int state,
Bundle bundle)
public String getAddress()
public String getDeviceName()
public TransportRecord getTransportRecord()
public int getState()
public boolean isConnected()
public void stop()
protected abstract void stop(int state)
protected void stop(int state,
byte error)
public abstract void write(byte[] out,
int offset,
int count)