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

BluetoothMasRequestPushMessage

public final class BluetoothMasRequestPushMessage extends BluetoothMasRequest

Fields Summary
private static final String
TYPE
private String
mMsg
private String
mMsgHandle
Constructors Summary
private BluetoothMasRequestPushMessage(String folder)


       
        mHeaderSet.setHeader(HeaderSet.TYPE, TYPE);
        if (folder == null) {
            folder = "";
        }
        mHeaderSet.setHeader(HeaderSet.NAME, folder);
    
public BluetoothMasRequestPushMessage(String folder, String msg, android.bluetooth.client.map.BluetoothMasClient.CharsetType charset, boolean transparent, boolean retry)

        this(folder);
        mMsg = msg;
        ObexAppParameters oap = new ObexAppParameters();
        oap.add(OAP_TAGID_TRANSPARENT, transparent ? TRANSPARENT_ON : TRANSPARENT_OFF);
        oap.add(OAP_TAGID_RETRY, retry ? RETRY_ON : RETRY_OFF);
        oap.add(OAP_TAGID_CHARSET, charset == CharsetType.NATIVE ? CHARSET_NATIVE : CHARSET_UTF8);
        oap.addToHeaderSet(mHeaderSet);
    
Methods Summary
public voidexecute(javax.obex.ClientSession session)

        executePut(session, mMsg.getBytes());
    
public java.lang.StringgetMsgHandle()

        return mMsgHandle;
    
protected voidreadResponseHeaders(javax.obex.HeaderSet headerset)

        try {
            String handle = (String) headerset.getHeader(HeaderSet.NAME);
            if (handle != null) {
                /* just to validate */
                new BigInteger(handle, 16);

                mMsgHandle = handle;
            }
        } catch (NumberFormatException e) {
            mResponseCode = ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
        } catch (IOException e) {
            mResponseCode = ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
        }