FileDocCategorySizeDatePackage
BluetoothMasObexClientSession.javaAPI DocAndroid 5.1 API5525Thu Mar 12 22:22:50 GMT 2015android.bluetooth.client.map

BluetoothMasObexClientSession

public class BluetoothMasObexClientSession extends Object

Fields Summary
private static final String
TAG
private static final byte[]
MAS_TARGET
static final int
MSG_OBEX_CONNECTED
static final int
MSG_OBEX_DISCONNECTED
static final int
MSG_REQUEST_COMPLETED
private final javax.obex.ObexTransport
mTransport
private final android.os.Handler
mSessionHandler
private ClientThread
mClientThread
private volatile boolean
mInterrupted
Constructors Summary
public BluetoothMasObexClientSession(javax.obex.ObexTransport transport, android.os.Handler handler)

        mTransport = transport;
        mSessionHandler = handler;
    
Methods Summary
public booleanmakeRequest(BluetoothMasRequest request)

        if (mClientThread == null) {
            return false;
        }

        return mClientThread.schedule(request);
    
public voidstart()

        if (mClientThread == null) {
            mClientThread = new ClientThread(mTransport);
            mClientThread.start();
        }

    
public voidstop()

        if (mClientThread != null) {
            mClientThread.interrupt();

            (new Thread() {
                @Override
                public void run() {
                    try {
                        mClientThread.join();
                        mClientThread = null;
                    } catch (InterruptedException e) {
                        Log.w(TAG, "Interrupted while waiting for thread to join");
                    }
                }
            }).run();
        }