ngc 1.4.0
 
Loading...
Searching...
No Matches
ngcbIFC.hpp
Go to the documentation of this file.
1
7#ifndef ngcbIFC_H
8#define ngcbIFC_H
9
10
11#ifndef __cplusplus
12#error This is a C++ include file and cannot be used from plain C
13#endif
14
15#include <ngc/core/ngcb.h>
16#include <ngc/core/ngcbAddr.h>
17#include <ngc/core/ngcbSIM.hpp>
18#include <ngc/core/ngcbI2C.hpp>
19#include <ngc/core/ngcbAFE.hpp>
20#include <ngc/core/ngcbLIST.hpp>
22
26#define ngcbIFC_TIMEOUT_DEFAULT 5 // Timeout in seconds
27
28/*
29 * Interface class internal addresses
30 */
31#define ngcbIFC_CLASS_VERSION 0x00000001 //< Interface class SW version
32
33/*
34 * I/O-operations
35 */
36#define ngcbIFC_OP_WR 0x0 //< Write to address
37#define ngcbIFC_OP_RD 0x1 //< Read from address
38#define ngcbIFC_OP_EVT 0x2 //< Poll device events
39
40/*
41 * Event codes
42 */
43#define ngcbEVT_PENDING -1 //< Event pending
44#define ngcbEVT_SUCCESS 0 //< Event received
45#define ngcbEVT_TIMEOUT 1 //< Event timeout
46#define ngcbEVT_FAILURE 2 //< Event failure
47#define ngcbEVT_INVALID 3 //< Event invalid
48#define ngcbEVT_COND_FAIL 0x00010000 //< Event fail condition
49
50/*
51 * RPC states
52 */
53#define RPC_STATE_INVALID 0x00000000 //< Invalid state
54#define RPC_STATE_SEND 0x00000001 //< Request is being send
55#define RPC_STATE_RECEIVED 0x00000002 //< Request received
56#define RPC_STATE_WAITING 0x00000003 //< Waiting
57#define RPC_STATE_DONE 0x000000FF //< Request has been handled
58#define RPC_STATE_BUSY 0x40000000 //< Busy
59#define RPC_STATE_ERROR 0x80000000 //< Error
60#define RPC_STATE_ERROR_UNKNOWN_CMD (RPC_STATE_ERROR | 1) //< Unknown CMD
61#define RPC_STATE_ERROR_BUSY (RPC_STATE_ERROR | 2) //< Busy
62#define RPC_STATE_ERROR_OUT_OF_MEMORY (RPC_STATE_ERROR | 3) //< No memory
63#define RPC_STATE_ERROR_TOO_LONG (RPC_STATE_ERROR | 4) //< Too long
64#define RPC_STATE_ERROR_UNKNOWN_DEVICE (RPC_STATE_ERROR | 5) //< Unknown DEV
65#define RPC_STATE_ERROR_BUFFER_TOO_SMALL (RPC_STATE_ERROR | 6) //< Too small
66#define RPC_STATE_ERROR_UNKNOWN_CHANNEL (RPC_STATE_ERROR | 7) //< Unknown chan
67#define RPC_STATE_ERROR_TRANSFER_FAILED (RPC_STATE_ERROR | 8) //< TX error
68
74 int numHdr;
75
78
80 ngcb_route_t(const ngcb_route_t &other) {
81 int i;
82 for (i=0;i<other.numHdr;i++) hdr[i] = other.hdr[i];
83 for (i=other.numHdr;i<ngcbMAX_MOD;i++) hdr[i] = 0x0;
84 numHdr = other.numHdr;
85 }
86
89 int i;
90 numHdr = 0;
91 for (i=0;i<ngcbMAX_MOD;i++) hdr[i] = 0x0;
92 }
93
95 explicit ngcb_route_t(int board) {
96 int i;
97 if (board < 1) board = 1;
98 else if (board > ngcbMAX_MOD) board = ngcbMAX_MOD;
99 for (i=0;i<(board - 1);i++) hdr[i] = 0x5;
100 hdr[i++] = 0x2;
101 numHdr = i;
102 for (i=numHdr;i<ngcbMAX_MOD;i++) hdr[i] = 0x0;
103 }
104
106 bool operator==(const ngcb_route_t &other) const {
107 if (numHdr != other.numHdr) return (false);
108 else
109 {
110 int i;
111 for (i=0;i<numHdr;i++) if (hdr[i] != other.hdr[i]) return (false);
112 return (true);
113 }
114 }
115
118 if (this != &other)
119 {
120 int i;
121 for (i=0;i<other.numHdr;i++) hdr[i] = other.hdr[i];
122 numHdr = other.numHdr;
123 }
124 return (*this);
125 }
126
128 int Board() const {
129 if ((numHdr > 0) && (numHdr <= ngcbMAX_MOD))
130 {
131 return (numHdr);
132 }
133 else
134 {
135 return (0);
136 }
137 }
138
140 int Last() const {
141 if ((numHdr > 0) && (numHdr <= ngcbMAX_MOD))
142 {
143 return (hdr[numHdr - 1]);
144 }
145 else
146 {
147 return (0x0);
148 }
149 }
150
152 void Print(char *s) const {
153 int i;
154 char tmp[16];
155
156 s[0] = '\0';
157 for (i=0;i<numHdr;i++)
158 {
159 if (i > 0) sprintf(tmp, ",%d", hdr[i]);
160 else sprintf(tmp, "%d", hdr[i]);
161 strcat(s, tmp);
162 }
163 }
164};
165
167public:
169 int addr;
170
172 ngcb_reg_t() {addr = 0x0; value_ = 0x0; setup_ = 0;}
173
175 //explicit ngcb_reg_t(int a) {addr = a; value_ = 0x0; setup_ = 0;}
176
178 int Value() {return (value_);}
179
181 void Setup(int v) {value_ = v; setup_ = 1;}
182
184 int Setup() {return (setup_);}
185
187 void Reset() {setup_ = 0;}
188protected:
189private:
191 int setup_;
192
194 int value_;
195};
196
201public:
204
207
210
213
216
219
222
225
228
231
234
237
240
243
246
248 bool operator==(const ngcb_rtms_cfg_t &other) const {
249 size_t i;
250 for (i=0;i<14;i++)
251 {
252 if (!(reg[i] == other.reg[i]))
253 {
254 return (false);
255 }
256 }
257 return (true);
258 }
259
262 if (this != &other)
263 {
264 size_t i;
265 Init_();
266 for (i=0;i<14;i++)
267 {
268 if (other.reg[i]->Setup())
269 {
270 reg[i]->Setup(other.reg[i]->Value());
271 }
272 }
273 }
274 return (*this);
275 }
276
279 size_t i;
280 Init_();
281 for (i=0;i<14;i++)
282 {
283 if (other.reg[i]->Setup())
284 {
285 reg[i]->Setup(other.reg[i]->Value());
286 }
287 }
288 }
289
292 Init_();
293 }
294
296 void Reset() {
297 size_t i;
298 for (i=0;i<14;i++) reg[i]->Reset();
299 }
300
301protected:
302private:
304 void Init_() {
305 topic.addr = 0x3200;
306 component.addr = 0x3201;
307 application.addr = 0x3202;
308 leadingPadding.addr = 0x3204;
309 trailingPadding.addr = 0x3205;
310 littleEndian.addr = 0x3206;
311 local_ip.addr = 0x3212;
312 subnet.addr = 0x3213;
313 gateway.addr = 0x3214;
314 dest_ip.addr = 0x3215;
315 srcPort.addr = 0x3216;
316 destPort.addr = 0x3217;
317 ttl.addr = 0x3218;
318 ds.addr = 0x3219;
319 reg[0] = &topic;
320 reg[1] = &component;
321 reg[2] = &application;
322 reg[3] = &leadingPadding;
323 reg[4] = &trailingPadding;
324 reg[5] = &littleEndian;
325 reg[6] = &local_ip;
326 reg[7] = &subnet;
327 reg[8] = &gateway;
328 reg[9] = &dest_ip;
329 reg[10] = &srcPort;
330 reg[11] = &destPort;
331 reg[12] = &ttl;
332 reg[13] = &ds;
333 }
334};
335
341 int ip;
342
344 int port;
345
347 ngcb_chan_ip_t() {ip = 0; port = 0;}
348};
349
366
383
390
392 int bits;
393
395 int shift;
396
398 int src[4];
399
402
405
408
411 size_t i;
412 enable = 0; bits = 16; shift = 0;
413 for (i=0;i<_vecsize(src);i++) src[i] = 0;
414 }
415};
416
422 int ip;
423
426
429
431 int port;
432
434 int ttl;
435
437 int ds;
438
440 ngcb_rtms_net() {ip = 0; subnet = 0; gateway = 0; port = 0, ttl = 0; ds = 0;}
441};
442
456
462 uint64_t sec;
463
465 uint64_t nsec;
466
468 uint64_t start_sec;
469
471 uint64_t start_nsec;
472
474 uint64_t period_sec;
475
477 uint64_t period_nsec;
478
480 int nshot;
481
484
487 sec = 0; nsec = 0;
488 start_sec = 0; start_nsec = 0;
489 period_sec = 0; period_nsec = 0;
490 nshot = -1; status = 0;
491 }
492};
493
499 int fwd;
500
502 int size;
503
505 int dvld;
506
508 ngcb_sctl_t() {fwd = 1; size = 0; dvld = 0;}
509};
510
516 int board;
517
519 int addr;
520
522 int mask;
523
526
528 int cond;
529
532 if (this != &other)
533 {
534 board = other.board; addr = other.addr; mask = other.mask;
535 reference = other.reference; cond = other.cond;
536 }
537 return (*this);
538 }
539
541 ngcb_evt_t(const ngcb_evt_t &other):
542 board(other.board), addr(other.addr), mask(other.mask),
543 reference(other.reference), cond(other.cond) {
544 }
545
548 board = 1; addr = 0x6000;
551 cond = 1;
552 }
553
555 int Check(int value) {
556 int x = value & mask;
557 int c = cond & 0xffff;
558 if (c) return (x == (reference & mask)); // equal
559 else return (~(x ^ (reference | ~mask)) != 0); // non differing bits != 0
560 }
561
563 int Failure() {return ((cond & ngcbEVT_COND_FAIL) != 0x0);}
564
568 return (r);
569 }
570};
571
577 int id;
578
581
584
586 ngcb_evt_st_t(int i, int s): id(i), status(s) {}
587
589 explicit ngcb_evt_st_t(int i): id(i), status(ngcbEVT_SUCCESS) {}
590};
591
595class ngcbEVT {
596public:
598 int id;
599
601 int async;
602
604 int cond;
605
608
610 int done;
611
614
616 ngcbEVT(const ngcbEVT &other) {
617 n_ = 0; id = other.id; async = other.async; cond = other.cond;
618 timeout = other.timeout; done = 0;
619 if (other.size_ > 0)
620 {
621 size_t i;
622 component = new ngcb_evt_t[other.size_];
623 size_ = other.size_;
624 for (i=0;i<other.n_;i++) Add(other.component[i]);
625 }
626 else
627 {
628 component = NULL;
629 size_ = 0;
630 }
631 ngcbGetTime(&timeStamp_);
632 }
633
635 explicit ngcbEVT(size_t size) {
636 n_ = 0; id = 0; async = 0; cond = 1; timeout = -1; done = 0;
637 if (size > 0)
638 {
639 component = new ngcb_evt_t[size];
640 size_ = size;
641 }
642 else
643 {
644 component = NULL;
645 size_ = 0;
646 }
647 ngcbGetTime(&timeStamp_);
648 }
649
651 virtual ~ngcbEVT() {
652 if (component != NULL)
653 {
654 delete[] component;
655 }
656 }
657
659 ngcbEVT &operator=(const ngcbEVT &other) {
660 if (this != &other)
661 {
662 n_ = 0; id = other.id; async = other.async; cond = other.cond;
663 timeout = other.timeout; done = 0;
664 if (other.size_ > 0)
665 {
666 size_t i;
667 component = new ngcb_evt_t[other.size_];
668 size_ = other.size_;
669 for (i=0;i<other.n_;i++) Add(other.component[i]);
670 }
671 else
672 {
673 component = NULL;
674 size_ = 0;
675 }
676 ngcbGetTime(&timeStamp_);
677 }
678 return (*this);
679 }
680
682 size_t Size() {return (n_);}
683
685 void Add(const ngcb_evt_t &evt) {if (n_ < size_) component[n_++] = evt;}
686
688 void Add(int board, int addr, int mask, int reference, int cnd = 1) {
689 if ((n_ < size_) && (board > 0) && (board <= ngcbMAX_MOD))
690 {
691 ngcb_evt_t *c = &component[n_++];
692 c->board = board; c->addr = addr;
693 c->mask = mask; c->reference = reference; c->cond = cnd;
694 }
695 }
696
698 void Add(const ngcb_route_t &r, int addr, int mask, int reference,
699 int cnd = 1) {
700 Add(r.Board(), addr, mask, reference, cnd);
701 }
702
704 void TimeStamp() {ngcbGetTime(&timeStamp_);}
705
707 int Timeout() {
708 if (timeout > 0)
709 {
710 struct timeval t;
711 double difft;
712 ngcbGetTime(&t);
713 difft = ngcbDiffTime(timeStamp_, t);
714 if (difft < (double)timeout)
715 {
716 return (0);
717 }
718 else
719 {
720 return (1);
721 }
722 }
723 else if (timeout < 0)
724 {
725 return (0);
726 }
727 else
728 {
729 return (1);
730 }
731 }
732
733protected:
734
735private:
737 size_t size_;
738
740 size_t n_;
741
743 struct timeval timeStamp_;
744};
745
749#define ngcbIFC_HDR_SIZE (3 + ngcbMAX_MOD + 1)
750
754class ngcbIFC {
755public:
757 ngcbIFC();
758
760 explicit ngcbIFC(const char *name);
761
763 virtual ~ngcbIFC();
764
766 FILE *watchdog;
767
770
773
775 int local;
776
778 char thisHost[64];
779
782
785
788
791
794
796 int skip;
797
799 int chain;
800
803
806
809
811 int id;
812
814 int type;
815
818
821
824
827
830
833
836
839
842
844 int sim;
845
847 int xterm;
848
851
854
857
858 /*
859 * Error handling and logging
860 */
861
863 char *ErrMsg();
864
866 void ErrState(const char *msg, int errorId = 0, void *origin = NULL);
867
869 void Result2Err(char *s, int resultCode);
870
872 void Verbose(const char *format, ...)
873 __attribute__ ((format(printf, 2, 3)));
874
876 void Log(const char *format, ...)
877 __attribute__ ((format(printf, 2, 3)));
878
879
880 /*
881 * Interface definition
882 */
883
885 const char *SofwVersion();
886
888 char *Name();
889
891 char *Type();
892
894 char *Arg();
895
897 int Instance();
898
900 void Instance(int instance);
901
903 int Open();
904
906 void DefaultTimeout(int seconds);
907
909 int SetTime(double time = 0.0);
910
912 int BigEndian();
913
915 int SyncFwd(int flag);
916
918 int SyncWithData(int flag);
919
921 int SyncSize(int size);
922
923 /*
924 * High-level state handling
925 */
926
928 int Configure(const char *s);
929
931 int Configure();
932
934 const char *Setup();
935
937 int Standby();
938
940 int Online();
941
943 int Off();
944
945
946 /*
947 * Generic i/o functions
948 */
949
951 int ReadAddr(const ngcb_route_t &route, int addr, int *buffer, int size);
952
954 int WriteAddr(const ngcb_route_t &route, int addr, const int *buffer,
955 int size);
956
958 int WriteBuffer(const int *buffer, int size, int *result);
959
961 int Event(ngcbEVT *evt);
962
964 int ReadAddr(int addr, int *buffer, int size = 1);
965
967 int WriteAddr(int addr, const int *buffer, int size);
968
970 int WriteAddr(int addr, int value);
971
973 int ReadAddr64(const ngcb_route_t &route, int addr, uint64_t *buffer,
974 int size);
975
977 int WriteAddr64(const ngcb_route_t &route, int addr, const uint64_t *buffer,
978 int size);
979
981 int ReadAddr64(int addr, uint64_t *buffer, int size = 1);
982
984 int WriteAddr64(int addr, const uint64_t *buffer, int size);
985
987 int WriteAddr64(int addr, uint64_t value);
988
989
990 /*
991 * Device events interface
992 */
993
996
998 int CheckEvent(ngcbEVT *evt, int *result);
999
1001 int Wait(ngcbEVT *evt, int interval, int *result);
1002
1004 void Poll();
1005
1007 int SetChanIp(int idx, ngcb_chan_ip_t ip);
1008
1010 int SetChanMudpi(int idx, ngcb_chan_mudpi_t mudpi);
1011
1013 int SetChanRtms(int idx, ngcb_chan_rtms_t rtms);
1014
1016 int SetRtmsNet(ngcb_rtms_net net);
1017
1019 int GetChanIp(int idx, ngcb_chan_ip_t *ip);
1020
1022 int GetChanMudpi(int idx, ngcb_chan_mudpi_t *mudpi);
1023
1025 int GetChanRtms(int idx, ngcb_chan_rtms_t *rtms);
1026
1028 int GetRtmsNet(ngcb_rtms_net *net);
1029
1031 int SetChanEnable(int idx, int flag);
1032
1034 int GetChanEnable(int idx, int *flag);
1035
1037 int SetChanSrc(int idx, int src = 0, int flag = -1);
1038
1040 int GetChanSrc(int idx, int src, int *flag);
1041
1043 int GetChanDrop(int idx, int src, int *flag);
1044
1046 int ClearChanDrop(int idx);
1047
1049 int SetChanBits(int idx, int bits);
1050
1052 int GetChanBits(int idx, int *bits);
1053
1055 int SetChanShift(int idx, int shift);
1056
1058 int GetChanShift(int idx, int *shift);
1059
1060 /*
1061 * Virtual Interface
1062 */
1063
1065 virtual int Fd();
1066
1068 virtual int Pid();
1069
1071 virtual int Port();
1072
1074 virtual const char *Host();
1075
1077 virtual int Sim(int level);
1078
1080 virtual int Open(const char *name);
1081
1083 virtual int Close();
1084
1086 virtual int Connect();
1087
1089 virtual int Disconnect();
1090
1092 virtual int Ping();
1093
1095 virtual void Keeper(int seconds);
1096
1098 virtual int Reset();
1099
1101 virtual int Timeout(int seconds);
1102
1104 virtual int Timeout();
1105
1107 virtual int SetTime(uint64_t sec, uint64_t nsec);
1108
1110 virtual void RpcCopy(void *dest, const void *src, size_t size, size_t items);
1111
1113 virtual int Str2Payload(const char *cmd, unsigned char *payload,
1114 unsigned int max, char *erms);
1115
1117 virtual int RPC(int mod, int target, int req, void *payload,
1118 unsigned int size, unsigned int *status);
1119
1121 virtual int Read(int *buffer, int size);
1122
1124 virtual int Write(const int *buffer, int size);
1125
1127 virtual int ReadAddr(ngcb_route_t route, int addr, int *buffer, int size,
1128 int *result);
1129
1131 virtual int WriteAddr(ngcb_route_t route, int addr, const int *buffer,
1132 int size, int *result);
1133
1135 virtual int Event(ngcbEVT *evt, int *result);
1136
1138 virtual int Status(int *devStatus);
1139
1141 virtual int ExecServer();
1142
1144 virtual int KillServer();
1145
1147 virtual int Running();
1148
1150 virtual int Connected();
1151
1153 virtual int HandleFdEvt();
1154
1155 /***
1156 * Start TSU trigger at given absolute time
1157 * (seconds + fractional nanoseconds)
1158 */
1159 virtual int TsuStartAt(uint64_t sec, uint64_t nsec);
1160
1162 virtual int TsuStart();
1163
1165 virtual int TsuStop();
1166
1168 virtual int TsuTrigger();
1169
1171 virtual int TsuSnapshot();
1172
1174 virtual int TsuStatus(int *value);
1175
1177 virtual int TsuConfig(ngcb_tsu_t *cfg);
1178
1179 /***
1180 * The function checks the TSU running status. If the status cannot be
1181 * read -1 is returned and ErrMsg() contains the detailed error message.
1182 * Otherwise 1 is returned if the TSU is running or zero is returned if
1183 * the TSU is not running.
1184 */
1185 virtual int TsuRunning();
1186
1187 /*
1188 * Bottom end i/o
1189 */
1190
1192 virtual int _ReadAddr(ngcb_route_t route, int addr, int *buffer, int size,
1193 int *result);
1194
1196 virtual int _WriteAddr(ngcb_route_t route, int addr, const int *buffer,
1197 int size, int *result);
1198
1199protected:
1201 virtual int SetupCB(const char *buffer);
1202
1203private:
1205 void Init_();
1206
1208 char thisVersion_[128];
1209
1211 int handle_;
1212
1214 int timeout_;
1215
1217 int fifoSize_;
1218
1220 char setupString_[64];
1221
1223 int setupCode_;
1224
1226 char type_[64];
1227
1229 char name_[256];
1230
1232 char arg_[256];
1233
1235 int endian_;
1236
1238 int instance_;
1239
1241 ngcbSIM *simulator_;
1242
1244 int testBuffer_[1024];
1245
1247 void ClrEvt_();
1248
1249 /*
1250 * Error handling
1251 */
1252
1254 int CheckErr_(int);
1255
1257 char erms_[256];
1258
1259
1260 /*
1261 * Interface base class access
1262 */
1263
1265 int IfcRead_(int addr);
1266
1268 void IfcWrite_(int addr, int value);
1269
1270
1271 /*
1272 * IOCTL interface
1273 */
1274
1276 virtual int ReadLocal_(int addr, int *value);
1277
1279 virtual int WriteLocal_(int addr, int value);
1280
1282 virtual int ReadCfg_(int addr, int *value);
1283
1285 virtual int WriteCfg_(int addr, int value);
1286
1287
1288 /*
1289 * SIDECAR ASIC interface
1290 */
1291
1293 int ScaRead_(const ngcb_route_t &route, int addr, int sid, int flags,
1294 int *buffer, int size, int *result);
1295
1297 int ScaWrite_(const ngcb_route_t &route, int addr, int sid, int flags,
1298 const int *buffer, int size, int *result);
1299
1301 int ScaReadBlock_(const ngcb_route_t &route, int addr, int sid, int flags,
1302 int *buffer, int size, int *result);
1303
1305 int ScaWriteBlock_(const ngcb_route_t &route, int addr, int sid, int flags,
1306 const int *buffer, int size, int *result);
1307
1309 int ScaCRC16_(const int *buffer, int size);
1310};
1311
1315class ngcbI2C_IO: public ngcbI2C
1316{
1317public:
1321 int i;
1322
1323 /*
1324 * Copy device and routing information
1325 */
1326 dev_ = dev;
1327 route_.numHdr = r.numHdr;
1328 for (i=0;i<r.numHdr;i++) route_.hdr[i] = r.hdr[i];
1329
1330 tmo = 0; // no sleep
1331 ACK_IN(2); // acknowledge on bit 2 (TBD)
1332 SDA_DIR_SWITCH(3); // SDA direction switch on bit 3 (TBD)
1333 }
1334
1336 virtual ~ngcbI2C_IO() {
1337 }
1338
1340 int tmo; // in microseconds
1341
1343 int OutCB(int d, int *resultCode, char *erms) {
1344
1345 *resultCode = ngcbRES_SUCCESS;
1346
1347 if (dev_ != NULL)
1348 {
1349 if (dev_->verboseLevel > 1)
1350 {
1351 char s[33];
1352 ngcbInt2Bin(s, d);
1353 dev_->Verbose("ngcbI2C: <%s>\n", s);
1354 }
1355
1356 /*
1357 * Write one word to I2C-port
1358 */
1359 if (dev_->_WriteAddr(route_, ngcbI2C_PORT, &d, 1,
1360 resultCode) != ngcbSUCCESS)
1361 {
1362 strcpy(erms, dev_->ErrMsg());
1363 return (-1);
1364 }
1365 }
1366
1367 /*
1368 * Delay (if tmo > 0)
1369 */
1370 ngcbMicroSleep(-1, tmo);
1371
1372 return (0);
1373 }
1374
1376 int InCB(int *d, int *resultCode, char *erms) {
1377
1378 *resultCode = ngcbRES_SUCCESS;
1379
1380 if (dev_ != NULL)
1381 {
1382 /*
1383 * Read one word from I2C-port
1384 */
1385 if (dev_->_ReadAddr(route_, ngcbI2C_PORT, d, 1,
1386 resultCode) != ngcbSUCCESS)
1387 {
1388 strcpy(erms, dev_->ErrMsg());
1389 return (-1);
1390 }
1391 }
1392
1393 /*
1394 * Delay (if tmo > 0)
1395 */
1396 ngcbMicroSleep(-1, tmo);
1397
1398 return (0);
1399 }
1400
1401protected:
1402
1403private:
1405 ngcbIFC *dev_;
1406
1408 ngcb_route_t route_;
1409};
1410
1414class ngcbAFE_IO: public ngcbAFE
1415{
1416public:
1418 int tmo; // in microseconds
1419
1422 int i;
1423
1424 /*
1425 * Copy device and routing information
1426 */
1427 dev_ = dev;
1428 route_.numHdr = r.numHdr;
1429 for (i=0;i<r.numHdr;i++) route_.hdr[i] = r.hdr[i];
1430
1431 tmo = 0;
1432 }
1433
1435 virtual ~ngcbAFE_IO() {
1436 }
1437
1439 int OutCB(int side, int d, int *resultCode, char *erms) {
1440 int addr;
1441
1442 *resultCode = ngcbRES_SUCCESS;
1443
1444 /*
1445 * Select address associated to side
1446 */
1447 if (side == 0) addr = ngcbAO_ADDR_AFE_L;
1448 else addr = ngcbAO_ADDR_AFE_R;
1449
1450 if (dev_ != NULL)
1451 {
1452 if (dev_->verboseLevel > 1)
1453 {
1454 char s[33];
1455 ngcbInt2Bin(s, d);
1456 dev_->Verbose("ngcbAFE: <%s> <0x%04x>\n", s, d & 0xffff);
1457 }
1458
1459 /*
1460 * Write one word to AFE-port
1461 */
1462 if (dev_->_WriteAddr(route_, addr, &d, 1,
1463 resultCode) != ngcbSUCCESS)
1464 {
1465 strcpy(erms, dev_->ErrMsg());
1466 return (-1);
1467 }
1468 }
1469
1470 /*
1471 * Delay (if tmo > 0)
1472 */
1473 ngcbMicroSleep(-1, tmo);
1474
1475 return (0);
1476 }
1477
1478protected:
1479
1480private:
1482 ngcbIFC *dev_;
1483
1485 ngcb_route_t route_;
1486};
1487
1492 void *origin; //< Application specific originator
1493 ngcbIFC *device; //< Interface device reporting the error state
1494
1497 if (this != &other)
1498 {
1499 origin = other.origin; device = other.device;
1500 }
1501 return (*this);
1502 }
1503
1506 /*
1507 * Forward pointers
1508 */
1509 origin = other.origin; device = other.device;
1510 }
1511
1513 ngcb_ifc_err() {origin = NULL; device = NULL;}
1514
1516 ngcb_ifc_err(void *o, ngcbIFC *d): origin(o), device(d) {}
1517};
1518
1519#endif
1520
int tmo
Timeout for microsleep.
Definition ngcbIFC.hpp:1418
ngcbAFE_IO(ngcbIFC *dev, ngcb_route_t r)
Constructor.
Definition ngcbIFC.hpp:1421
int OutCB(int side, int d, int *resultCode, char *erms)
Write one word (call-back)
Definition ngcbIFC.hpp:1439
virtual ~ngcbAFE_IO()
Destructor.
Definition ngcbIFC.hpp:1435
ngcbAFE()
Constructor.
Definition ngcbAFE.hpp:25
Definition ngcbIFC.hpp:595
int id
Event id.
Definition ngcbIFC.hpp:598
int async
Asynchronous event notification.
Definition ngcbIFC.hpp:601
ngcb_evt_t * component
Device event components.
Definition ngcbIFC.hpp:613
void Add(const ngcb_evt_t &evt)
Add event component.
Definition ngcbIFC.hpp:685
ngcbEVT(size_t size)
Constructor.
Definition ngcbIFC.hpp:635
ngcbEVT & operator=(const ngcbEVT &other)
Operator =.
Definition ngcbIFC.hpp:659
void TimeStamp()
Event timestamp.
Definition ngcbIFC.hpp:704
int done
Done.
Definition ngcbIFC.hpp:610
virtual ~ngcbEVT()
Destructor.
Definition ngcbIFC.hpp:651
size_t Size()
Return number of list components.
Definition ngcbIFC.hpp:682
int timeout
Timeout (seconds)
Definition ngcbIFC.hpp:607
ngcbEVT(const ngcbEVT &other)
Copy constructor.
Definition ngcbIFC.hpp:616
void Add(const ngcb_route_t &r, int addr, int mask, int reference, int cnd=1)
Add explicit event (on board indexed by route)
Definition ngcbIFC.hpp:698
int Timeout()
Check for timeout.
Definition ngcbIFC.hpp:707
int cond
Event condition: 0 = any, 1 = all (default)
Definition ngcbIFC.hpp:604
void Add(int board, int addr, int mask, int reference, int cnd=1)
Add explicit event (on board)
Definition ngcbIFC.hpp:688
int OutCB(int d, int *resultCode, char *erms)
Write one word (call-back)
Definition ngcbIFC.hpp:1343
virtual ~ngcbI2C_IO()
Destructor.
Definition ngcbIFC.hpp:1336
int InCB(int *d, int *resultCode, char *erms)
Read one word (call-back)
Definition ngcbIFC.hpp:1376
int tmo
Timeout for microsleep.
Definition ngcbIFC.hpp:1340
ngcbI2C_IO(ngcbIFC *dev, ngcb_route_t r, int cnt)
Constructor.
Definition ngcbIFC.hpp:1319
ngcbI2C()
Definition ngcbI2C.hpp:43
void ACK_IN(int bit)
Define ack-line bit.
Definition ngcbI2C.hpp:99
void SDA_DIR_SWITCH(int bit)
Define SDA direction switch bit.
Definition ngcbI2C.hpp:102
Definition ngcbIFC.hpp:754
int SetChanSrc(int idx, int src=0, int flag=-1)
Enable/disable channel source.
Definition ngcbIFC.cpp:3649
virtual int Port()
Driver interface process command port.
Definition ngcbIFC.cpp:262
int protocol
Incremental protovol id.
Definition ngcbIFC.hpp:826
virtual int TsuStop()
Stop TSU trigger.
Definition ngcbIFC.cpp:2093
int backPlane
Back-plane id.
Definition ngcbIFC.hpp:790
int GetChanMudpi(int idx, ngcb_chan_mudpi_t *mudpi)
Get RTMS channel MUDPI configuration.
Definition ngcbIFC.cpp:3505
void ErrState(const char *msg, int errorId=0, void *origin=NULL)
Go to error state with error message.
Definition ngcbIFC.cpp:2163
char * Type()
Interface type.
Definition ngcbIFC.cpp:230
virtual int TsuRunning()
Definition ngcbIFC.cpp:2097
virtual int Reset()
Reset device.
Definition ngcbIFC.cpp:536
virtual ~ngcbIFC()
Destructor.
Definition ngcbIFC.cpp:44
int serNo2
Interface board serial number part two.
Definition ngcbIFC.hpp:808
void Result2Err(char *s, int resultCode)
Convert result code to error string.
Definition ngcbIFC.cpp:2181
char * Name()
Device name.
Definition ngcbIFC.cpp:228
virtual int Read(int *buffer, int size)
Read buffer from device.
Definition ngcbIFC.cpp:682
FILE * watchdog
External watchdog stream.
Definition ngcbIFC.hpp:766
void Verbose(const char *format,...) __attribute__((format(printf
Verbose message.
Definition ngcbIFC.cpp:2100
int xterm
Start in new terminal.
Definition ngcbIFC.hpp:847
int tsuCtrl
Enable/disable automatic start/stop of the TSU.
Definition ngcbIFC.hpp:841
int SetChanBits(int idx, int bits)
Set number of enabled bits on channel.
Definition ngcbIFC.cpp:3777
int translate
RPC payload translation method.
Definition ngcbIFC.hpp:856
int SyncFwd(int flag)
Forward SYNC signal.
Definition ngcbIFC.cpp:2292
int skip
Number of route nodes to skip.
Definition ngcbIFC.hpp:796
int version
Board version (sub-type)
Definition ngcbIFC.hpp:817
virtual int Pid()
Driver interface process id.
Definition ngcbIFC.cpp:253
virtual int Close()
Close interface.
Definition ngcbIFC.cpp:461
virtual int _WriteAddr(ngcb_route_t route, int addr, const int *buffer, int size, int *result)
Write to adress.
Definition ngcbIFC.cpp:1399
int Event(ngcbEVT *evt)
Activate device event.
Definition ngcbIFC.cpp:1958
ngcbSERVICE * services
System services.
Definition ngcbIFC.hpp:769
int SetRtmsNet(ngcb_rtms_net net)
Set RTMS common parameters.
Definition ngcbIFC.cpp:3448
int GetChanRtms(int idx, ngcb_chan_rtms_t *rtms)
Get RTMS channel RTMS configuration.
Definition ngcbIFC.cpp:3539
int GetChanDrop(int idx, int src, int *flag)
Get channel source drop flag.
Definition ngcbIFC.cpp:3722
int sideLink
Connected through sidelink.
Definition ngcbIFC.hpp:787
int Instance()
Get interface instance.
Definition ngcbIFC.cpp:234
virtual int Connect()
Connect through to device.
Definition ngcbIFC.cpp:504
virtual int TsuSnapshot()
Take TSU snapshot.
Definition ngcbIFC.cpp:2098
void DefaultTimeout(int seconds)
Set default timeout.
Definition ngcbIFC.cpp:618
virtual int _ReadAddr(ngcb_route_t route, int addr, int *buffer, int size, int *result)
Read from address.
Definition ngcbIFC.cpp:1248
void void const char * SofwVersion()
Software version.
Definition ngcbIFC.cpp:226
int id
ID-register content.
Definition ngcbIFC.hpp:811
char * Arg()
Driver interface process arguments.
Definition ngcbIFC.cpp:232
char thisHost[64]
Host where this instance is launched.
Definition ngcbIFC.hpp:778
int GetChanSrc(int idx, int src, int *flag)
Get enabled-flag per source and channel.
Definition ngcbIFC.cpp:3690
virtual int Write(const int *buffer, int size)
Write buffer to device.
Definition ngcbIFC.cpp:730
int WriteAddr64(const ngcb_route_t &route, int addr, const uint64_t *buffer, int size)
64-bit write
Definition ngcbIFC.cpp:1604
int ReadAddr64(const ngcb_route_t &route, int addr, uint64_t *buffer, int size)
64-bit read
Definition ngcbIFC.cpp:1598
int SetChanMudpi(int idx, ngcb_chan_mudpi_t mudpi)
Set RTMS channel MUDPI configuration.
Definition ngcbIFC.cpp:3393
virtual int RPC(int mod, int target, int req, void *payload, unsigned int size, unsigned int *status)
RPC.
Definition ngcbIFC.cpp:674
int Online()
Bring interface to ONLINE state.
Definition ngcbIFC.cpp:2489
char * ErrMsg()
Pointer to last error message.
Definition ngcbIFC.cpp:2155
int verboseLevel
Verbose level.
Definition ngcbIFC.hpp:850
virtual int SetupCB(const char *buffer)
Setup call-back.
Definition ngcbIFC.cpp:657
int SyncSize(int size)
Set SYNC packet size.
Definition ngcbIFC.cpp:2312
void void Log(const char *format,...) __attribute__((format(printf
Log message.
Definition ngcbIFC.cpp:2136
virtual int Ping()
Ping device.
Definition ngcbIFC.cpp:532
virtual const char * Host()
Driver interface process host.
Definition ngcbIFC.cpp:271
int firmware
Firmware revision.
Definition ngcbIFC.hpp:823
int SyncWithData(int flag)
SYNC with data-valid.
Definition ngcbIFC.cpp:2272
void Poll()
Poll event list.
Definition ngcbIFC.cpp:1970
int ioError
Indicates an i/o error.
Definition ngcbIFC.hpp:772
int ClearChanDrop(int idx)
Clear channel drop flags.
Definition ngcbIFC.cpp:3754
int GetRtmsNet(ngcb_rtms_net *net)
Get RTMS common parameters.
Definition ngcbIFC.cpp:3568
virtual int Str2Payload(const char *cmd, unsigned char *payload, unsigned int max, char *erms)
Parse string to RPC payload.
Definition ngcbIFC.cpp:668
int SetChanShift(int idx, int shift)
Set channel bit shift.
Definition ngcbIFC.cpp:3831
ngcb_sctl_t sync
SYNC signal control.
Definition ngcbIFC.hpp:829
int master
Index of master device.
Definition ngcbIFC.hpp:793
int GetChanBits(int idx, int *bits)
Get number of enabled bits on channel.
Definition ngcbIFC.cpp:3802
int GetChanShift(int idx, int *shift)
Get channel bit shift.
Definition ngcbIFC.cpp:3856
int local
Interface is local.
Definition ngcbIFC.hpp:775
virtual int Disconnect()
Disconnect from device.
Definition ngcbIFC.cpp:517
int Configure(const char *s)
Configure interface device via interface setup identification string.
Definition ngcbIFC.cpp:2333
int type
Board type.
Definition ngcbIFC.hpp:814
virtual void Keeper(int seconds)
Set line keeper interval (seconds)
Definition ngcbIFC.cpp:534
int Open()
Open interface with current name.
Definition ngcbIFC.cpp:316
virtual int TsuStartAt(uint64_t sec, uint64_t nsec)
Definition ngcbIFC.cpp:2087
virtual int KillServer()
Terminate driver interface process.
Definition ngcbIFC.cpp:2035
virtual int Connected()
Connected to device.
Definition ngcbIFC.cpp:2052
int serNo1
Interface board serial number part one.
Definition ngcbIFC.hpp:805
int revision
Hardware revision.
Definition ngcbIFC.hpp:820
int SetTime(double time=0.0)
Set device time (seconds since UNIX epoch, time <= 0.0 sets system time).
Definition ngcbIFC.cpp:626
int ReadAddr(const ngcb_route_t &route, int addr, int *buffer, int size)
Read from address.
Definition ngcbIFC.cpp:1541
int WriteBuffer(const int *buffer, int size, int *result)
Write formatted buffer to device.
Definition ngcbIFC.cpp:1641
int WriteAddr(const ngcb_route_t &route, int addr, const int *buffer, int size)
Write to address.
Definition ngcbIFC.cpp:1554
int keeper
Line keeper interval (seconds)
Definition ngcbIFC.hpp:784
int CheckEvent(ngcbEVT *evt, int *result)
Check if device event conditions are met.
Definition ngcbIFC.cpp:1728
virtual int Status(int *devStatus)
Get communication status.
Definition ngcbIFC.cpp:2006
ngcbLIST evtList
Device event list.
Definition ngcbIFC.hpp:995
int Off()
Bring interface to OFF state.
Definition ngcbIFC.cpp:2641
int logLevel
Logging level.
Definition ngcbIFC.hpp:853
int BigEndian()
Get endianess.
Definition ngcbIFC.cpp:238
virtual int Running()
Driver interface process is running.
Definition ngcbIFC.cpp:2044
int GetChanIp(int idx, ngcb_chan_ip_t *ip)
Get RTMS channel IP configuration.
Definition ngcbIFC.cpp:3473
virtual int TsuConfig(ngcb_tsu_t *cfg)
Get TSU configuration.
Definition ngcbIFC.cpp:2096
int Standby()
Bring interface to STANDBY state.
Definition ngcbIFC.cpp:2455
virtual int HandleFdEvt()
Handle event on file descriptor.
Definition ngcbIFC.cpp:2061
ngcb_route_t cfgRoute
Configuration route.
Definition ngcbIFC.hpp:802
virtual int Sim(int level)
Set simulation level.
Definition ngcbIFC.cpp:280
int SetChanIp(int idx, ngcb_chan_ip_t ip)
Set RTMS channel IP configuration.
Definition ngcbIFC.cpp:3366
ngcb_rtms_cfg_t rtms
RTMS configuration (WFS)
Definition ngcbIFC.hpp:832
int SetChanRtms(int idx, ngcb_chan_rtms_t rtms)
Set RTMS channel RTMS configuration.
Definition ngcbIFC.cpp:3422
int SetChanEnable(int idx, int flag)
Enable/disable RTMS channel.
Definition ngcbIFC.cpp:3598
int netTimeout
Network timeout (seconds)
Definition ngcbIFC.hpp:781
virtual int ExecServer()
Launch driver interface process.
Definition ngcbIFC.cpp:2026
virtual void RpcCopy(void *dest, const void *src, size_t size, size_t items)
Copy RPC payload.
Definition ngcbIFC.cpp:663
int chain
Chain length from last skipped node to DFE.
Definition ngcbIFC.hpp:799
ngcb_rtms_if rtmsIf
RTMS interface (NGCII)
Definition ngcbIFC.hpp:835
int GetChanEnable(int idx, int *flag)
Get RTMS channel status (enabled/disabled)
Definition ngcbIFC.cpp:3622
const char * Setup()
Return actual interface setup identification string.
Definition ngcbIFC.cpp:2416
int sim
Interface simulation level.
Definition ngcbIFC.hpp:844
ngcbIFC()
Constructor without device name.
Definition ngcbIFC.cpp:33
virtual int TsuStatus(int *value)
Get TSU status.
Definition ngcbIFC.cpp:2095
ngcb_tsu_t tsu
TSU configuration.
Definition ngcbIFC.hpp:838
virtual int Timeout(int seconds)
Set timeout.
Definition ngcbIFC.cpp:594
virtual int Fd()
Return device file descriptor.
Definition ngcbIFC.cpp:244
virtual int TsuTrigger()
Manual TSU trigger.
Definition ngcbIFC.cpp:2094
int Wait(ngcbEVT *evt, int interval, int *result)
Wait for event.
Definition ngcbIFC.cpp:1865
virtual int TsuStart()
Start TSU trigger immediatly.
Definition ngcbIFC.cpp:2092
Definition ngcbLIST.hpp:33
Definition ngcbSERVICE.hpp:35
Definition ngcbSIM.hpp:151
Definition ngcbIFC.hpp:166
void Setup(int v)
Set value.
Definition ngcbIFC.hpp:181
int addr
Address.
Definition ngcbIFC.hpp:169
int Value()
Constructor.
Definition ngcbIFC.hpp:178
int Setup()
Check, if value has been set.
Definition ngcbIFC.hpp:184
void Reset()
Reset.
Definition ngcbIFC.hpp:187
ngcb_reg_t()
Constructor.
Definition ngcbIFC.hpp:172
Definition ngcbIFC.hpp:200
ngcb_rtms_cfg_t & operator=(const ngcb_rtms_cfg_t &other)
Operator =.
Definition ngcbIFC.hpp:261
ngcb_reg_t dest_ip
RTC-IF destination ip.
Definition ngcbIFC.hpp:230
ngcb_reg_t ds
RTC-IF DS.
Definition ngcbIFC.hpp:242
ngcb_reg_t leadingPadding
RTMS leading padding.
Definition ngcbIFC.hpp:212
bool operator==(const ngcb_rtms_cfg_t &other) const
Operator ==.
Definition ngcbIFC.hpp:248
ngcb_reg_t littleEndian
RTMS little endian.
Definition ngcbIFC.hpp:218
ngcb_rtms_cfg_t()
Constructor.
Definition ngcbIFC.hpp:291
ngcb_reg_t ttl
RTC-IF TTL.
Definition ngcbIFC.hpp:239
ngcb_reg_t * reg[14]
Register array.
Definition ngcbIFC.hpp:245
ngcb_reg_t gateway
RTC-IF gatewway.
Definition ngcbIFC.hpp:227
ngcb_reg_t trailingPadding
RTMS trailing padding.
Definition ngcbIFC.hpp:215
ngcb_reg_t subnet
RTC-IF subnet mask.
Definition ngcbIFC.hpp:224
ngcb_reg_t srcPort
RTC-IF source port.
Definition ngcbIFC.hpp:233
ngcb_reg_t topic
MUDPI topic.
Definition ngcbIFC.hpp:203
ngcb_reg_t component
MUDPI component.
Definition ngcbIFC.hpp:206
ngcb_rtms_cfg_t(const ngcb_rtms_cfg_t &other)
Copy constructor.
Definition ngcbIFC.hpp:278
ngcb_reg_t application
MUDPI application.
Definition ngcbIFC.hpp:209
void Reset()
Reset all registers.
Definition ngcbIFC.hpp:296
ngcb_reg_t local_ip
RTC-IF local ip.
Definition ngcbIFC.hpp:221
ngcb_reg_t destPort
RTC-IF destination port.
Definition ngcbIFC.hpp:236
#define ngcbRES_SUCCESS
Definition ngcbAddr.h:632
#define ngcbSEQ_STAT_WAITING
Definition ngcbAddr.h:213
#define ngcbI2C_CLK_LINE
Definition ngcbAddr.h:491
#define ngcbI2C_DATA_LINE
Definition ngcbAddr.h:492
#define ngcbAO_ADDR_AFE_L
Definition ngcbAddr.h:529
#define ngcbAO_ADDR_AFE_R
Definition ngcbAddr.h:530
#define ngcbSEQ_STAT_RUNNING
Definition ngcbAddr.h:212
#define ngcbMAX_MOD
Definition ngcbAddr.h:627
#define ngcbI2C_PORT
Definition ngcbAddr.h:490
#define ngcbEVT_SUCCESS
Definition ngcbIFC.hpp:44
#define ngcbEVT_COND_FAIL
Definition ngcbIFC.hpp:48
#define ngcbDiffTime(t1, t2)
Definition ngcb.h:308
int ngcbMicroSleep(int fd, int waitTime)
Definition ngcbTime.c:290
void ngcbInt2Bin(char *str, int in)
Definition ngcbMath.c:91
int ngcbGetTime(struct timeval *t)
Definition ngcbTime.c:40
#define ngcbSUCCESS
Definition ngcb.h:137
#define _vecsize(x)
Definition ngcb.h:79
Definition ngcbIFC.hpp:339
ngcb_chan_ip_t()
Constructor.
Definition ngcbIFC.hpp:347
int port
Destination port.
Definition ngcbIFC.hpp:344
int ip
Destination ip address.
Definition ngcbIFC.hpp:341
Definition ngcbIFC.hpp:353
int application
MUDPI application tag.
Definition ngcbIFC.hpp:361
int topic
MUDPI topic.
Definition ngcbIFC.hpp:355
int component
MUDPI component.
Definition ngcbIFC.hpp:358
ngcb_chan_mudpi_t()
Constructor.
Definition ngcbIFC.hpp:364
Definition ngcbIFC.hpp:370
int le
RTMS little-endian.
Definition ngcbIFC.hpp:378
ngcb_chan_rtms_t()
Constructor.
Definition ngcbIFC.hpp:381
int trailingPadding
RTMS trailing padding.
Definition ngcbIFC.hpp:375
int leadingPadding
RTMS leading padding.
Definition ngcbIFC.hpp:372
ngcb_evt_st_t(int i, int s)
Full constructor.
Definition ngcbIFC.hpp:586
int status
Event status.
Definition ngcbIFC.hpp:580
int id
Event id.
Definition ngcbIFC.hpp:577
ngcb_evt_st_t(int i)
Success constructor for id.
Definition ngcbIFC.hpp:589
ngcb_evt_st_t()
Constructor.
Definition ngcbIFC.hpp:583
Definition ngcbIFC.hpp:514
int addr
Address.
Definition ngcbIFC.hpp:519
int Failure()
Check failure condition.
Definition ngcbIFC.hpp:563
ngcb_evt_t()
Constructor.
Definition ngcbIFC.hpp:547
int board
Board number (1, ...)
Definition ngcbIFC.hpp:516
int mask
32-bit mask
Definition ngcbIFC.hpp:522
ngcb_evt_t(const ngcb_evt_t &other)
Copy constructor.
Definition ngcbIFC.hpp:541
int reference
32-bit reference value
Definition ngcbIFC.hpp:525
ngcb_route_t Route()
Return route to board.
Definition ngcbIFC.hpp:566
int cond
Condition: 0 = match any, 1 = match all (default)
Definition ngcbIFC.hpp:528
ngcb_evt_t & operator=(const ngcb_evt_t &other)
Operator =.
Definition ngcbIFC.hpp:531
int Check(int value)
Check event status.
Definition ngcbIFC.hpp:555
ngcb_ifc_err(const ngcb_ifc_err &other)
Copy constructor.
Definition ngcbIFC.hpp:1505
void * origin
Definition ngcbIFC.hpp:1492
ngcb_ifc_err(void *o, ngcbIFC *d)
Fully classified constructor.
Definition ngcbIFC.hpp:1516
ngcb_ifc_err & operator=(const ngcb_ifc_err &other)
Operator =.
Definition ngcbIFC.hpp:1496
ngcb_ifc_err()
Constructor.
Definition ngcbIFC.hpp:1513
ngcbIFC * device
Definition ngcbIFC.hpp:1493
Definition ngcbIFC.hpp:72
int Board() const
Return board number.
Definition ngcbIFC.hpp:128
int Last() const
Return last routing instruction.
Definition ngcbIFC.hpp:140
bool operator==(const ngcb_route_t &other) const
Operator ==.
Definition ngcbIFC.hpp:106
int hdr[ngcbMAX_MOD]
Route instructions.
Definition ngcbIFC.hpp:77
void Print(char *s) const
Print route to string.
Definition ngcbIFC.hpp:152
ngcb_route_t & operator=(const ngcb_route_t &other)
Operator =.
Definition ngcbIFC.hpp:117
int numHdr
Number of headers in route.
Definition ngcbIFC.hpp:74
ngcb_route_t(const ngcb_route_t &other)
Copy constructor.
Definition ngcbIFC.hpp:80
ngcb_route_t(int board)
Constructor with board number.
Definition ngcbIFC.hpp:95
ngcb_route_t()
Constructor.
Definition ngcbIFC.hpp:88
Definition ngcbIFC.hpp:387
ngcb_rtms_chan()
Constructor.
Definition ngcbIFC.hpp:410
int bits
Number of bits per sample.
Definition ngcbIFC.hpp:392
int enable
Enable channel.
Definition ngcbIFC.hpp:389
ngcb_chan_mudpi_t mudpi
RTMS channel MUDPI configuration.
Definition ngcbIFC.hpp:404
int shift
Bit shift.
Definition ngcbIFC.hpp:395
ngcb_chan_ip_t ip
RTMS channel IP configuration.
Definition ngcbIFC.hpp:401
ngcb_chan_rtms_t rtms
RTMS channel RTMS configuration.
Definition ngcbIFC.hpp:407
int src[4]
Enabled sources (0|1)
Definition ngcbIFC.hpp:398
Definition ngcbIFC.hpp:446
ngcb_rtms_chan chan[4]
RTMS channel configurations.
Definition ngcbIFC.hpp:448
ngcb_rtms_net net
RTMS network configuration.
Definition ngcbIFC.hpp:451
ngcb_rtms_if()
Constructor.
Definition ngcbIFC.hpp:454
Definition ngcbIFC.hpp:420
int ttl
IP time-to-live field.
Definition ngcbIFC.hpp:434
ngcb_rtms_net()
Constructor.
Definition ngcbIFC.hpp:440
int port
Source port.
Definition ngcbIFC.hpp:431
int ip
Local IP address.
Definition ngcbIFC.hpp:422
int subnet
Subnet mask.
Definition ngcbIFC.hpp:425
int gateway
Gateway.
Definition ngcbIFC.hpp:428
int ds
IP differentiated service field.
Definition ngcbIFC.hpp:437
Definition ngcbIFC.hpp:497
int dvld
SYNC with DataValid.
Definition ngcbIFC.hpp:505
ngcb_sctl_t()
Constructor.
Definition ngcbIFC.hpp:508
int size
Packet size.
Definition ngcbIFC.hpp:502
int fwd
Forward sync signal.
Definition ngcbIFC.hpp:499
Definition ngcbIFC.hpp:460
uint64_t start_sec
Schduled start time (seconds)
Definition ngcbIFC.hpp:468
uint64_t start_nsec
Scheduled start time (fractional nanoseconds)
Definition ngcbIFC.hpp:471
uint64_t period_sec
Schduled period (seconds)
Definition ngcbIFC.hpp:474
uint64_t sec
Current time (seconds)
Definition ngcbIFC.hpp:462
ngcb_tsu_t()
Constructor.
Definition ngcbIFC.hpp:486
uint64_t nsec
Current time (fractional nanoseconds)
Definition ngcbIFC.hpp:465
int status
Current TSU trigger status (read-back)
Definition ngcbIFC.hpp:483
uint64_t period_nsec
Scheduled period (fractional nanoseconds)
Definition ngcbIFC.hpp:477
int nshot
Number of trigger pulses (-1 = infinite)
Definition ngcbIFC.hpp:480