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

BluetoothMasRequest

public abstract class BluetoothMasRequest extends Object

Fields Summary
protected static final byte
OAP_TAGID_MAX_LIST_COUNT
protected static final byte
OAP_TAGID_START_OFFSET
protected static final byte
OAP_TAGID_FILTER_MESSAGE_TYPE
protected static final byte
OAP_TAGID_FILTER_PERIOD_BEGIN
protected static final byte
OAP_TAGID_FILTER_PERIOD_END
protected static final byte
OAP_TAGID_FILTER_READ_STATUS
protected static final byte
OAP_TAGID_FILTER_RECIPIENT
protected static final byte
OAP_TAGID_FILTER_ORIGINATOR
protected static final byte
OAP_TAGID_FILTER_PRIORITY
protected static final byte
OAP_TAGID_ATTACHMENT
protected static final byte
OAP_TAGID_TRANSPARENT
protected static final byte
OAP_TAGID_RETRY
protected static final byte
OAP_TAGID_NEW_MESSAGE
protected static final byte
OAP_TAGID_NOTIFICATION_STATUS
protected static final byte
OAP_TAGID_MAS_INSTANCE_ID
protected static final byte
OAP_TAGID_FOLDER_LISTING_SIZE
protected static final byte
OAP_TAGID_MESSAGES_LISTING_SIZE
protected static final byte
OAP_TAGID_SUBJECT_LENGTH
protected static final byte
OAP_TAGID_CHARSET
protected static final byte
OAP_TAGID_STATUS_INDICATOR
protected static final byte
OAP_TAGID_STATUS_VALUE
protected static final byte
OAP_TAGID_MSE_TIME
protected static byte
NOTIFICATION_ON
protected static byte
NOTIFICATION_OFF
protected static byte
ATTACHMENT_ON
protected static byte
ATTACHMENT_OFF
protected static byte
CHARSET_NATIVE
protected static byte
CHARSET_UTF8
protected static byte
STATUS_INDICATOR_READ
protected static byte
STATUS_INDICATOR_DELETED
protected static byte
STATUS_NO
protected static byte
STATUS_YES
protected static byte
TRANSPARENT_OFF
protected static byte
TRANSPARENT_ON
protected static byte
RETRY_OFF
protected static byte
RETRY_ON
protected static final byte[]
FILLER_BYTE
protected javax.obex.HeaderSet
mHeaderSet
protected int
mResponseCode
Constructors Summary
public BluetoothMasRequest()


      
        mHeaderSet = new HeaderSet();
    
Methods Summary
public abstract voidexecute(javax.obex.ClientSession session)

protected voidexecuteGet(javax.obex.ClientSession session)

        ClientOperation op = null;

        try {
            op = (ClientOperation) session.get(mHeaderSet);

            /*
             * MAP spec does not explicitly require that GET request should be
             * sent in single packet but for some reason PTS complains when
             * final GET packet with no headers follows non-final GET with all
             * headers. So this is workaround, at least temporary. TODO: check
             * with PTS
             */
            op.setGetFinalFlag(true);

            /*
             * this will trigger ClientOperation to use non-buffered stream so
             * we can abort operation
             */
            op.continueOperation(true, false);

            readResponseHeaders(op.getReceivedHeader());

            InputStream is = op.openInputStream();
            readResponse(is);
            is.close();

            op.close();

            mResponseCode = op.getResponseCode();
        } catch (IOException e) {
            mResponseCode = ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;

            throw e;
        }
    
protected voidexecutePut(javax.obex.ClientSession session, byte[] body)

        Operation op = null;

        mHeaderSet.setHeader(HeaderSet.LENGTH, Long.valueOf(body.length));

        try {
            op = session.put(mHeaderSet);

            DataOutputStream out = op.openDataOutputStream();
            out.write(body);
            out.close();

            readResponseHeaders(op.getReceivedHeader());

            op.close();
            mResponseCode = op.getResponseCode();
        } catch (IOException e) {
            mResponseCode = ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;

            throw e;
        }
    
public final booleanisSuccess()

        return (mResponseCode == ResponseCodes.OBEX_HTTP_OK);
    
protected voidreadResponse(java.io.InputStream stream)

        /* nothing here by default */
    
protected voidreadResponseHeaders(javax.obex.HeaderSet headerset)

        /* nothing here by default */