stec-platform
pdscmsg.h
1 /*
2 *
3 * $LastChangedDate: 2014-08-14 12:47:21 -0400 (Thu, 14 Aug 2014) $
4 * $LastChangedBy: ed $
5 * $Revision: 61 $
6 * $Author: ed $
7 * $URL: svn+ssh://svn.vremsoft.com/var/share/svn/tags/platfom3.4.3/platformlib/qnxtalk/pdscmsg.h $
8 * $Id: pdscmsg.h 61 2014-08-14 16:47:21Z ed $
9 * edc@vremsoft.com
10 *
11 * 19
12 *
13 * *** 2014<c> ***
14 *
15 *
16 */
17 
18 #ifndef MSG_H
19 #define MSG_H
20 
21 #if defined(__GNUC__) || defined(_WIN32)
22 #pragma pack(push,1)
23 #endif
24 
25 #include <qglobal.h>
26 #define _CHAR qint8
27 #define _UCHAR quint8
28 #define _UINT quint32
29 #define _INT qint32
30 #define _SHORT qint16
31 #define _USHORT quint16
32 #define _SIZET quint32
33 
34 #ifdef PDS_NATIVE // set up a trick so we can use this file on NT for compiling
35 #include <pds.h> // we are on a native qnx with a build for pds.h
36 #else
37 #pragma pack(1)
38 
39 #ifndef PblId // we are on NT and no-one has define PblID
40 typedef struct // define the exact size for NT, cannot send the pds.h to NT it is too wild
41 {
42  _UCHAR pbl_id[163]; // make a dummy struct for NT to use and ref for returns only
43 
44 } PblId;
45 
46 #ifndef PBLNAME_MAX
47 #define PBLNAME_MAX 64
48 #endif
49 #ifndef PBLDESC_MAX
50 #define PBLDESC_MAX 256
51 
52 // Ascii string limit in the NT ..added for backward compatibility JGM
53 #ifdef _WIN32
54 #ifndef ASCII_STR_MAX
55 #define ASCII_STR_MAX 255
56 #endif
57 #endif
58 
59 #if defined(__GNUC__) || defined(_WIN32) //added win32, which also include win64 BTW.. JGM
60 typedef _UCHAR ArticleType;
61 
63 #define at_char 0
64 
66 #define at_int2 at_char + 1
67 
69 #define at_int4 at_int2 + 1
70 
72 #define at_float at_int4 + 1
73 
75 #define at_double at_float + 1
76 
78 #define at_struct at_double + 1
79 
81 #define at_stream at_struct + 1
82 
84 #define at_ascii at_stream + 1
85 
87 #define at_error at_ascii + 1
88 
89 /* these are PDS only */
90 
92 #define at_time_sec at_error + 1
93 
95 #define at_time_milli at_time_sec + 1
96 
98 #define at_alarm at_time_milli + 1
99 
101 #define at_variant at_alarm + 1
102 
103 #else
107 typedef enum {
108  /* these types are the same as Net2 */
109 
111  at_char = 0,
112 
114  at_int2,
115 
117  at_int4,
118 
120  at_float,
121 
123  at_double,
124 
126  at_struct,
127 
129  at_stream,
130 
132  at_ascii,
133 
135  at_error,
136 
137  /* these are PDS only */
139  at_time_sec,
140 
142  at_time_milli,
143 
145  at_alarm,
146 
148  at_variant
149 } ArticleType;
150 
151 #endif
152 
153 #if defined(__GNUC__) || defined(_WIN32)
154 // enums should never go out a network, but since watcom optimizes automatically and todd started this with qnx we must comply
155 typedef _UCHAR UpdateId;
156 
157 #define ui_login 0
158 #define ui_publisher ui_login + 1
159 #define ui_subscriber ui_publisher + 1
160 
161 #else
162 typedef enum {
163  ui_login,
164  ui_publisher,
165  ui_subscriber
166 } UpdateId;
167 #endif
168 
169 typedef _CHAR PblDesc[PBLDESC_MAX + 1];
170 
171 
172 #if defined(__GNUC__) || defined(_WIN32)
173 
177 typedef struct
178 {
180  ArticleType type;
182  _SIZET typeSz;
184  PblDesc desc;
186  _SIZET articleSz;
187 
189  _SIZET firstArticle;
190 
192  _SIZET nbrArticles;
193 
195  UpdateId who;
196 } PblHdr;
197 #endif
198 
199 
200 
201 #endif
202 #endif
203 #endif
204 
209 typedef struct
210 {
212  ArticleType type;
213 
215  _SIZET typeSz;
216 
218  _SIZET articleSz;
219 
221  _SIZET firstArticle;
222 
224  _SIZET nbrArticles;
225 
227 
228  UpdateId who;
230 
232 
234 #define JUST_DONT_USE 0
235 
237 #define TIMER_P_HANDLE 1
238 
240 #define SUBSCRIBE_ALL 2
241 
243 #define NAME_FOUND_EXT 'a'
244 
246 #define NAME_FOUND 'A'
247 
249 #define PUBLISH_THIS 'B'
250 
252 #define SUBSCRIBE_TO_THIS 'C'
253 
255 #define UPDATE_THIS 'D'
256 
258 #define SUBSCRIBER_FOUND 'E'
259 
261 #define UPDATE_ALL_SUBSCRIBERS 'F'
262 
264 #define PUBLISH_DATA_PBLID 'G'
265 
267 #define DELETE_ALL_PUBLISHERS 'H'
268 
270 #define DELETE_ALL_SUBSCRIBERS 'I'
271 
273 #define DELETE_THIS_PUBLISHER 'J'
274 
276 #define DELETE_THIS_SUBSCRIBER 'K'
277 
279 #define PROCEEDURE_ERROR 'L'
280 
282 #define PUBLICATION_ERROR 'M'
283 
285 #define SUBSCRIPTION_ERROR 'N'
286 
288 #define PUBLISHER_FOUND 'O'
289 
291 #define NO_PUBLICATION 'P'
292 
294 #define PUBLISH_THIS_WITH_INFO 'Q'
295 
297 #define FLOATING_NAME_FOUND 'r'
298 
300 #define PUBLICATION_EXISTS_BEGIN 'S'
301 
303 #define PUBLICATION_EXISTS_END 's'
304 
306 #define NAME_LOST 'X'
307 
309 #define SOCKET_UP 'Y'
310 
312 #define HEART_BEAT 'Z'
313 
314 #define TIMER_P_TIMER 500
315 
317 #define HEART_BEAT_TIMER 5
318 
319 
321 #define SOCKET_TIME_OUT 30
322 
326 typedef struct
327 {
329  _UCHAR Command;
331  _INT ID;
334 
337 
339 
343 typedef struct
344 {
346  _UCHAR Command;
347 
349  _INT ID;
350 
351 } DeleteThisPubSub; // delete this Publication to discrition
352 
353 
357 typedef struct
358 {
360  _UCHAR Command;
361 
363  _INT ID;
364 
365 }PubSubError; // delete this Publication to discrition
366 
367 
371 typedef struct
372 {
374  _UCHAR Command;
375 
376 }DeleteAllPubSub; // delete all the publications or discirtions
377 
378 
379 
384 typedef struct {
385  _UCHAR Command;
386  _INT ID;
387  _UINT NameLength;
388 } PublishSubScribeHeader; // publish or subscribe to
389 
393 typedef struct {
394  _UCHAR Command;
395  _INT ID;
396  _CHAR PublicationName [PBLNAME_MAX + 1];
397  _CHAR PublicationDesc [PBLDESC_MAX + 1];
398  _UCHAR articleType;
399  _UINT maxCount;
400  _UINT articleSize;
401 } PublishSubScribeHeaderWithInfo; // publish or subscribe to
402 
403 
408 typedef struct {
410  _UCHAR Command;
412  _INT ID;
413  _UINT ErrorNameLength;
414 } BridgeError; // Name of error
415 
419 typedef struct {
422 
424  _UINT index;
425 
427  _UINT count;
428 
430 
434 typedef struct // this creates a PblID on the NT side.
435 {
437  _UCHAR Command;
438 
440  _INT ID;
441 
443  _UINT sizePblId;
444 
447 } PublisherCreated; // a publisher was created
448 
449 
454 
461 typedef struct {
463  _UCHAR Command;
464 
466  _INT ID;
467 
469  _UINT sizePblId;
470 
473 
475  _UINT index;
476 
478  _UINT count;
479 
481  _UINT articleSize;
482 
484  _UCHAR articleType;
486 
487 
493 typedef struct
494 {
496  _UCHAR Command;
497 
499  _INT ID;
500 
502  _UINT sizePblId;
503 
506 
508  _UINT index;
509 
511  _UINT count;
512 
513 } ReqUpdata;
514 
515 #ifdef _WIN32
516 #define USETHIS 1
517 #endif
518 
519 #if USETHIS
525 typedef struct
526 {
528  _UCHAR Command;
529 
531  _CHAR PublicationName [PBLNAME_MAX + 1];
532 
534  _CHAR PublicationDesc [PBLDESC_MAX + 1];
535 
537  _UCHAR articleType;
538 
540  _UINT maxCount;
541 
543  _UINT articleSize;
544 
545 } ExtendedPublicationNameFound;
546 #endif
547 
548 
549 
550 #if defined(__GNUC__) || defined(_WIN32)
551 #pragma pack(pop)
552 #endif
553 
554 #endif
Definition: pdscmsg.h:408
_UCHAR Command
Command of message.
Definition: pdscmsg.h:410
_INT ID
Id of the.
Definition: pdscmsg.h:412
Definition: pdscmsg.h:372
_UCHAR Command
command byte
Definition: pdscmsg.h:374
Definition: pdscmsg.h:344
_UCHAR Command
Command of message.
Definition: pdscmsg.h:346
_INT ID
Id of the Pub or Sub to delete.
Definition: pdscmsg.h:349
Definition: pdscmsg.h:210
UpdateId who
who is updating FLU
Definition: pdscmsg.h:228
_SIZET firstArticle
start index
Definition: pdscmsg.h:221
ArticleType type
This indicates the type of data, at_char, at_float, etc... as published by a GDS publisher.
Definition: pdscmsg.h:212
_SIZET nbrArticles
number of index
Definition: pdscmsg.h:224
_SIZET articleSz
size of one element in the array
Definition: pdscmsg.h:218
_SIZET typeSz
soon to be removed and replaced with nbrRows and nbrCols
Definition: pdscmsg.h:215
Definition: pdscmsg.h:41
Definition: pdscmsg.h:358
_INT ID
Id of the publication or subsciption of the offender.
Definition: pdscmsg.h:363
_UCHAR Command
Command of message.
Definition: pdscmsg.h:360
Definition: pdscmsg.h:393
Definition: pdscmsg.h:384
Definition: pdscmsg.h:435
_UINT sizePblId
size of PblID, this is needed because pbl is not used on remote, but is needed to be passed around th...
Definition: pdscmsg.h:443
_INT ID
Id of created publication.
Definition: pdscmsg.h:440
PblId pbl
Used by gds only, but must be past in it's entirety to gds on this publication always.
Definition: pdscmsg.h:446
_UCHAR Command
Command of message.
Definition: pdscmsg.h:437
Definition: pdscmsg.h:494
_UINT count
Numnber of articles.
Definition: pdscmsg.h:511
_UCHAR Command
Command of message.
Definition: pdscmsg.h:496
_UINT sizePblId
Size of PblId pbl.
Definition: pdscmsg.h:502
_INT ID
Update ID.
Definition: pdscmsg.h:499
PblId pbl
Used by gds only, but must be past in it's entirety to gds on this publication always.
Definition: pdscmsg.h:505
_UINT index
Index or start of the array.
Definition: pdscmsg.h:508
Definition: pdscmsg.h:419
PublishSubScribeHeader hdr
Header portion.
Definition: pdscmsg.h:421
_UINT count
Number of articles to subscribe to.
Definition: pdscmsg.h:427
_UINT index
Starting index to subscribe to.
Definition: pdscmsg.h:424
Definition: pdscmsg.h:327
_SHORT PublisherLocal
Local or global publication.
Definition: pdscmsg.h:333
_INT PublisherID
Id of publication.
Definition: pdscmsg.h:336
_UCHAR Command
Transefer command.
Definition: pdscmsg.h:329
_INT ID
Id for routing.
Definition: pdscmsg.h:331
Definition: pdscmsg.h:461
_UINT articleSize
size of of a single element
Definition: pdscmsg.h:481
_UCHAR articleType
type of data, at_float, at_char etc..
Definition: pdscmsg.h:484
_UINT count
Number of Articles to update.
Definition: pdscmsg.h:478
PblId pbl
Used by gds only, but must be past in it's entirety to gds on this publication always.
Definition: pdscmsg.h:472
_INT ID
Id of publication or subscription.
Definition: pdscmsg.h:466
_UINT sizePblId
Size of PblId pbl.
Definition: pdscmsg.h:469
_UCHAR Command
Command of message.
Definition: pdscmsg.h:463
_UINT index
Index to begin updating.
Definition: pdscmsg.h:475