0
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Test for kernelisimessage
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef _KISITESTER_H_
|
|
21 |
#define _KISITESTER_H_
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include<isikernel.h>
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
// CONSTANTS
|
|
29 |
#define TEST_MSG_REQ 0x0A
|
|
30 |
#define TEST_MSG_RESP 0x0B
|
|
31 |
|
|
32 |
#define TEST_MSG_MEDIA 0x01
|
|
33 |
#define TEST_MSG_RECEIVERDEVICE 0x12
|
|
34 |
#define TEST_MSG_SENDERDEVICE 0x13
|
|
35 |
#define TEST_MSG_RESOURCEID 0x04
|
|
36 |
#define TEST_MSG_LENGTH 0x0014
|
|
37 |
#define TEST_MSG_RECEIVEROBJECT 0x0102
|
|
38 |
#define TEST_MSG_SENDEROBJECT 0x0103
|
|
39 |
#define TEST_MSG_TRANSID 0x09
|
|
40 |
|
|
41 |
#define TEST_MSG_EXTENDEDRESOURCE 0x02F3E0
|
|
42 |
|
|
43 |
#define TEST_MSG_REQ_OFFSET TRANSACTIONID 0
|
|
44 |
#define TEST_MSG_REQ_OFFSET_MESSAGE_ID 1
|
|
45 |
#define TEST_MSG_REQ_OFFSET_FILL1 2
|
|
46 |
#define TEST_MSG_REQ_OFFSET_FILL2 3
|
|
47 |
#define TEST_MSG_REQ_OFFSET_FILL3 4
|
|
48 |
#define TEST_MSG_REQ_OFFSET_FILL4 5
|
|
49 |
#define TEST_MSG_REQ_OFFSET_FILL5 6
|
|
50 |
#define TEST_MSG_REQ_OFFSET_FILL6 7
|
|
51 |
#define TEST_MSG_REQ_OFFSET_FILL7 8
|
|
52 |
#define TEST_MSG_REQ_OFFSET_FILL8 9
|
|
53 |
#define TEST_MSG_REQ_OFFSET_FILL9 10
|
|
54 |
#define TEST_MSG_REQ_OFFSET_FILL10 11
|
|
55 |
|
|
56 |
|
|
57 |
/** 2000 millisecond pulse time (2.0 sec) */
|
|
58 |
const TUint KIsaKernelIfQuery = 2000000;
|
|
59 |
/** Default ISI message size */
|
|
60 |
const TUint16 KDefaultMsgSize = 128;
|
|
61 |
/** Default DFC queue priority */
|
|
62 |
const TUint8 KDefaultDfcPriority = 3;
|
|
63 |
/** Max number of subscribers */
|
|
64 |
const TUint16 KMaxNumberOfSubscribers = 128;
|
|
65 |
|
|
66 |
|
|
67 |
//- Macros ------------------------------------------------------------------
|
|
68 |
|
|
69 |
|
|
70 |
//- External Data -----------------------------------------------------------
|
|
71 |
|
|
72 |
|
|
73 |
//- Variables ---------------------------------------------------------------
|
|
74 |
|
|
75 |
|
|
76 |
//- Forward Declarations ----------------------------------------------------
|
|
77 |
|
|
78 |
class DIsaKernelIf;
|
|
79 |
class TIsiKernelSend;
|
|
80 |
class TIsiKernelReceiveC;
|
|
81 |
// CLASS DECLARATION
|
|
82 |
|
|
83 |
/**
|
|
84 |
* kernelisimessage kernel extension class.
|
|
85 |
*
|
|
86 |
*/
|
|
87 |
|
|
88 |
|
|
89 |
class KisiTester : public DBase
|
|
90 |
{
|
|
91 |
public: // Constructors and destructor
|
|
92 |
KisiTester();
|
|
93 |
virtual ~KisiTester();
|
|
94 |
TInt Init( );
|
|
95 |
void Subscribe(TAny* aCallBack);
|
|
96 |
void StartTesting();
|
|
97 |
void TestSet8Bit();
|
|
98 |
void TestSet16Bit();
|
|
99 |
void TestSet32Bit();
|
|
100 |
void TestCopyData();
|
|
101 |
void TestConstructors();
|
|
102 |
void TestComplete();
|
|
103 |
|
|
104 |
void TestSetReceiverDevice();
|
|
105 |
void TestSetSenderDevice();
|
|
106 |
void TestSetReceiverObject();
|
|
107 |
void TestSetSenderObject();
|
|
108 |
|
|
109 |
void TestSetExtendedResourceId();
|
|
110 |
|
|
111 |
void TestGet8Bit();
|
|
112 |
void TestGet16Bit();
|
|
113 |
void TestGet32Bit();
|
|
114 |
void TestGetData();
|
|
115 |
void TestGetBuffer();
|
|
116 |
TUint16 Get16BitFromTestMessage(const TUint8 *aMessage, TInt aIndex);
|
|
117 |
|
|
118 |
void TestFindSubBlockOffsetById_1(const TSubBlockType aType);
|
|
119 |
void TestFindSubBlockOffsetById_2(const TSubBlockType aType);
|
|
120 |
void TestFindSubBlockOffsetByIndex_1(const TSubBlockType aType);
|
|
121 |
void TestFindSubBlockOffsetByIndex_2(const TSubBlockType aType);
|
|
122 |
void TestGetReceiverDevice();
|
|
123 |
void TestGetSenderDevice();
|
|
124 |
void TestGetReceiverObject();
|
|
125 |
void TestGetSenderObject();
|
|
126 |
|
|
127 |
void TestGetExtendedResourceId();
|
|
128 |
|
|
129 |
void TestGetReceiverDevice_crashtest();
|
|
130 |
|
|
131 |
private: // Data
|
|
132 |
void StartTimer();
|
|
133 |
void StartTimer2();
|
|
134 |
static void IsaKernelIfInit(TAny* aPtr);
|
|
135 |
static void IsaKernelIfInit2(TAny* aPtr);
|
|
136 |
static void RegisterToIsaKernelIfDfc(TAny* aPtr);
|
|
137 |
static void ReceiveDfc(TAny* aPtr);
|
|
138 |
static void CheckResponse(TDesC8* aPnMsg);
|
|
139 |
/** DFC which is used for Receiving ISI-messages */
|
|
140 |
TDfc iReceiveDfc;
|
|
141 |
/** DFC which is used for initializing ISA Kernel IF interface*/
|
|
142 |
TDfc iIsaKernelIfInitDfc;
|
|
143 |
TDfc iIsaKernelIfInitDfc2;
|
|
144 |
/** Pointer to Isa Kernel IF (sending and receiving ISI-messages) */
|
|
145 |
DIsaKernelIf* iIsaKernelIf;
|
|
146 |
DIsaKernelIf* iIsaKernelIf2;
|
|
147 |
/** Pointer to received message */
|
|
148 |
TDes8* iReceiveMsg;
|
|
149 |
TDes8* iReceiveMsg2;
|
|
150 |
TDes8* iSendMsg;
|
|
151 |
/** TImer which is used for ISA Kernel IF init */
|
|
152 |
TTickLink iIsaKernelIfInitTimer;
|
|
153 |
TTickLink iIsaKernelIfInitTimer2;
|
|
154 |
/** ISA Kernel IF Initialisation status */
|
|
155 |
TInt iStatus;
|
|
156 |
TInt iStatus2;
|
|
157 |
/** Length variable for ISA Kernel interface usage */
|
|
158 |
TUint16 iNeededLength;
|
|
159 |
/** Pointer to KisiTesterHandler class*/
|
|
160 |
TAny* iCallBackPtr;
|
|
161 |
|
|
162 |
};
|
|
163 |
|
|
164 |
|
|
165 |
//- Global Function Prototypes ----------------------------------------------
|
|
166 |
|
|
167 |
|
|
168 |
//- Inline Functions --------------------------------------------------------
|
|
169 |
|
|
170 |
|
|
171 |
//- Namespace ---------------------------------------------------------------
|
|
172 |
|
|
173 |
#endif // _KISITESTER_H_
|
|
174 |
|
|
175 |
// End of File
|