|
1 // Copyright (c) 2004-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 // Started by Mal, August 1997 |
|
15 // IrLAN mbuf function header. |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #if !defined(__IRLANBUF_H__) |
|
25 #define __IRLANBUF_H__ |
|
26 |
|
27 /***********************************************************/ |
|
28 // FORMAT OF AN IRLAN CONTROL PACKET IS AS FOLLOWS: |
|
29 // 1 + 1 + 1022 |
|
30 // command + parametercount + parameterlist |
|
31 // |
|
32 // FORMAT OF PARAMETER LIST IS AS FOLLOWS: |
|
33 // 1 + <=255 + 2 + (<=1016) |
|
34 // paramnamelength + paramname + paramvaluelen + paramvalue |
|
35 /***********************************************************/ |
|
36 |
|
37 const TInt EIrlanSenderPriority=10; //< Constant Specifies Sender Priority Need to be less than IrDA ao's |
|
38 const TInt EIrlanReceiverPriority=20; //< Constant Specifies Receiver Priority. |
|
39 const TInt EIrlanControlPriority=20; //< Constant Specifies Control Priority. |
|
40 const TUint KIrlanBufSize=1540; //< Constant Specifies Buffer Size. |
|
41 const TUint KParameterFrameMaxSize=1024; //< Constant Specifies Parameter Max Frame Size. |
|
42 const TUint KParameterNameMaxSize=255; //< Constant Specifies Paramter Max Name Size. |
|
43 const TUint KParameterValueMaxSize=1016; //< Constant Specifies Paramter Max value Size. |
|
44 const TUint KCommandCodeFieldOffset=0; //< Constant Specifies command code field offset |
|
45 const TUint KParameterCountFieldOffset=1; //< Constant Specifies parameter count field offset |
|
46 const TUint KParameterListFieldOffset=2; //< Constant Specifies parameter list field offset. |
|
47 const TUint KCommandFrameMinSize=2; //< ie no params,Constant Specifies command min frame size. |
|
48 const TUint KMediaCommandFrameSize=15; //< Constant Specifies Media command frame size, ie 2+ 1+5+2+5 |
|
49 /** |
|
50 Constant Specifies open data command frame size. |
|
51 ie 2+ 1+5+2+5 + 1+11+2+6 |
|
52 */ |
|
53 const TUint KOpenDataCommandFrameSize=35; |
|
54 /** |
|
55 Constant Specifies filter command min frame size. |
|
56 ie 2+ 1+9+2+1 + 1+11+2+8 + need to add! |
|
57 */ |
|
58 const TUint KFilterCommandMinFrameSize=37; |
|
59 //const TUint KGetInfoRespLength=28; // ie 2+ 1+5+2+4 +1+9+2+2 |
|
60 const TUint8 KIrlanHomeControlPort=7; //< Constant specifies Home control port. |
|
61 const TUint8 KIrlanHomeDataPort=8; //< Constant specifies Home data port. |
|
62 const TUint KFlagReadQueued = 0x01; //< Constant specifies Read queued. |
|
63 const TUint KFlagWriteQueued = 0x02; //< Constant specifies write queued. |
|
64 |
|
65 /** |
|
66 IrLAN specific mbuf functionality |
|
67 @internalComponent |
|
68 */ |
|
69 class RIrlanControlMBufChain : public RMBufChain |
|
70 { |
|
71 public: |
|
72 void SetCommandCode(TUint8 aCode); |
|
73 TUint8 GetCommandCode(); |
|
74 void SetResultCode(TUint8 aCode); |
|
75 TUint8 GetResultCode(); |
|
76 void SetParameterCount(TUint8 aCode); |
|
77 TUint8 GetParameterCount(); |
|
78 |
|
79 void SetParameterNameLength(TInt aOffset,TUint8 aLength); |
|
80 TUint8 GetParameterNameLength(TInt aOffset); |
|
81 void SetParameterName(TInt aOffset,const TDesC8& aName); |
|
82 void GetParameterName(TInt aOffset,TInt aLength,TDes8& aName); |
|
83 TUint16 GetParameterValueLength(TInt aOffset); |
|
84 void SetParameterValueLength(TInt aOffset,TUint16 aCount); |
|
85 void SetParameterValue(TInt aOffset,const TDesC8& aValue); |
|
86 void GetParameterValue(TInt aOffset,TInt aLength,TDes8& aValue); |
|
87 private: |
|
88 }; |
|
89 |
|
90 #endif |