public class BTConnectHelper extends android.content.BroadcastReceiver implements BTConnectThread.InnerListener
Modifier and Type | Class and Description |
---|---|
static interface |
BTConnectHelper.Listener
this listener call back to bluetooth state from broadcast receiver.
|
Modifier and Type | Field and Description |
---|---|
private android.bluetooth.BluetoothAdapter |
mBluetoothAdapter |
private BTCommandHelper |
mCommandHelper |
private android.bluetooth.BluetoothDevice |
mConnectedDevice |
private BTConnectThread |
mConnectThread |
private android.content.Context |
mContext |
private int |
mDiscoveryCnt |
private boolean |
mFoundDevice |
private boolean |
mIsRegistered |
private boolean |
mIsTryToConnect |
private boolean |
mKeepDiscovery |
private BTConnectHelper.Listener |
mListener |
private int |
mMaxDiscoveryCnt |
private java.lang.String |
mSelectedBTAddress |
private boolean |
mStopDiscovery |
private android.bluetooth.BluetoothDevice |
mTargetDevice |
private static java.lang.String |
UUID |
Constructor and Description |
---|
BTConnectHelper(android.content.Context context) |
Modifier and Type | Method and Description |
---|---|
void |
completedConnect(android.bluetooth.BluetoothDevice device,
android.bluetooth.BluetoothSocket socket) |
void |
connect(android.bluetooth.BluetoothDevice device,
int maxReconnectCnt,
BTConnectThread.Listener listener) |
void |
disconnect() |
java.util.ArrayList<android.bluetooth.BluetoothDevice> |
getBondedBTList() |
android.bluetooth.BluetoothDevice |
getConnectedDevice() |
int |
getDiscoveryCnt() |
boolean |
isBondedDevice(android.bluetooth.BluetoothDevice device) |
boolean |
isConnected() |
boolean |
isDiscovering() |
boolean |
isEnabled() |
boolean |
isTryToConnect() |
void |
onReceive(android.content.Context context,
android.content.Intent intent) |
void |
registerReceiver(android.content.Context context) |
boolean |
requestExitRTSP(BTCommandHelper.Listener listener) |
void |
selectedBTAddress(java.lang.String bluetoothAddress) |
void |
setIsTryConnect(boolean isTryToConnect) |
void |
startDiscovery(int maxDiscoveryCnt,
boolean keep,
BTConnectHelper.Listener listener) |
void |
stopDiscovery() |
void |
unregisterReceiver(android.content.Context context) |
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras
private static final java.lang.String UUID
private android.content.Context mContext
private android.bluetooth.BluetoothAdapter mBluetoothAdapter
private android.bluetooth.BluetoothDevice mConnectedDevice
private android.bluetooth.BluetoothDevice mTargetDevice
private BTConnectThread mConnectThread
private BTCommandHelper mCommandHelper
private BTConnectHelper.Listener mListener
private boolean mFoundDevice
private boolean mStopDiscovery
private boolean mKeepDiscovery
private int mDiscoveryCnt
private int mMaxDiscoveryCnt
private boolean mIsTryToConnect
private boolean mIsRegistered
private java.lang.String mSelectedBTAddress
public void selectedBTAddress(java.lang.String bluetoothAddress)
public boolean isEnabled()
public void registerReceiver(android.content.Context context)
public void unregisterReceiver(android.content.Context context)
public void onReceive(android.content.Context context, android.content.Intent intent)
onReceive
in class android.content.BroadcastReceiver
public java.util.ArrayList<android.bluetooth.BluetoothDevice> getBondedBTList()
public int getDiscoveryCnt()
public android.bluetooth.BluetoothDevice getConnectedDevice()
public void startDiscovery(int maxDiscoveryCnt, boolean keep, BTConnectHelper.Listener listener)
public boolean isDiscovering()
public void stopDiscovery()
public void connect(android.bluetooth.BluetoothDevice device, int maxReconnectCnt, BTConnectThread.Listener listener)
public void disconnect()
public boolean isConnected()
public boolean isTryToConnect()
public boolean isBondedDevice(android.bluetooth.BluetoothDevice device)
public boolean requestExitRTSP(BTCommandHelper.Listener listener)
public void completedConnect(android.bluetooth.BluetoothDevice device, android.bluetooth.BluetoothSocket socket)
completedConnect
in interface BTConnectThread.InnerListener
public void setIsTryConnect(boolean isTryToConnect)
setIsTryConnect
in interface BTConnectThread.InnerListener