BluetoothMasRequestPushMessagepublic 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 void | execute(javax.obex.ClientSession session)
executePut(session, mMsg.getBytes());
| public java.lang.String | getMsgHandle()
return mMsgHandle;
| protected void | readResponseHeaders(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;
}
|
|