comparison src/gpf/inc/pco_const.h @ 0:4e78acac3d88

src/{condat,cs,gpf,nucleus}: import from Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:23:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4e78acac3d88
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : PCO2
4 | Modul : inc\pco_const.h
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : This header provides defines for all the messages send
18 | between pco components
19 +-----------------------------------------------------------------------------
20 */
21
22
23 #ifndef _PCO_CONST_H_
24 #define _PCO_CONST_H_
25
26 /*==== INCLUDES ==================================================*/
27 #include "ipcapi.h"
28
29 /*==== GENERAL CONSTANTS ==================================================*/
30 enum T_PCOSTATUS {PCO_RUNNING,PCO_STOPPED,PCO_LOGFILE};
31
32 #define PCO_SEND_TIMEOUT 10000
33
34 #define PCO_TTYPE_UNKNOWN 0
35 #define PCO_TTYPE_MS 1 // milliseconds since reset
36 #define PCO_TTYPE_HMSM 2 // current time of day in ms
37 #define PCO_TTYPE_FRAME 3 // frame number since reset
38
39 #define CTRL_MSG_MAX_SIZE MSG_MAX_SIZE /* from ipc */
40 #define CTRL_DATA_MAX_SIZE CTRL_MSG_MAX_SIZE-sizeof(MSG_HEADER)
41
42 #define DATA_MSG_MAX_SIZE 65535
43 #define DATA_MSG_DEF_SIZE 2300
44
45 #define MAX_QNAME_LEN 50
46 #define MAX_PATH_LEN 2300
47 #define MAX_ENTITY_NLEN 5
48
49 #define MAX_PRIM_NAME 30
50
51 #define PCO_DEF_SRV_NAME "PCOS"
52
53 #ifdef _DEBUG
54 #define PCO_CFG_PATH "../../cfg/"
55 #else
56 #define PCO_CFG_PATH "../cfg/"
57 #endif
58
59 #ifdef _WIN32
60 #define DEF_CCDDATA_PATH "ccddata_dll.dll"
61 #endif
62
63
64 #define PCO_MAX_TRACECLASS 32
65 const char PCO_TC_NAME[PCO_MAX_TRACECLASS][MAX_PRIM_NAME]=
66 {
67 "FUNCTION TRACE",
68 "EVENT TRACE",
69 "PRIMITIVE TRACE",
70 "STATE TRACE",
71 "SYSTEM TRACE",
72 "INTERRUPT-SIGNAL TRACE",
73 "ERROR TRACE",
74 "CCD TRACE",
75 "TIMER TRACE",
76 "PROFILER TRACE",
77
78 "<TRACE>",
79 "<TRACE>",
80 "<TRACE>",
81 "<TRACE>",
82
83 "USER1 TRACE",
84 "USER2 TRACE",
85 "USER3 TRACE",
86 "USER4 TRACE",
87 "USER5 TRACE",
88 "USER6 TRACE",
89 "USER7 TRACE",
90 "USER8 TRACE",
91
92 "<TRACE>",
93 "<TRACE>",
94 "<TRACE>",
95 "<TRACE>",
96 "<TRACE>",
97 "<TRACE>",
98 "<TRACE>",
99 "<TRACE>",
100 "<TRACE>",
101 "<TRACE>"
102 };
103
104 /*==== PCO CONTROL MESSAGES ==================================================*/
105 #define MSG_ID( Group, Code ) (((Group) << 8) + ((Code) & 0xFF))
106
107 #define PCO_SRV_GROUP 0x1E
108 #define PCO_VIEW_GROUP 0x1F
109
110
111
112 #define PCO_CONNECT MSG_ID(PCO_SRV_GROUP,0x01) /* L3SRV_CONNECT */
113 /*
114 data:
115 char[] name of CMS-queue in which the viewer wants to receive traces/primitives
116 (zero terminated)
117
118 purpose:
119 sent from viewer to server to establish connection, server adds client to its list
120 */
121
122 #define PCO_DISCONNECT MSG_ID(PCO_SRV_GROUP,0x02) /* L3SRV_DISCONNECT */
123 /*
124 data:
125
126 purpose:
127 sent from viewer to server to disconnect, server removes client from its list
128 */
129
130 #define PCO_SUBSCRIBE MSG_ID(PCO_SRV_GROUP,0x03) /* L3SRV_SUBSCRIBE */
131 /*
132 data:
133 char[] mobile ID (may be empty) (zero terminated)
134
135 purpose:
136 sent from viewer to server to receive live data of a dedicated mobile
137 */
138
139
140 #define PCO_UNSUBSCRIBE MSG_ID(PCO_SRV_GROUP,0x04) /* L3SRV_UNSUBSCRIBE */
141 /*
142 data:
143
144 purpose:
145 sent from viewer to server to stop receiving of live data
146 */
147
148
149 /* MSG_ID(PCO_SRV_GROUP,0x05) L3SRV_ENABLE_LOGGING */
150
151
152
153 #define PCO_OPEN_LOGFILE MSG_ID(PCO_SRV_GROUP,0x06) /* L3SRV_LOAD_LOG_FILE */
154 /*
155 data:
156 char[] name of sessionfile with full path or just a session name (zero terminated)
157 LONG first entry to be sent
158 LONG last entry to be sent
159
160 purpose:
161 sent from viewer to server to receive logged data of a specified session
162 sent from controller to open a session logfile -> new state of server: PCO_LOGFILE.
163 */
164
165
166 #define PCO_COPY_LOGFILE MSG_ID(PCO_SRV_GROUP,0x07) /* L3SRV_COPY_LOG_FILE */
167 /*
168 data:
169 char[] name of source sessionfile with full path (zero terminated)
170 char[] name of destination sessionfile with full path (zero terminated)
171 LONG first entry to be copied
172 LONG last entry to be copied
173
174 purpose:
175 sent from viewer to server to make it copy a specified session into another
176 sessionsfile while applying the filter currently set
177 */
178
179
180 #define PCO_SET_FILTER MSG_ID(PCO_SRV_GROUP,0x08) /* L3SRV_SET_SERVER_FILTER */
181 /*
182 data:
183 char[] list ... zero separated entity names ("\0\0"==end)
184 e.g.: "MM\0RR\0SS\0\0" or "+"MM\0RR\0\0"
185 - first entity=="+" -> only this entities will be forwarded
186 - default: specified entities will not be forwarded
187 prim_trace ... optional parameter to disable/enable general forwarding of
188 primitives/traces:
189 0 .. fowarding of everything (default)
190 1 .. no primitives
191 2 .. no traces
192
193 purpose:
194 sent from viewer to server to set the entity filter for this viewer
195 */
196
197
198 /* MSG_ID(PCO_SRV_GROUP,0x09) L3SRV_SET_MOBILE_FILTER */
199
200 /* MSG_ID(PCO_SRV_GROUP,0x0A) L3SRV_GET_MOBILE_FILTER */
201
202
203 #define PCO_EXIT MSG_ID(PCO_SRV_GROUP,0x0B) /* L3SRV_EXIT */
204 /*
205 data:
206
207 purpose:
208 sent to server to make it exit, server will send this message
209 to all connected viewers before exiting
210 */
211
212
213 /* MSG_ID(PCO_SRV_GROUP,0x0C) L3SRV_LOG_FILE */
214
215
216
217 #define PCO_DATA MSG_ID(PCO_SRV_GROUP,0x0D) /* L3SRV_DATA */
218 /*
219 data:
220 rawdata ... depends on server type
221
222 purpose:
223 sent from some servers to viewers (others send data without header)
224 contains rawdata which has to be interpreted depending on server type
225 */
226
227
228 /* MSG_ID(PCO_SRV_GROUP,0x0E) L3SRV_FILTER */
229
230
231 #define PCO_CONNECTED MSG_ID(PCO_SRV_GROUP,0x0F) /* L3SRV_CONNECTED */
232 /*
233 data:
234 byte ... server type id (see server types)
235
236 purpose:
237 sent from server to viewer to inform about an established connection and
238 to tell its type
239 */
240
241
242 #define PCO_OK MSG_ID(PCO_SRV_GROUP,0x10) /* L3SRV_OK */
243 /*
244 data:
245 U16 ID of message which will be confirmed by this PCO_OK
246
247 purpose:
248 sent by a receiver to the sender to confirm receiving and correct interpretation of a control message
249 */
250
251
252 #define PCO_ERROR MSG_ID(PCO_SRV_GROUP,0x11) /* L3SRV_ERROR */
253 /*
254 data:
255 U16 ID of message which has produced the error
256 byte error code (see error codes)
257
258 purpose:
259 sent by a receiver to the sender to inform about an error a received control message has raised
260 */
261
262
263
264 #define PCO_STOP_TESTSESSION MSG_ID(PCO_SRV_GROUP,0x12)
265 /*
266 data:
267
268 purpose:
269 sent to the server to stop a running testsession
270 */
271
272 #define PCO_START_TESTSESSION MSG_ID(PCO_SRV_GROUP,0x13)
273 /*
274 data:
275 Char[] session name (zero terminated)
276 USHORT (optional)
277 0 .. don't create dbg-files
278 1 .. create dbg-files
279
280 purpose:
281 sent to the server to start a new testsession
282 */
283
284 #define PCO_CLOSE_LOGFILE MSG_ID(PCO_SRV_GROUP,0x14)
285 /*
286 data:
287
288 purpose:
289 sent to server to disable logfile-mode -> new state PCO_STOPPED.
290 */
291
292 #define PCO_GET_LOGFILE_DATA MSG_ID(PCO_SRV_GROUP,0x15)
293 /*
294 data:
295 ULONG start index
296 ULONG end index
297
298 purpose:
299 sent to server (which has to be in PCO_LOGFILE state) to make
300 him forwarding all logged data from the current session
301 file (which matches the index constraints) to the sender
302 (has to be a connected viewer).
303 */
304
305 #define PCO_SEND_PRIM MSG_ID(PCO_SRV_GROUP,0x16)
306 /*
307 data:
308 char[] receiver (zero terminated)
309 char[] text (zero terminated)
310
311 purpose:
312 to request server to send a CONFIG-primitive to TST, not supported by all servers (knowledge of FRAME is necessary)
313 */
314
315
316 #define PCO_STATUS MSG_ID(PCO_SRV_GROUP,0x17)
317 /*
318 data:
319 <none> .. if sent from controller to server
320
321 T_PCOSTATUS .. current status of server (see T_PCOSTATUS)
322 Char[] .. name of testsession (can be empty, zero terminated)
323
324 purpose:
325 sent from controller to server to request its current status,
326 sent from server to controller to publish its current status
327 */
328
329 #define PCO_GET_TESTSESSIONS MSG_ID(PCO_SRV_GROUP,0x18)
330 /*
331 data:
332
333 purpose:
334 sent from controller to server to acquire a list of available session names (which are stored in current server testsession directory)
335 */
336
337 #define PCO_TESTSESSIONS MSG_ID(PCO_SRV_GROUP,0x19)
338 /*
339 data:
340 char[] .. zero separated testsession names ("\0\0"==end)
341 USHORT .. 1 - more messages will follow
342 0 - last messages with testsessions
343
344 purpose:
345 reply to PCO_GET_TESTSESSIONS
346 */
347
348
349 #define PCO_SET_SESSIONPATH MSG_ID(PCO_SRV_GROUP,0x1A)
350 /*
351 data:
352 char[] .. zero terminated path-string
353 USHORT .. 1 - store new path in ini-file
354 0 - don't store new path
355 (optional, default is 0)
356
357 purpose:
358 sent to server to set new session path
359 */
360
361 #define PCO_DISTRIB_LOGFILE MSG_ID(PCO_SRV_GROUP,0x1B)
362 /*
363 data:
364 LONG first entry to be sent
365 LONG last entry to be sent
366
367 purpose:
368 sent to server (in logfile mode) to make him send logged data to all clients
369 */
370
371 #define PCO_GET_SESSIONPATH MSG_ID(PCO_SRV_GROUP,0x1C)
372 /*
373 data:
374
375 purpose:
376 sent to server to get its current session path
377 */
378
379 #define PCO_SESSIONPATH MSG_ID(PCO_SRV_GROUP,0x1D)
380 /*
381 data:
382 char[] .. zero terminated path-string
383
384 purpose:
385 sent from server as reply to PCO_GET_SESSIONPATH
386 */
387
388 #define PCO_SET_TIME_STAMP_PERIOD MSG_ID(PCO_SRV_GROUP,0x1E)
389 /*
390 data:
391 UINT .. new value for time stamp period
392 0 ... no time stamps
393 >0 .. period in minutes
394
395 purpose:
396 sent to server to set new time stamp period value
397 */
398
399 #define PCO_RENAME_LOGFILE MSG_ID(PCO_SRV_GROUP,0x1F)
400 /*
401 data:
402 char[] original name of sessionfile (evtl. with full path, zero terminated)
403 char[] new name of sessionfile (evtl. with full path, zero terminated)
404
405 purpose:
406 sent to server to make it rename a session logfile
407 */
408
409 #define PCO_GET_LOGFILE_INFO MSG_ID(PCO_SRV_GROUP,0x20)
410 /*
411 data:
412 Char[] name of sessionfile with full path or just a session name (zero terminated)
413
414 purpose:
415 sent to server to request info's (e.g. count of entries) about the specified logfile
416 */
417
418 #define PCO_LOGFILE_INFO MSG_ID(PCO_SRV_GROUP,0x21)
419 /*
420 data:
421 LONG count of entries in logfile specified in last PCO_GET_LOGFILE_INFO
422 Char[] optional name of ccddata-file used during logging (zero terminated)
423 ULONG optional str2ind version
424 Char[] optional name of str2ind-table-file used during logging (zero terminated)
425
426 purpose:
427 sent from server to a sender of PCO_GET_LOGFILE_INFO
428 */
429
430
431 #define PCO_TO_FRONT MSG_ID(PCO_VIEW_GROUP,0x01) /* L3VWR_TO_FRONT */
432 /*
433 data:
434
435 purpose:
436 sent from GUI-controller to server to indicate activation of ctrl window
437 sent from server to all viewers to indicate activation of ctrl window
438 sent from server back to controller to indicate activation of viewers
439 */
440
441 #define PCO_SYNCHRONIZE MSG_ID(PCO_VIEW_GROUP,0x05)
442 /*
443 data:
444 ULONG time in ms
445
446 purpose:
447 sent from a viewer A to server to indicate change in the view to a new time stamp
448 sent from server to all viewers except A to synchronize them with A
449 */
450
451 #define PCO_LOGFILE_COMPLETE MSG_ID(PCO_VIEW_GROUP,0x06)
452 /*
453 data:
454
455 purpose:
456 sent from server to a viewers after complete forwarding of a requested logfile
457 */
458
459 #define PCO_INIFILE_CHANGED MSG_ID(PCO_VIEW_GROUP,0x07)
460 /*
461 data:
462
463 purpose:
464 sent from viewer to server and then to all other viewers after an ini-file change
465 which should be handled immediatly by all viewers
466 */
467
468 #define PCO_CLEAN MSG_ID(PCO_VIEW_GROUP,0x08)
469 /*
470 data:
471
472 purpose:
473 sent from viewer to server and then to all other viewers to inform them that the user
474 has cleaned the viewer content
475 */
476
477 #define PCO_STOP_LOGFILE MSG_ID(PCO_SRV_GROUP,0x22)
478 /*
479 data:
480 Char[] queue name (zero terminated)
481
482 purpose:
483 sent to the server to stop logging into the logfile connected with given queue
484 */
485
486 #define PCO_START_LOGFILE MSG_ID(PCO_SRV_GROUP,0x23)
487 /*
488 data:
489 Char[] logfile name (zero terminated)
490 Char[] queue name (zero terminated)
491
492 purpose:
493 sent to the server to start logging all data which will be received in the given queue
494 (the queue will be created by the server)
495 */
496
497 #define PCO_LOAD_CCDDATA MSG_ID(PCO_SRV_GROUP,0x24)
498 /*
499 data:
500 Char[] name of ccddata-file to be loaded (zero terminated)
501
502 purpose:
503 sent to server to command it to load the specified ccddata-DLL
504 */
505
506
507 /*==== PCO ERROR CODES ==================================================*/
508
509 #define PCO_ERR_NONE 0x00
510
511 #define PCO_ERR_TOO_MANY_VIEWERS 0x01
512 #define PCO_ERR_ALREADY_CONNECTED 0x02
513 #define PCO_ERR_ALREADY_SUBSCRIBED 0x03
514 #define PCO_ERR_NOT_CONNECTED 0x04
515 #define PCO_ERR_NOT_SUBSCRIBED 0x05
516 #define PCO_ERR_FILE_OPEN_ERROR 0x06
517 //0x07: log file not for this viewer
518 #define PCO_ERR_FILE_READ_ERROR 0x08
519 #define PCO_ERR_FILE_WRITE_ERROR 0x09
520
521 #define PCO_ERR_TSESSION_NOT_RUNNING 0x10
522 #define PCO_ERR_TSESSION_RUNNING 0x11
523 #define PCO_ERR_TSFILE_OPEN 0x12
524 #define PCO_ERR_TSFILE_NOT_OPEN 0x14
525 #define PCO_ERR_WRONG_FILE_TYPE 0x15
526 #define PCO_ERR_TSFILE_TOO_NEW 0x16
527 #define PCO_ERR_TOO_MANY_LOGGERS 0x17
528 #define PCO_ERR_QUEUE_OPEN_ERROR 0x18
529 #define PCO_ERR_LOGGER_NOT_FOUND 0x19
530
531 #define PCO_ERR_TST_NOT_AVAILABLE 0x20
532
533 /*==== PCO SERVER TYPES ==================================================*/
534
535 #define PCO_STYPE_NONE 0x00
536 #define PCO_STYPE_PCOS 0x23
537 #define PCO_STYPE_L3SRV 0x1E
538
539
540 #endif /*_PCO_CONST_H_*/