equal
deleted
inserted
replaced
|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include <es_sock.h> |
|
17 #include "obexconnectdata.h" |
|
18 |
|
19 TObexConnectData::TObexConnectData () |
|
20 { |
|
21 iVersion = 0; |
|
22 iFlags = 0x00; |
|
23 iMaxPacketLength = 0x0000; |
|
24 } |
|
25 |
|
26 TUint16 TObexConnectData::DoTotalSize () const |
|
27 { |
|
28 return (4); |
|
29 } |
|
30 |
|
31 TUint16 TObexConnectData::ParseIn (TUint8* aSource, const TUint16 aMaxSize) |
|
32 { |
|
33 if (aMaxSize < TotalSize ()) |
|
34 return (0); |
|
35 iVersion = aSource[0]; |
|
36 iFlags = aSource[1]; |
|
37 iMaxPacketLength = BigEndian::Get16 (&aSource[2]); |
|
38 return (TotalSize ()); |
|
39 } |
|
40 |
|
41 TUint16 TObexConnectData::WriteOut (TUint8* aDest, const TUint16 aMaxSize) const |
|
42 { |
|
43 if (aMaxSize < TotalSize ()) |
|
44 return (0); |
|
45 aDest[0] = iVersion; |
|
46 aDest[1] = iFlags; |
|
47 BigEndian::Put16 (&aDest[2], iMaxPacketLength); |
|
48 return (TotalSize ()); |
|
49 } |