public class BTConnectThread
extends android.os.HandlerThread
Modifier and Type | Class and Description |
---|---|
static interface |
BTConnectThread.InnerListener |
static interface |
BTConnectThread.Listener |
Modifier and Type | Field and Description |
---|---|
private static int |
BONDED_MAX_TRY |
private static java.lang.String[] |
CHECK_VALUES |
private android.bluetooth.BluetoothDevice |
mDevice |
private android.os.Handler |
mHandler |
private BTConnectThread.InnerListener |
mInnerListener |
private boolean |
mIsStarted |
private BTConnectThread.Listener |
mListener |
private android.os.Handler |
mMainHandler |
private int |
mMaxReconnectCnt |
private boolean |
mReadStop |
private int |
mReconnectCnt |
private static int |
MSG_BT_BONDED_FAILED |
private static int |
MSG_BT_CONNECT |
private static int |
MSG_BT_CONNECTED |
private static int |
MSG_BT_DISCONNECTED |
private static int |
MSG_BT_FORCE_SOCKET_CLOSE |
private static int |
MSG_BT_P2P_READY |
private static int |
MSG_BT_RECONNECTING |
private android.bluetooth.BluetoothSocket |
mSocket |
private java.util.UUID |
mUuid |
private WifiStatusItem |
mWifiStatusItem |
Constructor and Description |
---|
BTConnectThread(android.bluetooth.BluetoothDevice device,
java.lang.String uuid,
android.os.Looper mainLooper,
BTConnectThread.InnerListener listener) |
Modifier and Type | Method and Description |
---|---|
private void |
clear() |
private void |
connect() |
(package private) void |
doStart(BTConnectThread.Listener listener,
int maxReconnectCnt) |
(package private) void |
doStop() |
android.bluetooth.BluetoothDevice |
getConnectedDevice() |
android.bluetooth.BluetoothSocket |
getSocket() |
(package private) boolean |
isConnected() |
private boolean |
isCorrectObject(org.json.JSONObject object) |
protected void |
onLooperPrepared() |
activeCount, 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, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private static final int BONDED_MAX_TRY
private static final int MSG_BT_CONNECT
private static final int MSG_BT_FORCE_SOCKET_CLOSE
private static final int MSG_BT_BONDED_FAILED
private static final int MSG_BT_CONNECTED
private static final int MSG_BT_DISCONNECTED
private static final int MSG_BT_P2P_READY
private static final int MSG_BT_RECONNECTING
private static final java.lang.String[] CHECK_VALUES
private android.bluetooth.BluetoothDevice mDevice
private java.util.UUID mUuid
private android.bluetooth.BluetoothSocket mSocket
private BTConnectThread.Listener mListener
private BTConnectThread.InnerListener mInnerListener
private boolean mReadStop
private int mReconnectCnt
private int mMaxReconnectCnt
private WifiStatusItem mWifiStatusItem
private boolean mIsStarted
private android.os.Handler mMainHandler
private android.os.Handler mHandler
BTConnectThread(android.bluetooth.BluetoothDevice device, java.lang.String uuid, android.os.Looper mainLooper, BTConnectThread.InnerListener listener)
boolean isConnected()
public android.bluetooth.BluetoothSocket getSocket()
public android.bluetooth.BluetoothDevice getConnectedDevice()
void doStart(BTConnectThread.Listener listener, int maxReconnectCnt)
void doStop()
private void clear()
protected void onLooperPrepared()
onLooperPrepared
in class android.os.HandlerThread
private void connect()
private boolean isCorrectObject(org.json.JSONObject object)