From e83b744d7d0b3caaf8f5456b795331d5db2495a3 Mon Sep 17 00:00:00 2001 From: Erik Ljungberg Date: Tue, 22 Mar 2011 07:58:43 +0100 Subject: Unable to push files to Windows 7 Windows 7 says it can handle the maximum OBEX packet size. However if the maximum packet size is used the transfer will fail. This should be fixed by Microsoft but until they do the only way to solve this is to reduce the maximum packet size for the OBEX client. Change-Id: I51975eec972395ae3f1f21cca236b223d0812ef3 --- obex/javax/obex/ClientSession.java | 4 ++-- obex/javax/obex/ObexHelper.java | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'obex') diff --git a/obex/javax/obex/ClientSession.java b/obex/javax/obex/ClientSession.java index 0935383..27d8976 100644 --- a/obex/javax/obex/ClientSession.java +++ b/obex/javax/obex/ClientSession.java @@ -449,8 +449,8 @@ public final class ClientSession extends ObexSession { maxPacketSize = (mInput.read() << 8) + mInput.read(); //check with local max size - if (maxPacketSize > ObexHelper.MAX_PACKET_SIZE_INT) { - maxPacketSize = ObexHelper.MAX_PACKET_SIZE_INT; + if (maxPacketSize > ObexHelper.MAX_CLIENT_PACKET_SIZE) { + maxPacketSize = ObexHelper.MAX_CLIENT_PACKET_SIZE; } if (length > 7) { diff --git a/obex/javax/obex/ObexHelper.java b/obex/javax/obex/ObexHelper.java index 1b66662..7852fe9 100644 --- a/obex/javax/obex/ObexHelper.java +++ b/obex/javax/obex/ObexHelper.java @@ -70,6 +70,12 @@ public final class ObexHelper { */ public static final int MAX_PACKET_SIZE_INT = 0xFFFE; + /** + * Temporary workaround to be able to push files to Windows 7. + * TODO: Should be removed as soon as Microsoft updates their driver. + */ + public static final int MAX_CLIENT_PACKET_SIZE = 0xFC00; + public static final int OBEX_OPCODE_CONNECT = 0x80; public static final int OBEX_OPCODE_DISCONNECT = 0x81; -- cgit v1.1