// private stuff
private void openObexMode() throws IOException {
Log.debug(this.getClass(), "opening obex mode");
sendByteArray(new ByteArray("AT\\Q3\r","ISO-8859-1"));
waitForATResponseWithOK(DEFAULT_INTERNAL_AT_RESPONSE_TIMEOUT, true);
sendByteArray(new ByteArray("AT^SQWE=0\r","ISO-8859-1"));
waitForATResponseWithOK(DEFAULT_INTERNAL_AT_RESPONSE_TIMEOUT, true);
sendByteArray(new ByteArray("AT^SQWE=3\r","ISO-8859-1"));
waitForATResponseWithOK(DEFAULT_INTERNAL_AT_RESPONSE_TIMEOUT, true);
Log.debug(this.getClass(), "connecting obex");
ByteArray fsUid = new ByteArray(new byte[] { (byte) 0x6b, (byte) 0x01, (byte) 0xcb, (byte) 0x31, (byte) 0x41, (byte) 0x06, (byte) 0x11, (byte) 0xd4, (byte) 0x9a, (byte) 0x77, (byte) 0x00, (byte) 0x50, (byte) 0xda, (byte) 0x3f, (byte) 0x47, (byte) 0x1f });
ByteArray targetHeader = new ByteArray();
targetHeader.append(Obex.HEADER_TARGET);
targetHeader.append(Obex.shortToBytes(3+fsUid.length()));
targetHeader.append(fsUid);
ByteArray req = new ByteArray();
req.append(Obex.REQUEST_CONNECT);
req.append(Obex.shortToBytes(7+targetHeader.length()));
req.append(0x13); // obex version
req.append(0x00); // flags
req.append(Obex.shortToBytes(0xffff)); // max packet length
req.append(targetHeader);
sendByteArray(req);
ByteArray response = receiveObexResponse(DEFAULT_OBEX_RESPONSE_TIMEOUT);
validateResponseCode(response);
inObexMode = true;
}