ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbIFC.hpp
Go to the documentation of this file.
1
8#ifndef ngcbIFC_H
9#define ngcbIFC_H
10
11
12#ifndef __cplusplus
13#error This is a C++ include file and cannot be used from plain C
14#endif
15
16#include <ngc/core/ngcb.h>
17#include <ngc/core/ngcbAddr.h>
18#include <ngc/core/ngcbSIM.hpp>
19#include <ngc/core/ngcbI2C.hpp>
20#include <ngc/core/ngcbAFE.hpp>
21#include <ngc/core/ngcbLIST.hpp>
23#ifndef NGCII_LEGACY
24#include <cmdsrv-client/client_connection.hpp>
25#else
26#define ClientConnection int
27#endif
28
32#define ngcbIFC_TIMEOUT_DEFAULT 5 // Timeout in seconds
33
34/*
35 * Interface class internal addresses
36 */
37#define ngcbIFC_CLASS_VERSION 0x00000001 //< Interface class SW version
38
39/*
40 * I/O-operations
41 */
42#define ngcbIFC_OP_WR 0x0 //< Write to address
43#define ngcbIFC_OP_RD 0x1 //< Read from address
44#define ngcbIFC_OP_EVT 0x2 //< Poll device events
45
46/*
47 * Event codes
48 */
49#define ngcbEVT_PENDING -1 //< Event pending
50#define ngcbEVT_SUCCESS 0 //< Event received
51#define ngcbEVT_TIMEOUT 1 //< Event timeout
52#define ngcbEVT_FAILURE 2 //< Event failure
53#define ngcbEVT_INVALID 3 //< Event invalid
54#define ngcbEVT_COND_FAIL 0x00010000 //< Event fail condition
55
56/*
57 * RPC states
58 */
59#define RPC_STATE_INVALID 0x00000000 //< Invalid state
60#define RPC_STATE_SEND 0x00000001 //< Request is being send
61#define RPC_STATE_RECEIVED 0x00000002 //< Request received
62#define RPC_STATE_WAITING 0x00000003 //< Waiting
63#define RPC_STATE_DONE 0x000000FF //< Request has been handled
64#define RPC_STATE_BUSY 0x40000000 //< Busy
65#define RPC_STATE_ERROR 0x80000000 //< Error
66#define RPC_STATE_ERROR_UNKNOWN_CMD (RPC_STATE_ERROR | 1) //< Unknown CMD
67#define RPC_STATE_ERROR_BUSY (RPC_STATE_ERROR | 2) //< Busy
68#define RPC_STATE_ERROR_OUT_OF_MEMORY (RPC_STATE_ERROR | 3) //< No memory
69#define RPC_STATE_ERROR_TOO_LONG (RPC_STATE_ERROR | 4) //< Too long
70#define RPC_STATE_ERROR_UNKNOWN_DEVICE (RPC_STATE_ERROR | 5) //< Unknown DEV
71#define RPC_STATE_ERROR_BUFFER_TOO_SMALL (RPC_STATE_ERROR | 6) //< Too small
72#define RPC_STATE_ERROR_UNKNOWN_CHANNEL (RPC_STATE_ERROR | 7) //< Unknown chan
73#define RPC_STATE_ERROR_TRANSFER_FAILED (RPC_STATE_ERROR | 8) //< TX error
74
80 int numHdr;
81
84
86 ngcb_route_t(const ngcb_route_t &other) {
87 int i;
88 for (i=0;i<other.numHdr;i++) hdr[i] = other.hdr[i];
89 for (i=other.numHdr;i<ngcbMAX_MOD;i++) hdr[i] = 0x0;
90 numHdr = other.numHdr;
91 }
92
95 int i;
96 numHdr = 0;
97 for (i=0;i<ngcbMAX_MOD;i++) hdr[i] = 0x0;
98 }
99
101 explicit ngcb_route_t(int board) {
102 int i;
103 if (board < 1) board = 1;
104 else if (board > ngcbMAX_MOD) board = ngcbMAX_MOD;
105 for (i=0;i<(board - 1);i++) hdr[i] = 0x5;
106 hdr[i++] = 0x2;
107 numHdr = i;
108 for (i=numHdr;i<ngcbMAX_MOD;i++) hdr[i] = 0x0;
109 }
110
112 bool operator==(const ngcb_route_t &other) const {
113 if (numHdr != other.numHdr) return (false);
114 else
115 {
116 int i;
117 for (i=0;i<numHdr;i++) if (hdr[i] != other.hdr[i]) return (false);
118 return (true);
119 }
120 }
121
124 if (this != &other)
125 {
126 int i;
127 for (i=0;i<other.numHdr;i++) hdr[i] = other.hdr[i];
128 numHdr = other.numHdr;
129 }
130 return (*this);
131 }
132
134 int Board() const {
135 if ((numHdr > 0) && (numHdr <= ngcbMAX_MOD))
136 {
137 return (numHdr);
138 }
139 else
140 {
141 return (0);
142 }
143 }
144
146 int Last() const {
147 if ((numHdr > 0) && (numHdr <= ngcbMAX_MOD))
148 {
149 return (hdr[numHdr - 1]);
150 }
151 else
152 {
153 return (0x0);
154 }
155 }
156
158 void Print(char *s) const {
159 int i;
160 char tmp[16];
161
162 s[0] = '\0';
163 for (i=0;i<numHdr;i++)
164 {
165 if (i > 0) sprintf(tmp, ",%d", hdr[i]);
166 else sprintf(tmp, "%d", hdr[i]);
167 strcat(s, tmp);
168 }
169 }
170};
171
173public:
175 int addr;
176
178 ngcb_reg_t() {addr = 0x0; value_ = 0x0; setup_ = 0;}
179
181 //explicit ngcb_reg_t(int a) {addr = a; value_ = 0x0; setup_ = 0;}
182
184 int Value() {return (value_);}
185
187 void Setup(int v) {value_ = v; setup_ = 1;}
188
190 int Setup() {return (setup_);}
191
193 void Reset() {setup_ = 0;}
194protected:
195private:
197 int setup_;
198
200 int value_;
201};
202
207public:
210
213
216
219
222
225
228
231
234
237
240
243
246
249
252
254 bool operator==(const ngcb_rtms_cfg_t &other) const {
255 size_t i;
256 for (i=0;i<14;i++)
257 {
258 if (!(reg[i] == other.reg[i]))
259 {
260 return (false);
261 }
262 }
263 return (true);
264 }
265
268 if (this != &other)
269 {
270 size_t i;
271 Init_();
272 for (i=0;i<14;i++)
273 {
274 if (other.reg[i]->Setup())
275 {
276 reg[i]->Setup(other.reg[i]->Value());
277 }
278 }
279 }
280 return (*this);
281 }
282
285 size_t i;
286 Init_();
287 for (i=0;i<14;i++)
288 {
289 if (other.reg[i]->Setup())
290 {
291 reg[i]->Setup(other.reg[i]->Value());
292 }
293 }
294 }
295
298 Init_();
299 }
300
302 void Reset() {
303 size_t i;
304 for (i=0;i<14;i++) reg[i]->Reset();
305 }
306
307protected:
308private:
310 void Init_() {
311 topic.addr = 0x3200;
312 component.addr = 0x3201;
313 application.addr = 0x3202;
314 leadingPadding.addr = 0x3204;
315 trailingPadding.addr = 0x3205;
316 littleEndian.addr = 0x3206;
317 local_ip.addr = 0x3212;
318 subnet.addr = 0x3213;
319 gateway.addr = 0x3214;
320 dest_ip.addr = 0x3215;
321 srcPort.addr = 0x3216;
322 destPort.addr = 0x3217;
323 ttl.addr = 0x3218;
324 ds.addr = 0x3219;
325 reg[0] = &topic;
326 reg[1] = &component;
327 reg[2] = &application;
328 reg[3] = &leadingPadding;
329 reg[4] = &trailingPadding;
330 reg[5] = &littleEndian;
331 reg[6] = &local_ip;
332 reg[7] = &subnet;
333 reg[8] = &gateway;
334 reg[9] = &dest_ip;
335 reg[10] = &srcPort;
336 reg[11] = &destPort;
337 reg[12] = &ttl;
338 reg[13] = &ds;
339 }
340};
341
347 int ip;
348
350 int port;
351
353 ngcb_chan_ip_t() {ip = 0; port = 0;}
354};
355
372
389
396
398 int bits;
399
401 int shift;
402
404 int src[4];
405
408
411
414
417 size_t i;
418 enable = 0; bits = 16; shift = 0;
419 for (i=0;i<_vecsize(src);i++) src[i] = 0;
420 }
421};
422
428 int ip;
429
432
435
437 int port;
438
440 int ttl;
441
443 int ds;
444
446 ngcb_rtms_net() {ip = 0; subnet = 0; gateway = 0; port = 0, ttl = 0; ds = 0;}
447};
448
462
468 uint64_t sec;
469
471 uint64_t nsec;
472
474 uint64_t start_sec;
475
477 uint64_t start_nsec;
478
480 uint64_t period_sec;
481
483 uint64_t period_nsec;
484
486 int nshot;
487
490
493 sec = 0; nsec = 0;
494 start_sec = 0; start_nsec = 0;
495 period_sec = 0; period_nsec = 0;
496 nshot = -1; status = 0;
497 }
498};
499
505 int fwd;
506
508 int size;
509
511 int dvld;
512
514 ngcb_sctl_t() {fwd = 1; size = 0; dvld = 0;}
515};
516
522 int board;
523
525 int addr;
526
528 int mask;
529
532
534 int cond;
535
538 if (this != &other)
539 {
540 board = other.board; addr = other.addr; mask = other.mask;
541 reference = other.reference; cond = other.cond;
542 }
543 return (*this);
544 }
545
547 ngcb_evt_t(const ngcb_evt_t &other):
548 board(other.board), addr(other.addr), mask(other.mask),
549 reference(other.reference), cond(other.cond) {
550 }
551
554 board = 1; addr = 0x6000;
557 cond = 1;
558 }
559
561 int Check(int value) {
562 int x = value & mask;
563 int c = cond & 0xffff;
564 if (c) return (x == (reference & mask)); // equal
565 else return (~(x ^ (reference | ~mask)) != 0); // non differing bits != 0
566 }
567
569 int Failure() {return ((cond & ngcbEVT_COND_FAIL) != 0x0);}
570
574 return (r);
575 }
576};
577
583 int id;
584
587
590
592 ngcb_evt_st_t(int i, int s): id(i), status(s) {}
593
595 explicit ngcb_evt_st_t(int i): id(i), status(ngcbEVT_SUCCESS) {}
596};
597
601class ngcbEVT {
602public:
604 int id;
605
607 int async;
608
610 int cond;
611
614
616 int done;
617
620
622 ngcbEVT(const ngcbEVT &other) {
623 n_ = 0; id = other.id; async = other.async; cond = other.cond;
624 timeout = other.timeout; done = 0;
625 if (other.size_ > 0)
626 {
627 size_t i;
628 component = new ngcb_evt_t[other.size_];
629 size_ = other.size_;
630 for (i=0;i<other.n_;i++) Add(other.component[i]);
631 }
632 else
633 {
634 component = NULL;
635 size_ = 0;
636 }
637 ngcbGetTime(&timeStamp_);
638 }
639
641 explicit ngcbEVT(size_t size) {
642 n_ = 0; id = 0; async = 0; cond = 1; timeout = -1; done = 0;
643 if (size > 0)
644 {
645 component = new ngcb_evt_t[size];
646 size_ = size;
647 }
648 else
649 {
650 component = NULL;
651 size_ = 0;
652 }
653 ngcbGetTime(&timeStamp_);
654 }
655
657 virtual ~ngcbEVT() {
658 if (component != NULL)
659 {
660 delete[] component;
661 }
662 }
663
665 ngcbEVT &operator=(const ngcbEVT &other) {
666 if (this != &other)
667 {
668 n_ = 0; id = other.id; async = other.async; cond = other.cond;
669 timeout = other.timeout; done = 0;
670 if (other.size_ > 0)
671 {
672 size_t i;
673 component = new ngcb_evt_t[other.size_];
674 size_ = other.size_;
675 for (i=0;i<other.n_;i++) Add(other.component[i]);
676 }
677 else
678 {
679 component = NULL;
680 size_ = 0;
681 }
682 ngcbGetTime(&timeStamp_);
683 }
684 return (*this);
685 }
686
688 size_t Size() {return (n_);}
689
691 void Add(const ngcb_evt_t &evt) {if (n_ < size_) component[n_++] = evt;}
692
694 void Add(int board, int addr, int mask, int reference, int cnd = 1) {
695 if ((n_ < size_) && (board > 0) && (board <= ngcbMAX_MOD))
696 {
697 ngcb_evt_t *c = &component[n_++];
698 c->board = board; c->addr = addr;
699 c->mask = mask; c->reference = reference; c->cond = cnd;
700 }
701 }
702
704 void Add(const ngcb_route_t &r, int addr, int mask, int reference,
705 int cnd = 1) {
706 Add(r.Board(), addr, mask, reference, cnd);
707 }
708
710 void TimeStamp() {ngcbGetTime(&timeStamp_);}
711
713 int Timeout() {
714 if (timeout > 0)
715 {
716 struct timeval t;
717 double difft;
718 ngcbGetTime(&t);
719 difft = ngcbDiffTime(timeStamp_, t);
720 if (difft < (double)timeout)
721 {
722 return (0);
723 }
724 else
725 {
726 return (1);
727 }
728 }
729 else if (timeout < 0)
730 {
731 return (0);
732 }
733 else
734 {
735 return (1);
736 }
737 }
738
739protected:
740
741private:
743 size_t size_;
744
746 size_t n_;
747
749 struct timeval timeStamp_;
750};
751
755#define ngcbIFC_HDR_SIZE (3 + ngcbMAX_MOD + 1)
756
760class ngcbIFC {
761public:
763 ngcbIFC();
764
766 explicit ngcbIFC(const char *name);
767
769 virtual ~ngcbIFC();
770
772 FILE *watchdog;
773
776
779
781 int local;
782
784 char thisHost[64];
785
788
791
794
797
800
802 int skip;
803
805 int chain;
806
809
812
815
817 int id;
818
820 int type;
821
824
827
830
833
836
839
842
845
848
850 int sim;
851
853 int xterm;
854
857
860
863
864 /*
865 * Error handling and logging
866 */
867
869 char *ErrMsg();
870
872 void ErrState(const char *msg, int errorId = 0, void *origin = NULL);
873
875 void Result2Err(char *s, int resultCode);
876
878 void Verbose(const char *format, ...)
879 __attribute__ ((format(printf, 2, 3)));
880
882 void Log(const char *format, ...)
883 __attribute__ ((format(printf, 2, 3)));
884
885
886 /*
887 * Interface definition
888 */
889
891 const char *SofwVersion();
892
894 char *Name();
895
897 char *Type();
898
900 char *Arg();
901
903 int Instance();
904
906 void Instance(int instance);
907
909 int Open();
910
912 void DefaultTimeout(int seconds);
913
915 int SetTime(double time = 0.0);
916
918 int BigEndian();
919
921 int SyncFwd(int flag);
922
924 int SyncWithData(int flag);
925
927 int SyncSize(int size);
928
929 /*
930 * High-level state handling
931 */
932
934 int Configure(const char *s);
935
937 int Configure();
938
940 const char *Setup();
941
943 int Standby();
944
946 int Online();
947
949 int Off();
950
952 int PythonTask(const char *script);
953
954
955 /*
956 * Generic i/o functions
957 */
958
960 int ReadAddr(const ngcb_route_t &route, int addr, int *buffer, int size);
961
963 int WriteAddr(const ngcb_route_t &route, int addr, const int *buffer,
964 int size);
965
967 int WriteBuffer(const int *buffer, int size, int *result);
968
970 int Event(ngcbEVT *evt);
971
973 int ReadAddr(int addr, int *buffer, int size = 1);
974
976 int WriteAddr(int addr, const int *buffer, int size);
977
979 int WriteAddr(int addr, int value);
980
982 int ReadAddr64(const ngcb_route_t &route, int addr, uint64_t *buffer,
983 int size);
984
986 int WriteAddr64(const ngcb_route_t &route, int addr, const uint64_t *buffer,
987 int size);
988
990 int ReadAddr64(int addr, uint64_t *buffer, int size = 1);
991
993 int WriteAddr64(int addr, const uint64_t *buffer, int size);
994
996 int WriteAddr64(int addr, uint64_t value);
997
998
999 /*
1000 * Device events interface
1001 */
1002
1005
1007 int CheckEvent(ngcbEVT *evt, int *result);
1008
1010 int Wait(ngcbEVT *evt, int interval, int *result);
1011
1013 void Poll();
1014
1016 int SetChanIp(int idx, ngcb_chan_ip_t ip);
1017
1019 int SetChanMudpi(int idx, ngcb_chan_mudpi_t mudpi);
1020
1022 int SetChanRtms(int idx, ngcb_chan_rtms_t rtms);
1023
1025 int SetRtmsNet(ngcb_rtms_net net);
1026
1028 int GetChanIp(int idx, ngcb_chan_ip_t *ip);
1029
1031 int GetChanMudpi(int idx, ngcb_chan_mudpi_t *mudpi);
1032
1034 int GetChanRtms(int idx, ngcb_chan_rtms_t *rtms);
1035
1037 int GetRtmsNet(ngcb_rtms_net *net);
1038
1040 int SetChanEnable(int idx, int flag);
1041
1043 int GetChanEnable(int idx, int *flag);
1044
1046 int SetChanSrc(int idx, int src = 0, int flag = -1);
1047
1049 int GetChanSrc(int idx, int src, int *flag);
1050
1052 int GetChanDrop(int idx, int src, int *flag);
1053
1055 int ClearChanDrop(int idx);
1056
1058 int SetChanBits(int idx, int bits);
1059
1061 int GetChanBits(int idx, int *bits);
1062
1064 int SetChanShift(int idx, int shift);
1065
1067 int GetChanShift(int idx, int *shift);
1068
1069
1070 /*
1071 * Virtual Interface
1072 */
1073
1075 virtual int Fd();
1076
1078 virtual int Pid();
1079
1081 virtual int Port();
1082
1084 virtual const char *Host();
1085
1087 virtual int Sim(int level);
1088
1090 virtual int Open(const char *name);
1091
1093 virtual int Close();
1094
1096 virtual int Connect();
1097
1099 virtual int Disconnect();
1100
1102 virtual int Ping();
1103
1105 virtual void Keeper(int seconds);
1106
1108 virtual int Reset();
1109
1111 virtual int Timeout(int seconds);
1112
1114 virtual int Timeout();
1115
1117 virtual int SetTime(uint64_t sec, uint64_t nsec);
1118
1120 virtual void RpcCopy(void *dest, const void *src, size_t size, size_t items);
1121
1123 virtual int Str2Payload(const char *cmd, unsigned char *payload,
1124 unsigned int max, char *erms);
1125
1127 virtual int RPC(int mod, int target, int req, void *payload,
1128 unsigned int size, unsigned int *status);
1129
1131 virtual int Read(int *buffer, int size);
1132
1134 virtual int Write(const int *buffer, int size);
1135
1137 virtual int ReadAddr(ngcb_route_t route, int addr, int *buffer, int size,
1138 int *result);
1139
1141 virtual int WriteAddr(ngcb_route_t route, int addr, const int *buffer,
1142 int size, int *result);
1143
1145 virtual int Event(ngcbEVT *evt, int *result);
1146
1148 virtual int Status(int *devStatus);
1149
1151 virtual int ExecServer();
1152
1154 virtual int KillServer();
1155
1157 virtual int Running();
1158
1160 virtual int Connected();
1161
1163 virtual int HandleFdEvt();
1164
1166 virtual ClientConnection *GetConnection();
1167
1168 /***
1169 * Start TSU trigger at given absolute time
1170 * (seconds + fractional nanoseconds)
1171 */
1172 virtual int TsuStartAt(uint64_t sec, uint64_t nsec);
1173
1175 virtual int TsuStart();
1176
1178 virtual int TsuStop();
1179
1181 virtual int TsuTrigger();
1182
1184 virtual int TsuSnapshot();
1185
1187 virtual int TsuStatus(int *value);
1188
1190 virtual int TsuConfig(ngcb_tsu_t *cfg);
1191
1192 /***
1193 * The function checks the TSU running status. If the status cannot be
1194 * read -1 is returned and ErrMsg() contains the detailed error message.
1195 * Otherwise 1 is returned if the TSU is running or zero is returned if
1196 * the TSU is not running.
1197 */
1198 virtual int TsuRunning();
1199
1200 /*
1201 * Bottom end i/o
1202 */
1203
1205 virtual int _ReadAddr(ngcb_route_t route, int addr, int *buffer, int size,
1206 int *result);
1207
1209 virtual int _WriteAddr(ngcb_route_t route, int addr, const int *buffer,
1210 int size, int *result);
1211
1212protected:
1214 virtual int SetupCB(const char *buffer);
1215
1216private:
1218 void Init_();
1219
1221 char thisVersion_[128];
1222
1224 int handle_;
1225
1227 int timeout_;
1228
1230 int fifoSize_;
1231
1233 char setupString_[64];
1234
1236 int setupCode_;
1237
1239 char type_[64];
1240
1242 char name_[256];
1243
1245 char arg_[256];
1246
1248 int endian_;
1249
1251 int instance_;
1252
1254 ngcbSIM *simulator_;
1255
1257 int testBuffer_[1024];
1258
1260 void ClrEvt_();
1261
1262 /*
1263 * Error handling
1264 */
1265
1267 int CheckErr_(int);
1268
1270 char erms_[256];
1271
1272
1273 /*
1274 * Interface base class access
1275 */
1276
1278 int IfcRead_(int addr);
1279
1281 void IfcWrite_(int addr, int value);
1282
1283
1284 /*
1285 * IOCTL interface
1286 */
1287
1289 virtual int ReadLocal_(int addr, int *value);
1290
1292 virtual int WriteLocal_(int addr, int value);
1293
1295 virtual int ReadCfg_(int addr, int *value);
1296
1298 virtual int WriteCfg_(int addr, int value);
1299
1300
1301 /*
1302 * SIDECAR ASIC interface
1303 */
1304
1306 int ScaRead_(const ngcb_route_t &route, int addr, int sid, int flags,
1307 int *buffer, int size, int *result);
1308
1310 int ScaWrite_(const ngcb_route_t &route, int addr, int sid, int flags,
1311 const int *buffer, int size, int *result);
1312
1314 int ScaReadBlock_(const ngcb_route_t &route, int addr, int sid, int flags,
1315 int *buffer, int size, int *result);
1316
1318 int ScaWriteBlock_(const ngcb_route_t &route, int addr, int sid, int flags,
1319 const int *buffer, int size, int *result);
1320
1322 int ScaCRC16_(const int *buffer, int size);
1323};
1324
1328class ngcbI2C_IO: public ngcbI2C
1329{
1330public:
1334 int i;
1335
1336 /*
1337 * Copy device and routing information
1338 */
1339 dev_ = dev;
1340 route_.numHdr = r.numHdr;
1341 for (i=0;i<r.numHdr;i++) route_.hdr[i] = r.hdr[i];
1342
1343 tmo = 0; // no sleep
1344 ACK_IN(2); // acknowledge on bit 2 (TBD)
1345 SDA_DIR_SWITCH(3); // SDA direction switch on bit 3 (TBD)
1346 }
1347
1349 virtual ~ngcbI2C_IO() {
1350 }
1351
1353 int tmo; // in microseconds
1354
1356 int OutCB(int d, int *resultCode, char *erms) {
1357
1358 *resultCode = ngcbRES_SUCCESS;
1359
1360 if (dev_ != NULL)
1361 {
1362 if (dev_->verboseLevel > 1)
1363 {
1364 char s[33];
1365 ngcbInt2Bin(s, d);
1366 dev_->Verbose("ngcbI2C: <%s>\n", s);
1367 }
1368
1369 /*
1370 * Write one word to I2C-port
1371 */
1372 if (dev_->_WriteAddr(route_, ngcbI2C_PORT, &d, 1,
1373 resultCode) != ngcbSUCCESS)
1374 {
1375 strcpy(erms, dev_->ErrMsg());
1376 return (-1);
1377 }
1378 }
1379
1380 /*
1381 * Delay (if tmo > 0)
1382 */
1383 ngcbMicroSleep(-1, tmo);
1384
1385 return (0);
1386 }
1387
1389 int InCB(int *d, int *resultCode, char *erms) {
1390
1391 *resultCode = ngcbRES_SUCCESS;
1392
1393 if (dev_ != NULL)
1394 {
1395 /*
1396 * Read one word from I2C-port
1397 */
1398 if (dev_->_ReadAddr(route_, ngcbI2C_PORT, d, 1,
1399 resultCode) != ngcbSUCCESS)
1400 {
1401 strcpy(erms, dev_->ErrMsg());
1402 return (-1);
1403 }
1404 }
1405
1406 /*
1407 * Delay (if tmo > 0)
1408 */
1409 ngcbMicroSleep(-1, tmo);
1410
1411 return (0);
1412 }
1413
1414protected:
1415
1416private:
1418 ngcbIFC *dev_;
1419
1421 ngcb_route_t route_;
1422};
1423
1427class ngcbAFE_IO: public ngcbAFE
1428{
1429public:
1431 int tmo; // in microseconds
1432
1435 int i;
1436
1437 /*
1438 * Copy device and routing information
1439 */
1440 dev_ = dev;
1441 route_.numHdr = r.numHdr;
1442 for (i=0;i<r.numHdr;i++) route_.hdr[i] = r.hdr[i];
1443
1444 tmo = 0;
1445 }
1446
1448 virtual ~ngcbAFE_IO() {
1449 }
1450
1452 int OutCB(int side, int d, int *resultCode, char *erms) {
1453 int addr;
1454
1455 *resultCode = ngcbRES_SUCCESS;
1456
1457 /*
1458 * Select address associated to side
1459 */
1460 if (side == 0) addr = ngcbAO_ADDR_AFE_L;
1461 else addr = ngcbAO_ADDR_AFE_R;
1462
1463 if (dev_ != NULL)
1464 {
1465 if (dev_->verboseLevel > 1)
1466 {
1467 char s[33];
1468 ngcbInt2Bin(s, d);
1469 dev_->Verbose("ngcbAFE: <%s> <0x%04x>\n", s, d & 0xffff);
1470 }
1471
1472 /*
1473 * Write one word to AFE-port
1474 */
1475 if (dev_->_WriteAddr(route_, addr, &d, 1,
1476 resultCode) != ngcbSUCCESS)
1477 {
1478 strcpy(erms, dev_->ErrMsg());
1479 return (-1);
1480 }
1481 }
1482
1483 /*
1484 * Delay (if tmo > 0)
1485 */
1486 ngcbMicroSleep(-1, tmo);
1487
1488 return (0);
1489 }
1490
1491protected:
1492
1493private:
1495 ngcbIFC *dev_;
1496
1498 ngcb_route_t route_;
1499};
1500
1505 void *origin; //< Application specific originator
1506 ngcbIFC *device; //< Interface device reporting the error state
1507
1510 if (this != &other)
1511 {
1512 origin = other.origin; device = other.device;
1513 }
1514 return (*this);
1515 }
1516
1519 /*
1520 * Forward pointers
1521 */
1522 origin = other.origin; device = other.device;
1523 }
1524
1526 ngcb_ifc_err() {origin = NULL; device = NULL;}
1527
1529 ngcb_ifc_err(void *o, ngcbIFC *d): origin(o), device(d) {}
1530};
1531
1532#endif
1533
int tmo
Timeout for microsleep.
Definition ngcbIFC.hpp:1431
ngcbAFE_IO(ngcbIFC *dev, ngcb_route_t r)
Constructor.
Definition ngcbIFC.hpp:1434
int OutCB(int side, int d, int *resultCode, char *erms)
Write one word (call-back)
Definition ngcbIFC.hpp:1452
virtual ~ngcbAFE_IO()
Destructor.
Definition ngcbIFC.hpp:1448
ngcbAFE()
Constructor.
Definition ngcbAFE.hpp:26
Definition ngcbIFC.hpp:601
int id
Event id.
Definition ngcbIFC.hpp:604
int async
Asynchronous event notification.
Definition ngcbIFC.hpp:607
ngcb_evt_t * component
Device event components.
Definition ngcbIFC.hpp:619
void Add(const ngcb_evt_t &evt)
Add event component.
Definition ngcbIFC.hpp:691
ngcbEVT(size_t size)
Constructor.
Definition ngcbIFC.hpp:641
ngcbEVT & operator=(const ngcbEVT &other)
Operator =.
Definition ngcbIFC.hpp:665
void TimeStamp()
Event timestamp.
Definition ngcbIFC.hpp:710
int done
Done.
Definition ngcbIFC.hpp:616
virtual ~ngcbEVT()
Destructor.
Definition ngcbIFC.hpp:657
size_t Size()
Return number of list components.
Definition ngcbIFC.hpp:688
int timeout
Timeout (seconds)
Definition ngcbIFC.hpp:613
ngcbEVT(const ngcbEVT &other)
Copy constructor.
Definition ngcbIFC.hpp:622
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:704
int Timeout()
Check for timeout.
Definition ngcbIFC.hpp:713
int cond
Event condition: 0 = any, 1 = all (default)
Definition ngcbIFC.hpp:610
void Add(int board, int addr, int mask, int reference, int cnd=1)
Add explicit event (on board)
Definition ngcbIFC.hpp:694
int OutCB(int d, int *resultCode, char *erms)
Write one word (call-back)
Definition ngcbIFC.hpp:1356
virtual ~ngcbI2C_IO()
Destructor.
Definition ngcbIFC.hpp:1349
int InCB(int *d, int *resultCode, char *erms)
Read one word (call-back)
Definition ngcbIFC.hpp:1389
int tmo
Timeout for microsleep.
Definition ngcbIFC.hpp:1353
ngcbI2C_IO(ngcbIFC *dev, ngcb_route_t r, int cnt)
Constructor.
Definition ngcbIFC.hpp:1332
ngcbI2C()
Definition ngcbI2C.hpp:44
void ACK_IN(int bit)
Define ack-line bit.
Definition ngcbI2C.hpp:100
void SDA_DIR_SWITCH(int bit)
Define SDA direction switch bit.
Definition ngcbI2C.hpp:103
Definition ngcbIFC.hpp:760
int SetChanSrc(int idx, int src=0, int flag=-1)
Enable/disable channel source.
Definition ngcbIFC.cpp:3652
virtual int Port()
Driver interface process command port.
Definition ngcbIFC.cpp:265
int protocol
Incremental protovol id.
Definition ngcbIFC.hpp:832
virtual int TsuStop()
Stop TSU trigger.
Definition ngcbIFC.cpp:2096
int backPlane
Back-plane id.
Definition ngcbIFC.hpp:796
int GetChanMudpi(int idx, ngcb_chan_mudpi_t *mudpi)
Get RTMS channel MUDPI configuration.
Definition ngcbIFC.cpp:3508
void ErrState(const char *msg, int errorId=0, void *origin=NULL)
Go to error state with error message.
Definition ngcbIFC.cpp:2166
char * Type()
Interface type.
Definition ngcbIFC.cpp:233
virtual int TsuRunning()
Definition ngcbIFC.cpp:2100
virtual int Reset()
Reset device.
Definition ngcbIFC.cpp:539
virtual ~ngcbIFC()
Destructor.
Definition ngcbIFC.cpp:47
int serNo2
Interface board serial number part two.
Definition ngcbIFC.hpp:814
void Result2Err(char *s, int resultCode)
Convert result code to error string.
Definition ngcbIFC.cpp:2184
char * Name()
Device name.
Definition ngcbIFC.cpp:231
virtual int Read(int *buffer, int size)
Read buffer from device.
Definition ngcbIFC.cpp:685
FILE * watchdog
External watchdog stream.
Definition ngcbIFC.hpp:772
void Verbose(const char *format,...) __attribute__((format(printf
Verbose message.
Definition ngcbIFC.cpp:2103
int xterm
Start in new terminal.
Definition ngcbIFC.hpp:853
int tsuCtrl
Enable/disable automatic start/stop of the TSU.
Definition ngcbIFC.hpp:847
int SetChanBits(int idx, int bits)
Set number of enabled bits on channel.
Definition ngcbIFC.cpp:3780
int translate
RPC payload translation method.
Definition ngcbIFC.hpp:862
int SyncFwd(int flag)
Forward SYNC signal.
Definition ngcbIFC.cpp:2295
int skip
Number of route nodes to skip.
Definition ngcbIFC.hpp:802
int version
Board version (sub-type)
Definition ngcbIFC.hpp:823
virtual int Pid()
Driver interface process id.
Definition ngcbIFC.cpp:256
virtual int Close()
Close interface.
Definition ngcbIFC.cpp:464
virtual int _WriteAddr(ngcb_route_t route, int addr, const int *buffer, int size, int *result)
Write to adress.
Definition ngcbIFC.cpp:1402
int Event(ngcbEVT *evt)
Activate device event.
Definition ngcbIFC.cpp:1961
ngcbSERVICE * services
System services.
Definition ngcbIFC.hpp:775
int SetRtmsNet(ngcb_rtms_net net)
Set RTMS common parameters.
Definition ngcbIFC.cpp:3451
int GetChanRtms(int idx, ngcb_chan_rtms_t *rtms)
Get RTMS channel RTMS configuration.
Definition ngcbIFC.cpp:3542
int GetChanDrop(int idx, int src, int *flag)
Get channel source drop flag.
Definition ngcbIFC.cpp:3725
int sideLink
Connected through sidelink.
Definition ngcbIFC.hpp:793
int Instance()
Get interface instance.
Definition ngcbIFC.cpp:237
virtual int Connect()
Connect through to device.
Definition ngcbIFC.cpp:507
virtual int TsuSnapshot()
Take TSU snapshot.
Definition ngcbIFC.cpp:2101
void DefaultTimeout(int seconds)
Set default timeout.
Definition ngcbIFC.cpp:621
virtual int _ReadAddr(ngcb_route_t route, int addr, int *buffer, int size, int *result)
Read from address.
Definition ngcbIFC.cpp:1251
void void const char * SofwVersion()
Software version.
Definition ngcbIFC.cpp:229
int id
ID-register content.
Definition ngcbIFC.hpp:817
char * Arg()
Driver interface process arguments.
Definition ngcbIFC.cpp:235
char thisHost[64]
Host where this instance is launched.
Definition ngcbIFC.hpp:784
int GetChanSrc(int idx, int src, int *flag)
Get enabled-flag per source and channel.
Definition ngcbIFC.cpp:3693
virtual int Write(const int *buffer, int size)
Write buffer to device.
Definition ngcbIFC.cpp:733
int WriteAddr64(const ngcb_route_t &route, int addr, const uint64_t *buffer, int size)
64-bit write
Definition ngcbIFC.cpp:1607
int ReadAddr64(const ngcb_route_t &route, int addr, uint64_t *buffer, int size)
64-bit read
Definition ngcbIFC.cpp:1601
int SetChanMudpi(int idx, ngcb_chan_mudpi_t mudpi)
Set RTMS channel MUDPI configuration.
Definition ngcbIFC.cpp:3396
virtual int RPC(int mod, int target, int req, void *payload, unsigned int size, unsigned int *status)
RPC.
Definition ngcbIFC.cpp:677
virtual ClientConnection * GetConnection()
Get client connection.
Definition ngcbIFC.cpp:3969
int Online()
Bring interface to ONLINE state.
Definition ngcbIFC.cpp:2492
char * ErrMsg()
Pointer to last error message.
Definition ngcbIFC.cpp:2158
int verboseLevel
Verbose level.
Definition ngcbIFC.hpp:856
virtual int SetupCB(const char *buffer)
Setup call-back.
Definition ngcbIFC.cpp:660
int SyncSize(int size)
Set SYNC packet size.
Definition ngcbIFC.cpp:2315
void void Log(const char *format,...) __attribute__((format(printf
Log message.
Definition ngcbIFC.cpp:2139
virtual int Ping()
Ping device.
Definition ngcbIFC.cpp:535
virtual const char * Host()
Driver interface process host.
Definition ngcbIFC.cpp:274
int firmware
Firmware revision.
Definition ngcbIFC.hpp:829
int SyncWithData(int flag)
SYNC with data-valid.
Definition ngcbIFC.cpp:2275
void Poll()
Poll event list.
Definition ngcbIFC.cpp:1973
int ioError
Indicates an i/o error.
Definition ngcbIFC.hpp:778
int ClearChanDrop(int idx)
Clear channel drop flags.
Definition ngcbIFC.cpp:3757
int GetRtmsNet(ngcb_rtms_net *net)
Get RTMS common parameters.
Definition ngcbIFC.cpp:3571
virtual int Str2Payload(const char *cmd, unsigned char *payload, unsigned int max, char *erms)
Parse string to RPC payload.
Definition ngcbIFC.cpp:671
int SetChanShift(int idx, int shift)
Set channel bit shift.
Definition ngcbIFC.cpp:3834
ngcb_sctl_t sync
SYNC signal control.
Definition ngcbIFC.hpp:835
int master
Index of master device.
Definition ngcbIFC.hpp:799
int GetChanBits(int idx, int *bits)
Get number of enabled bits on channel.
Definition ngcbIFC.cpp:3805
int GetChanShift(int idx, int *shift)
Get channel bit shift.
Definition ngcbIFC.cpp:3859
int local
Interface is local.
Definition ngcbIFC.hpp:781
virtual int Disconnect()
Disconnect from device.
Definition ngcbIFC.cpp:520
int Configure(const char *s)
Configure interface device via interface setup identification string.
Definition ngcbIFC.cpp:2336
int type
Board type.
Definition ngcbIFC.hpp:820
virtual void Keeper(int seconds)
Set line keeper interval (seconds)
Definition ngcbIFC.cpp:537
int Open()
Open interface with current name.
Definition ngcbIFC.cpp:319
virtual int TsuStartAt(uint64_t sec, uint64_t nsec)
Definition ngcbIFC.cpp:2090
virtual int KillServer()
Terminate driver interface process.
Definition ngcbIFC.cpp:2038
virtual int Connected()
Connected to device.
Definition ngcbIFC.cpp:2055
int serNo1
Interface board serial number part one.
Definition ngcbIFC.hpp:811
int revision
Hardware revision.
Definition ngcbIFC.hpp:826
int SetTime(double time=0.0)
Set device time (seconds since UNIX epoch, time <= 0.0 sets system time).
Definition ngcbIFC.cpp:629
int ReadAddr(const ngcb_route_t &route, int addr, int *buffer, int size)
Read from address.
Definition ngcbIFC.cpp:1544
int WriteBuffer(const int *buffer, int size, int *result)
Write formatted buffer to device.
Definition ngcbIFC.cpp:1644
int WriteAddr(const ngcb_route_t &route, int addr, const int *buffer, int size)
Write to address.
Definition ngcbIFC.cpp:1557
int keeper
Line keeper interval (seconds)
Definition ngcbIFC.hpp:790
int CheckEvent(ngcbEVT *evt, int *result)
Check if device event conditions are met.
Definition ngcbIFC.cpp:1731
virtual int Status(int *devStatus)
Get communication status.
Definition ngcbIFC.cpp:2009
ngcbLIST evtList
Device event list.
Definition ngcbIFC.hpp:1004
int Off()
Bring interface to OFF state.
Definition ngcbIFC.cpp:2644
int logLevel
Logging level.
Definition ngcbIFC.hpp:859
int BigEndian()
Get endianess.
Definition ngcbIFC.cpp:241
virtual int Running()
Driver interface process is running.
Definition ngcbIFC.cpp:2047
int GetChanIp(int idx, ngcb_chan_ip_t *ip)
Get RTMS channel IP configuration.
Definition ngcbIFC.cpp:3476
virtual int TsuConfig(ngcb_tsu_t *cfg)
Get TSU configuration.
Definition ngcbIFC.cpp:2099
int Standby()
Bring interface to STANDBY state.
Definition ngcbIFC.cpp:2458
virtual int HandleFdEvt()
Handle event on file descriptor.
Definition ngcbIFC.cpp:2064
ngcb_route_t cfgRoute
Configuration route.
Definition ngcbIFC.hpp:808
virtual int Sim(int level)
Set simulation level.
Definition ngcbIFC.cpp:283
int SetChanIp(int idx, ngcb_chan_ip_t ip)
Set RTMS channel IP configuration.
Definition ngcbIFC.cpp:3369
ngcb_rtms_cfg_t rtms
RTMS configuration (WFS)
Definition ngcbIFC.hpp:838
int SetChanRtms(int idx, ngcb_chan_rtms_t rtms)
Set RTMS channel RTMS configuration.
Definition ngcbIFC.cpp:3425
int SetChanEnable(int idx, int flag)
Enable/disable RTMS channel.
Definition ngcbIFC.cpp:3601
int netTimeout
Network timeout (seconds)
Definition ngcbIFC.hpp:787
virtual int ExecServer()
Launch driver interface process.
Definition ngcbIFC.cpp:2029
virtual void RpcCopy(void *dest, const void *src, size_t size, size_t items)
Copy RPC payload.
Definition ngcbIFC.cpp:666
int chain
Chain length from last skipped node to DFE.
Definition ngcbIFC.hpp:805
ngcb_rtms_if rtmsIf
RTMS interface (NGCII)
Definition ngcbIFC.hpp:841
int GetChanEnable(int idx, int *flag)
Get RTMS channel status (enabled/disabled)
Definition ngcbIFC.cpp:3625
const char * Setup()
Return actual interface setup identification string.
Definition ngcbIFC.cpp:2419
int sim
Interface simulation level.
Definition ngcbIFC.hpp:850
ngcbIFC()
Constructor without device name.
Definition ngcbIFC.cpp:36
virtual int TsuStatus(int *value)
Get TSU status.
Definition ngcbIFC.cpp:2098
ngcb_tsu_t tsu
TSU configuration.
Definition ngcbIFC.hpp:844
virtual int Timeout(int seconds)
Set timeout.
Definition ngcbIFC.cpp:597
virtual int Fd()
Return device file descriptor.
Definition ngcbIFC.cpp:247
virtual int TsuTrigger()
Manual TSU trigger.
Definition ngcbIFC.cpp:2097
int Wait(ngcbEVT *evt, int interval, int *result)
Wait for event.
Definition ngcbIFC.cpp:1868
int PythonTask(const char *script)
Execute Python task.
Definition ngcbIFC.cpp:3888
virtual int TsuStart()
Start TSU trigger immediatly.
Definition ngcbIFC.cpp:2095
Definition ngcbLIST.hpp:34
Definition ngcbSERVICE.hpp:36
Definition ngcbSIM.hpp:152
Definition ngcbIFC.hpp:172
void Setup(int v)
Set value.
Definition ngcbIFC.hpp:187
int addr
Address.
Definition ngcbIFC.hpp:175
int Value()
Constructor.
Definition ngcbIFC.hpp:184
int Setup()
Check, if value has been set.
Definition ngcbIFC.hpp:190
void Reset()
Reset.
Definition ngcbIFC.hpp:193
ngcb_reg_t()
Constructor.
Definition ngcbIFC.hpp:178
Definition ngcbIFC.hpp:206
ngcb_rtms_cfg_t & operator=(const ngcb_rtms_cfg_t &other)
Operator =.
Definition ngcbIFC.hpp:267
ngcb_reg_t dest_ip
RTC-IF destination ip.
Definition ngcbIFC.hpp:236
ngcb_reg_t ds
RTC-IF DS.
Definition ngcbIFC.hpp:248
ngcb_reg_t leadingPadding
RTMS leading padding.
Definition ngcbIFC.hpp:218
bool operator==(const ngcb_rtms_cfg_t &other) const
Operator ==.
Definition ngcbIFC.hpp:254
ngcb_reg_t littleEndian
RTMS little endian.
Definition ngcbIFC.hpp:224
ngcb_rtms_cfg_t()
Constructor.
Definition ngcbIFC.hpp:297
ngcb_reg_t ttl
RTC-IF TTL.
Definition ngcbIFC.hpp:245
ngcb_reg_t * reg[14]
Register array.
Definition ngcbIFC.hpp:251
ngcb_reg_t gateway
RTC-IF gatewway.
Definition ngcbIFC.hpp:233
ngcb_reg_t trailingPadding
RTMS trailing padding.
Definition ngcbIFC.hpp:221
ngcb_reg_t subnet
RTC-IF subnet mask.
Definition ngcbIFC.hpp:230
ngcb_reg_t srcPort
RTC-IF source port.
Definition ngcbIFC.hpp:239
ngcb_reg_t topic
MUDPI topic.
Definition ngcbIFC.hpp:209
ngcb_reg_t component
MUDPI component.
Definition ngcbIFC.hpp:212
ngcb_rtms_cfg_t(const ngcb_rtms_cfg_t &other)
Copy constructor.
Definition ngcbIFC.hpp:284
ngcb_reg_t application
MUDPI application.
Definition ngcbIFC.hpp:215
void Reset()
Reset all registers.
Definition ngcbIFC.hpp:302
ngcb_reg_t local_ip
RTC-IF local ip.
Definition ngcbIFC.hpp:227
ngcb_reg_t destPort
RTC-IF destination port.
Definition ngcbIFC.hpp:242
#define ngcbRES_SUCCESS
Definition ngcbAddr.h:633
#define ngcbSEQ_STAT_WAITING
Definition ngcbAddr.h:214
#define ngcbI2C_CLK_LINE
Definition ngcbAddr.h:492
#define ngcbI2C_DATA_LINE
Definition ngcbAddr.h:493
#define ngcbAO_ADDR_AFE_L
Definition ngcbAddr.h:530
#define ngcbAO_ADDR_AFE_R
Definition ngcbAddr.h:531
#define ngcbSEQ_STAT_RUNNING
Definition ngcbAddr.h:213
#define ngcbMAX_MOD
Definition ngcbAddr.h:628
#define ngcbI2C_PORT
Definition ngcbAddr.h:491
#define ngcbEVT_SUCCESS
Definition ngcbIFC.hpp:50
#define ngcbEVT_COND_FAIL
Definition ngcbIFC.hpp:54
#define ngcbDiffTime(t1, t2)
Definition ngcb.h:309
int ngcbMicroSleep(int fd, int waitTime)
Definition ngcbTime.c:291
void ngcbInt2Bin(char *str, int in)
Definition ngcbMath.c:92
int ngcbGetTime(struct timeval *t)
Definition ngcbTime.c:41
#define ngcbSUCCESS
Definition ngcb.h:138
#define _vecsize(x)
Definition ngcb.h:80
Definition ngcbIFC.hpp:345
ngcb_chan_ip_t()
Constructor.
Definition ngcbIFC.hpp:353
int port
Destination port.
Definition ngcbIFC.hpp:350
int ip
Destination ip address.
Definition ngcbIFC.hpp:347
Definition ngcbIFC.hpp:359
int application
MUDPI application tag.
Definition ngcbIFC.hpp:367
int topic
MUDPI topic.
Definition ngcbIFC.hpp:361
int component
MUDPI component.
Definition ngcbIFC.hpp:364
ngcb_chan_mudpi_t()
Constructor.
Definition ngcbIFC.hpp:370
Definition ngcbIFC.hpp:376
int le
RTMS little-endian.
Definition ngcbIFC.hpp:384
ngcb_chan_rtms_t()
Constructor.
Definition ngcbIFC.hpp:387
int trailingPadding
RTMS trailing padding.
Definition ngcbIFC.hpp:381
int leadingPadding
RTMS leading padding.
Definition ngcbIFC.hpp:378
ngcb_evt_st_t(int i, int s)
Full constructor.
Definition ngcbIFC.hpp:592
int status
Event status.
Definition ngcbIFC.hpp:586
int id
Event id.
Definition ngcbIFC.hpp:583
ngcb_evt_st_t(int i)
Success constructor for id.
Definition ngcbIFC.hpp:595
ngcb_evt_st_t()
Constructor.
Definition ngcbIFC.hpp:589
Definition ngcbIFC.hpp:520
int addr
Address.
Definition ngcbIFC.hpp:525
int Failure()
Check failure condition.
Definition ngcbIFC.hpp:569
ngcb_evt_t()
Constructor.
Definition ngcbIFC.hpp:553
int board
Board number (1, ...)
Definition ngcbIFC.hpp:522
int mask
32-bit mask
Definition ngcbIFC.hpp:528
ngcb_evt_t(const ngcb_evt_t &other)
Copy constructor.
Definition ngcbIFC.hpp:547
int reference
32-bit reference value
Definition ngcbIFC.hpp:531
ngcb_route_t Route()
Return route to board.
Definition ngcbIFC.hpp:572
int cond
Condition: 0 = match any, 1 = match all (default)
Definition ngcbIFC.hpp:534
ngcb_evt_t & operator=(const ngcb_evt_t &other)
Operator =.
Definition ngcbIFC.hpp:537
int Check(int value)
Check event status.
Definition ngcbIFC.hpp:561
ngcb_ifc_err(const ngcb_ifc_err &other)
Copy constructor.
Definition ngcbIFC.hpp:1518
void * origin
Definition ngcbIFC.hpp:1505
ngcb_ifc_err(void *o, ngcbIFC *d)
Fully classified constructor.
Definition ngcbIFC.hpp:1529
ngcb_ifc_err & operator=(const ngcb_ifc_err &other)
Operator =.
Definition ngcbIFC.hpp:1509
ngcb_ifc_err()
Constructor.
Definition ngcbIFC.hpp:1526
ngcbIFC * device
Definition ngcbIFC.hpp:1506
Definition ngcbIFC.hpp:78
int Board() const
Return board number.
Definition ngcbIFC.hpp:134
int Last() const
Return last routing instruction.
Definition ngcbIFC.hpp:146
bool operator==(const ngcb_route_t &other) const
Operator ==.
Definition ngcbIFC.hpp:112
int hdr[ngcbMAX_MOD]
Route instructions.
Definition ngcbIFC.hpp:83
void Print(char *s) const
Print route to string.
Definition ngcbIFC.hpp:158
ngcb_route_t & operator=(const ngcb_route_t &other)
Operator =.
Definition ngcbIFC.hpp:123
int numHdr
Number of headers in route.
Definition ngcbIFC.hpp:80
ngcb_route_t(const ngcb_route_t &other)
Copy constructor.
Definition ngcbIFC.hpp:86
ngcb_route_t(int board)
Constructor with board number.
Definition ngcbIFC.hpp:101
ngcb_route_t()
Constructor.
Definition ngcbIFC.hpp:94
Definition ngcbIFC.hpp:393
ngcb_rtms_chan()
Constructor.
Definition ngcbIFC.hpp:416
int bits
Number of bits per sample.
Definition ngcbIFC.hpp:398
int enable
Enable channel.
Definition ngcbIFC.hpp:395
ngcb_chan_mudpi_t mudpi
RTMS channel MUDPI configuration.
Definition ngcbIFC.hpp:410
int shift
Bit shift.
Definition ngcbIFC.hpp:401
ngcb_chan_ip_t ip
RTMS channel IP configuration.
Definition ngcbIFC.hpp:407
ngcb_chan_rtms_t rtms
RTMS channel RTMS configuration.
Definition ngcbIFC.hpp:413
int src[4]
Enabled sources (0|1)
Definition ngcbIFC.hpp:404
Definition ngcbIFC.hpp:452
ngcb_rtms_chan chan[4]
RTMS channel configurations.
Definition ngcbIFC.hpp:454
ngcb_rtms_net net
RTMS network configuration.
Definition ngcbIFC.hpp:457
ngcb_rtms_if()
Constructor.
Definition ngcbIFC.hpp:460
Definition ngcbIFC.hpp:426
int ttl
IP time-to-live field.
Definition ngcbIFC.hpp:440
ngcb_rtms_net()
Constructor.
Definition ngcbIFC.hpp:446
int port
Source port.
Definition ngcbIFC.hpp:437
int ip
Local IP address.
Definition ngcbIFC.hpp:428
int subnet
Subnet mask.
Definition ngcbIFC.hpp:431
int gateway
Gateway.
Definition ngcbIFC.hpp:434
int ds
IP differentiated service field.
Definition ngcbIFC.hpp:443
Definition ngcbIFC.hpp:503
int dvld
SYNC with DataValid.
Definition ngcbIFC.hpp:511
ngcb_sctl_t()
Constructor.
Definition ngcbIFC.hpp:514
int size
Packet size.
Definition ngcbIFC.hpp:508
int fwd
Forward sync signal.
Definition ngcbIFC.hpp:505
Definition ngcbIFC.hpp:466
uint64_t start_sec
Schduled start time (seconds)
Definition ngcbIFC.hpp:474
uint64_t start_nsec
Scheduled start time (fractional nanoseconds)
Definition ngcbIFC.hpp:477
uint64_t period_sec
Schduled period (seconds)
Definition ngcbIFC.hpp:480
uint64_t sec
Current time (seconds)
Definition ngcbIFC.hpp:468
ngcb_tsu_t()
Constructor.
Definition ngcbIFC.hpp:492
uint64_t nsec
Current time (fractional nanoseconds)
Definition ngcbIFC.hpp:471
int status
Current TSU trigger status (read-back)
Definition ngcbIFC.hpp:489
uint64_t period_nsec
Scheduled period (fractional nanoseconds)
Definition ngcbIFC.hpp:483
int nshot
Number of trigger pulses (-1 = infinite)
Definition ngcbIFC.hpp:486