From deec005b23b3524bba7f12e8896e167058a67ca8 Mon Sep 17 00:00:00 2001 From: Ashwini Munigala Date: Fri, 24 Jul 2015 18:08:25 +0530 Subject: OBEX: Set Min maxPacketLength negotiated in CONNECT Operation. Set OBEX Server maxRxLength to the minium value acceptable from either server and client during CONNECT Operation. Below basic and all PUT test cases fail without this fix, as the maxPacketLength for later is less than maxRxLength of server. TC_MSE_MMU_BV_03_I TC_MSE_MMU_BV_02_I Change-Id: Iaa4f92e3146dc13d647dca12c84eb43b91657efa --- obex/javax/obex/ServerSession.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'obex/javax') diff --git a/obex/javax/obex/ServerSession.java b/obex/javax/obex/ServerSession.java index acee5dd..dcd0ce8 100644 --- a/obex/javax/obex/ServerSession.java +++ b/obex/javax/obex/ServerSession.java @@ -658,6 +658,12 @@ public final class ServerSession extends ObexSession implements Runnable { */ byte[] sendData = new byte[totalLength]; int maxRxLength = ObexHelper.getMaxRxPacketSize(mTransport); + //PTS expects least of maxPacketLen + if(maxRxLength > mMaxPacketLength) { + if(V) Log.v(TAG,"Set maxRxLength to min of maxRxServrLen:" + maxRxLength + + " and MaxNegotiated from Client: " + mMaxPacketLength); + maxRxLength = mMaxPacketLength; + } sendData[0] = (byte)code; sendData[1] = length[2]; sendData[2] = length[3]; -- cgit v1.1