source: trunk/FACT++/src/HeadersFTM.h@ 11553

Last change on this file since 11553 was 11538, checked in by tbretz, 14 years ago
Added the variables for the light pulser settings in StaticData
File size: 23.3 KB
Line 
1#ifndef FACT_HeadersFTM
2#define FACT_HeadersFTM
3
4#include <ostream>
5
6// For debugging
7#include <iostream>
8
9#include "ByteOrder.h"
10
11// ====================================================================
12
13
14namespace FTM
15{
16 enum States
17 {
18 kFtmUndefined = 0,
19
20 // FTM internal states
21 kFtmIdle = 1, ///< Trigger output disabled, configuration possible
22 kFtmConfig = 2, ///< FTM and FTUs are being reconfigured
23 kFtmRunning = 3, ///< Trigger output enabled, configuration ignored
24 kFtmCalib = 4,
25 };
26
27 enum StateMachine
28 {
29 kDisconnected = 1, //ConnectionFTM::kDisconnected,
30 kConnected ,//= ConnectionFTM::kConnected,
31 kIdle ,//= ConnectionFTM::kIdle,
32 kTakingData ,//= ConnectionFTM::kTakingData,
33 kConfiguring1,
34 kConfiguring2,
35 kConfigured,
36
37 kConfigError1 = 0x101,
38 kConfigError2 = 0x102,
39
40 kCmdTest
41 };
42
43 /// Command codes for FTM communication
44 enum Commands
45 {
46 // First word
47 kCmdRead = 0x0001, ///< Request data
48 kCmdWrite = 0x0002, ///< Send data
49 kCmdStartRun = 0x0004, ///< Enable the trigger output
50 kCmdStopRun = 0x0008, ///< Disable the trigger output
51 kCmdPing = 0x0010, ///< Ping all FTUs (get FTU list)
52 kCmdCrateReset = 0x0020, ///< Reboot (no power cycle) all FTUs and FADs of one crate
53 kCmdDisableReports = 0x0040, ///< Disable transmission of rate-reports (dynamic data)
54 kCmdConfigFTU = 0x0080, ///< Configure single FTU board
55 kCmdToggleLed = 0xc000,
56
57 // second word for read and write
58 kCmdStaticData = 0x0001, ///< Specifies that static (configuration) data is read/written
59 kCmdDynamicData = 0x0002, ///< Specifies that dynamic data is read/written
60 kCmdRegister = 0x0004, ///< Specifies that a register is read/written
61
62 // second word for StartRun
63 kStartRun = 0x0001, ///< ...until kCmdStopRun
64 kTakeNevents = 0x0002, ///< ...fixed number of events
65
66 // second word for kCmdCrateReset
67 kResetCrate0 = 0x0001,
68 kResetCrate1 = 0x0002,
69 kResetCrate2 = 0x0004,
70 kResetCrate3 = 0x0008,
71 };
72
73
74 /// Types sent in the header of the following data
75 enum Types
76 {
77 kHeader = 0, ///< Local extension to identify a header in fCounter
78 kStaticData = 1, ///< Static (configuration) data
79 kDynamicData = 2, ///< Dynamic data (rates)
80 kFtuList = 3, ///< FTU list (answer of ping)
81 kErrorList = 4, ///< Error list (error when FTU communication failed)
82 kRegister = 5, ///< A requested register value
83 };
84
85 // --------------------------------------------------------------------
86
87 enum Delimiter
88 {
89 kDelimiterStart = 0xfb01, ///< Start delimiter send before each header
90 kDelimiterEnd = 0x04fe ///< End delimiter send after each data block
91 };
92
93 struct Header
94 {
95 uint16_t fDelimiter; ///< Start delimiter
96 uint16_t fType; ///< Type of the data to be received after the header
97 uint16_t fDataSize; ///< Size in words to be received after the header (incl end delim.)
98 uint16_t fState; ///< State of the FTM central state machine
99 uint64_t fBoardId; ///< FPGA device DNA (unique chip id)
100 uint16_t fFirmwareId; ///< Version number
101 uint32_t fTriggerCounter; ///< FTM internal counter of all trigger decision independant of trigger-line enable/disable (reset: start/stop run)
102 uint64_t fTimeStamp; ///< Internal counter (micro-seconds, reset: start/stop run)
103
104 Header() { init(*this); }
105
106 std::vector<uint16_t> HtoN() const
107 {
108 Header h(*this);
109
110 Reverse(&h.fBoardId);
111 Reverse(&h.fTriggerCounter);
112 Reverse(&h.fTimeStamp);
113
114 return htoncpy(h);
115 }
116 void operator=(const std::vector<uint16_t> &vec)
117 {
118 ntohcpy(vec, *this);
119
120 Reverse(&fBoardId);
121 Reverse(&fTriggerCounter);
122 Reverse(&fTimeStamp);
123 }
124
125 void clear() { reset(*this); }
126 void print(std::ostream &out) const;
127
128 } __attribute__((__packed__));
129
130 struct DimPassport
131 {
132 uint64_t fBoardId;
133 uint16_t fFirmwareId;
134
135 DimPassport(const Header &h) :
136 fBoardId(h.fBoardId),
137 fFirmwareId(h.fFirmwareId)
138 {
139 }
140 } __attribute__((__packed__));
141
142 struct DimTriggerCounter
143 {
144 uint64_t fTimeStamp;
145 uint32_t fTriggerCounter;
146
147 DimTriggerCounter(const Header &h) :
148 fTimeStamp(h.fTimeStamp),
149 fTriggerCounter(h.fTriggerCounter)
150 {
151 }
152 } __attribute__((__packed__));
153
154
155 struct StaticDataBoard
156 {
157 uint16_t fEnable[4]; /// enable of 4x9 pixels coded as 4x9bits
158 uint16_t fDAC[5]; /// 0-3 (A-D) Threshold of patches, 4 (H) Threshold for N out of 4 (12 bit each)
159 uint16_t fPrescaling; /// Internal readout time of FTUs for trigger counter
160
161 StaticDataBoard() { init(*this); }
162
163 void print(std::ostream &out) const;
164
165 } __attribute__((__packed__));
166
167 struct StaticData
168 {
169 enum Limits
170 {
171 kMaxMultiplicity = 40, ///< Minimum required trigger multiplicity
172 kMaxWindow = 0xf, ///< (4ns * x + 8ns) At least N (multiplicity) rising edges (trigger signal) within this window
173 kMaxDeadTime = 0xffff, ///< (4ns * x + 8ns)
174 kMaxDelayTimeMarker = 0x3ff, ///< (4ns * x + 8ns)
175 kMaxDelayTrigger = 0x3ff, ///< (4ns * x + 8ns)
176 kMaxTriggerInterval = 0x3ff, ///<
177 kMaxSequence = 0x1f,
178 kMaxDAC = 0xfff,
179 kMaxAddr = 0xfff,
180 kMaxPatchIdx = 159,
181 kMaxPixelIdx = 1439,
182 kMaskSettings = 0xf,
183 kMaskLEDs = 0xf,
184 };
185
186 enum GeneralSettings
187 {
188 kTrigger = 0x80, ///< Physics trigger decision (PhysicTrigger)
189 kPedestal = 0x40, ///< Pedestal trigger (artifical)
190 kLPint = 0x20, ///< Enable artificial trigger after light pulse (LP2)
191 kLPext = 0x10, ///< Enable trigger decision after light pulse (CalibrationTrigger, LP1)
192 kExt2 = 0x08, ///< External trigger signal 2
193 kExt1 = 0x04, ///< External trigger signal 1
194 kVeto = 0x02, ///< Veto trigger decision / artifical triggers
195 kClockConditioner = 0x01, ///< Select clock conditioner frequency (1) / time marker (0) as output
196 };
197
198 enum LightPulserEnable
199 {
200 kGroup1 = 0x4,
201 kGroup2 = 0x8,
202 };
203
204 uint16_t fGeneralSettings; /// Enable for different trigger types / select for TIM/ClockConditioner output (only 8 bit used)
205 uint16_t fStatusLEDs; /// only 8 bit used
206 uint16_t fTriggerInterval; /// [ms] Interval between two artificial triggers (no matter which type) minimum 1ms, 10 bit
207 uint16_t fTriggerSequence; /// Ratio between trigger types send as artificial trigger (in this order) 3x5bit
208 uint8_t fEnableLpExt; /// Enable for LED group 1/2 (LightPulserEnable)
209 uint8_t fIntensityLpExt; /// Intensity of LEDs (0-127)
210 uint8_t fEnableLpInt; /// Enable for LED group 1/2 (LightPulserEnable)
211 uint8_t fIntensityLpInt; /// Intensity of LEDs (0-127)
212 uint32_t fDummy0;
213 uint16_t fMultiplicityPhysics; /// Required trigger multiplicity for physcis triggers (0-40)
214 uint16_t fMultiplicityCalib; /// Required trigger multiplicity calibration (LPext) triggers (0-40)
215 uint16_t fDelayTrigger; /// (4ns * x + 8ns) FTM internal programmable delay between trigger decision and output
216 uint16_t fDelayTimeMarker; /// (4ns * x + 8ns) FTM internal programmable delay between trigger descision and time marker output
217 uint16_t fDeadTime; /// (4ns * x + 8ns) FTM internal programmable dead time after trigger decision
218 uint32_t fClockConditioner[8]; /// R0, R1, R8, R9, R11, R13, R14, R15
219 uint16_t fWindowPhysics; /// (4ns * x + 8ns) At least N (multiplicity) rising edges (trigger signal) within this window
220 uint16_t fWindowCalib; /// (4ns * x + 8ns) At least N (multiplicity) rising edges (trigger signal) within this window
221 uint16_t fDummy1;
222
223 StaticDataBoard fBoard[4][10]; // 4 crates * 10 boards (Crate0/FTU0 == readout time of FTUs)
224
225 uint16_t fActiveFTU[4]; // 4 crates * 10 bits (FTU enable)
226
227 StaticData() { init(*this); }
228 StaticData(const std::vector<uint16_t> &vec)
229 {
230 ntohcpy(vec, *this);
231
232 for (int i=0; i<8; i++)
233 Reverse(fClockConditioner+i);
234 }
235
236 std::vector<uint16_t> HtoN() const
237 {
238 StaticData d(*this);
239 for (int i=0; i<8; i++)
240 Reverse(d.fClockConditioner+i);
241
242 return htoncpy(d);
243 }
244
245 bool operator==(const StaticData &d) const
246 {
247 return memcmp(this, &d, sizeof(StaticData))==0;
248 }
249
250 void clear() { reset(*this); }
251 void print(std::ostream &out) const;
252
253 StaticDataBoard &operator[](int i) { return fBoard[i/10][i%10]; }
254 const StaticDataBoard &operator[](int i) const { return fBoard[i/10][i%10]; }
255
256 void EnableFTU(int i) { fActiveFTU[i/10] |= (1<<(i%10)); }
257 void DisableFTU(int i) { fActiveFTU[i/10] &= ~(1<<(i%10)); }
258
259 void EnableAllFTU() { for (int i=0; i<4; i++) fActiveFTU[i] = 0x3ff; }
260 void DisableAllFTU() { for (int i=0; i<4; i++) fActiveFTU[i] = 0; }
261
262 void ToggleFTU(int i) { fActiveFTU[i/10] ^= (1<<(i%10)); }
263
264 void Enable(GeneralSettings type, bool enable)
265 {
266 if (enable)
267 fGeneralSettings |= uint16_t(type);
268 else
269 fGeneralSettings &= ~uint16_t(type); }
270
271 bool IsEnabled(GeneralSettings type) const { return fGeneralSettings&uint16_t(type); }
272
273 uint16_t *EnablePixel(int idx, bool enable)
274 {
275 const int pixel = idx%9;
276 const int patch = (idx/9)%4;
277 const int board = (idx/9)/4;
278
279 uint16_t &pix = fBoard[board/10][board%10].fEnable[patch];
280
281 if (enable)
282 pix |= (1<<pixel);
283 else
284 pix &= ~(1<<pixel);
285
286 return &pix;
287 }
288
289 void EnableAllPixel()
290 {
291 for (int c=0; c<4; c++)
292 for (int b=0; b<10; b++)
293 for (int p=0; p<4; p++)
294 fBoard[c][b].fEnable[p] = 0x1ff;
295 }
296
297 bool Enabled(uint16_t idx) const
298 {
299 const int pixel = idx%9;
300 const int patch = (idx/9)%4;
301 const int board = (idx/9)/4;
302
303 return (fBoard[board/10][board%10].fEnable[patch]>>pixel)&1;
304 }
305
306 uint8_t GetSequencePed() const { return (fTriggerSequence>>10)&0x1f; }
307 uint8_t GetSequenceLPint() const { return (fTriggerSequence>> 5)&0x1f; }
308 uint8_t GetSequenceLPext() const { return (fTriggerSequence) &0x1f; }
309
310 void SetSequence(uint8_t ped, uint8_t lpint, uint8_t lpext)
311 {
312 fTriggerSequence = ((ped&0x1f)<<10)|((lpint&0x1f)<<5)|(lpext&0x1f);
313
314 Enable(kPedestal, ped >0);
315 Enable(kLPext, lpext>0);
316 Enable(kLPint, lpint>0);
317 }
318
319 void SetClockRegister(const uint64_t reg[])
320 {
321 for (int i=0; i<8; i++)
322 fClockConditioner[i] = reg[i];
323 }
324
325 void SetPrescaling(uint16_t val)
326 {
327 for (int c=0; c<4; c++)
328 for (int b=0; b<10; b++)
329 fBoard[c][b].fPrescaling = val;
330 }
331
332 } __attribute__((__packed__));
333
334 // DimStructures must be a multiple of two... I don't know why
335 struct DimStaticData
336 {
337 uint64_t fTimeStamp;
338 //8
339 uint16_t fGeneralSettings; // only 8 bit used
340 uint16_t fStatusLEDs; // only 8 bit used
341 uint64_t fActiveFTU; // 40 bits in row
342 //20
343 uint16_t fTriggerInterval; // only 10 bit used
344 //22
345 uint16_t fTriggerSeqLPint; // only 5bits used
346 uint16_t fTriggerSeqLPext; // only 5bits used
347 uint16_t fTriggerSeqPed; // only 5bits used
348 //28
349 uint16_t fMultiplicityPhysics; // 0-40
350 uint16_t fMultiplicityCalib; // 0-40
351 //32
352 uint16_t fWindowPhysics;
353 uint16_t fWindowCalib;
354 //36
355 uint16_t fDelayTrigger;
356 uint16_t fDelayTimeMarker;
357 uint32_t fDeadTime;
358 //44
359 uint32_t fClockConditioner[8];
360 //60
361 uint16_t fEnable[90]; // 160*9bit = 180byte
362 uint16_t fThreshold[160];
363 uint16_t fMultiplicity[40]; // N out of 4
364 uint16_t fPrescaling[40];
365 // 640+60 = 700
366
367 bool HasTrigger() const { return fGeneralSettings & StaticData::kTrigger; }
368 bool HasPedestal() const { return fGeneralSettings & StaticData::kPedestal; }
369 bool HasLPext() const { return fGeneralSettings & StaticData::kLPext; }
370 bool HasLPint() const { return fGeneralSettings & StaticData::kLPint; }
371 bool HasExt2() const { return fGeneralSettings & StaticData::kExt2; }
372 bool HasExt1() const { return fGeneralSettings & StaticData::kExt1; }
373 bool HasVeto() const { return fGeneralSettings & StaticData::kVeto; }
374 bool HasClockConditioner() const { return fGeneralSettings & StaticData::kClockConditioner; }
375
376 bool IsActive(int i) const { return fActiveFTU&(uint64_t(1)<<i); }
377 bool IsEnabled(int i) const { return fEnable[i/16]&(1<<(i%16)); }
378
379 DimStaticData() { memset(this, 0, sizeof(DimStaticData)); }
380
381 DimStaticData(const Header &h, const StaticData &d) :
382 fTimeStamp(h.fTimeStamp),
383 fGeneralSettings(d.fGeneralSettings),
384 fStatusLEDs(d.fStatusLEDs),
385 fActiveFTU( uint64_t(d.fActiveFTU[0]) |
386 (uint64_t(d.fActiveFTU[1])<<10) |
387 (uint64_t(d.fActiveFTU[2])<<20) |
388 (uint64_t(d.fActiveFTU[3])<<30)),
389 fTriggerInterval(d.fTriggerInterval),
390 fTriggerSeqLPint((d.fTriggerSequence>>5)&0x1f),
391 fTriggerSeqLPext((d.fTriggerSequence)&0x1f),
392 fTriggerSeqPed((d.fTriggerSequence>>10)&0x1f),
393 fMultiplicityPhysics(d.fMultiplicityPhysics),
394 fMultiplicityCalib(d.fMultiplicityCalib),
395 fWindowPhysics(d.fWindowPhysics*4+8),
396 fWindowCalib(d.fWindowCalib*4+8),
397 fDelayTrigger(d.fDelayTrigger*4+8),
398 fDelayTimeMarker(d.fDelayTimeMarker*4+8),
399 fDeadTime(uint32_t(d.fDeadTime)*4+8)
400 {
401 memcpy(fClockConditioner, d.fClockConditioner, sizeof(uint32_t)*8);
402
403 uint16_t src[160];
404 for (int i=0; i<40; i++)
405 {
406 for (int j=0; j<4; j++)
407 {
408 src[i*4+j] = d[i].fEnable[j];
409 fThreshold[i*4+j] = d[i].fDAC[j];
410 }
411
412 fMultiplicity[i] = d[i].fDAC[4];
413 fPrescaling[i] = d[i].fPrescaling+1;
414 }
415 bitcpy(fEnable, 90, src, 160, 9);
416 }
417
418 } __attribute__((__packed__));
419
420
421 struct DynamicDataBoard
422 {
423 uint32_t fRatePatch[4]; // Patch 0,1,2,3
424 uint32_t fRateTotal; // Sum
425
426 uint16_t fOverflow; // Patches: bits 0-3, total 4
427 uint16_t fCrcError;
428
429 void print(std::ostream &out) const;
430
431 void reverse()
432 {
433 for (int i=0; i<4; i++)
434 Reverse(fRatePatch+i);
435
436 Reverse(&fRateTotal);
437 }
438
439 uint32_t &operator[](int i) { return fRatePatch[i]; }
440
441 } __attribute__((__packed__));
442
443
444 struct DynamicData
445 {
446 uint64_t fOnTimeCounter;
447 uint16_t fTempSensor[4]; // U45, U46, U48, U49
448
449 DynamicDataBoard fBoard[4][10]; // 4 crates * 10 boards
450
451 DynamicData() { init(*this); }
452
453 std::vector<uint16_t> HtoN() const
454 {
455 DynamicData d(*this);
456
457 Reverse(&d.fOnTimeCounter);
458
459 for (int c=0; c<4; c++)
460 for (int b=0; b<10; b++)
461 d.fBoard[c][b].reverse();
462
463 return htoncpy(d);
464 }
465
466 void operator=(const std::vector<uint16_t> &vec)
467 {
468 ntohcpy(vec, *this);
469
470 Reverse(&fOnTimeCounter);
471
472 for (int c=0; c<4; c++)
473 for (int b=0; b<10; b++)
474 fBoard[c][b].reverse();
475 }
476
477 void clear() { reset(*this); }
478 void print(std::ostream &out) const;
479
480 DynamicDataBoard &operator[](int i) { return fBoard[i/10][i%10]; }
481 const DynamicDataBoard &operator[](int i) const { return fBoard[i/10][i%10]; }
482
483 } __attribute__((__packed__));
484
485
486 struct DimDynamicData
487 {
488 uint64_t fTimeStamp;
489
490 uint64_t fOnTimeCounter;
491 float fTempSensor[4];
492
493 uint32_t fRatePatch[160];
494
495 uint32_t fRateBoard[40];
496 uint16_t fRateOverflow[40];
497
498 uint16_t fCrcError[40];
499
500 DimDynamicData(const Header &h, const DynamicData &d) :
501 fTimeStamp(h.fTimeStamp),
502 fOnTimeCounter(d.fOnTimeCounter)
503 {
504 for (int i=0; i<4; i++)
505 fTempSensor[i] = d.fTempSensor[i];
506
507 for (int i=0; i<40; i++)
508 {
509 fRateBoard[i] = d[i].fRateTotal;
510 fRateOverflow[i] = d[i].fOverflow;
511 fCrcError[i] = d[i].fCrcError;
512 for (int j=0; j<4; j++)
513 fRatePatch[i*4+j] = d[i].fRatePatch[j];
514 }
515 }
516
517 } __attribute__((__packed__));
518
519
520 struct FtuResponse
521 {
522 uint16_t fPingAddr; // Number of Pings and addr (pings= see error)
523 uint64_t fDNA;
524 uint16_t fErrorCounter; //
525
526 void reverse() { Reverse(&fDNA); }
527
528 void print(std::ostream &out) const;
529
530 } __attribute__((__packed__));
531
532 struct FtuList
533 {
534 uint16_t fNumBoards; /// Total number of boards responded
535 uint16_t fNumBoardsCrate[4]; /// Num of board responded in crate 0-3
536 uint16_t fActiveFTU[4]; /// List of active FTU boards in crate 0-3
537
538 FtuResponse fFTU[4][10];
539
540 FtuList() { init(*this); }
541
542 std::vector<uint16_t> HtoN() const
543 {
544 FtuList d(*this);
545
546 for (int c=0; c<4; c++)
547 for (int b=0; b<10; b++)
548 d.fFTU[c][b].reverse();
549
550 return htoncpy(d);
551 }
552
553 void operator=(const std::vector<uint16_t> &vec)
554 {
555 ntohcpy(vec, *this);
556
557 for (int c=0; c<4; c++)
558 for (int b=0; b<10; b++)
559 fFTU[c][b].reverse();
560 }
561
562 void clear() { reset(*this); }
563 void print(std::ostream &out) const;
564
565 FtuResponse &operator[](int i) { return fFTU[i/10][i%10]; }
566 const FtuResponse &operator[](int i) const { return fFTU[i/10][i%10]; }
567
568 } __attribute__((__packed__));
569
570 struct DimFtuList
571 {
572 uint64_t fTimeStamp;
573 uint64_t fActiveFTU;
574
575 uint16_t fNumBoards; /// Number of boards answered in total
576 uint8_t fNumBoardsCrate[4]; /// Number of boards answered per crate
577
578 uint64_t fDNA[40]; /// DNA of FTU board
579 uint8_t fAddr[40]; /// Address of FTU board
580 uint8_t fPing[40]; /// Number of pings until response (same as in Error)
581
582 DimFtuList(const Header &h, const FtuList &d) :
583 fTimeStamp(h.fTimeStamp),
584 fActiveFTU( uint64_t(d.fActiveFTU[0]) |
585 (uint64_t(d.fActiveFTU[1])<<10) |
586 (uint64_t(d.fActiveFTU[2])<<20) |
587 (uint64_t(d.fActiveFTU[3])<<30)),
588 fNumBoards(d.fNumBoards)
589 {
590 for (int i=0; i<4; i++)
591 fNumBoardsCrate[i] = d.fNumBoardsCrate[i];
592
593 for (int i=0; i<40; i++)
594 {
595 fDNA[i] = d[i].fDNA;
596 fAddr[i] = d[i].fPingAddr&0x3f;
597 fPing[i] = (d[i].fPingAddr>>8)&0x3;
598 }
599 }
600
601 bool IsActive(int i) const { return fActiveFTU&(uint64_t(1)<<i); }
602
603 } __attribute__((__packed__));
604
605
606 struct Error
607 {
608 uint16_t fNumCalls; // 0=error, >1 needed repetition but successfull
609
610 uint16_t fDelimiter;
611 uint16_t fDestAddress;
612 uint16_t fSrcAddress;
613 uint16_t fFirmwareId;
614 uint16_t fCommand;
615 uint16_t fData[21];
616 uint16_t fCrcErrorCounter;
617 uint16_t fCrcCheckSum;
618
619 Error() { init(*this); }
620
621 std::vector<uint16_t> HtoN() const
622 {
623 return htoncpy(*this);
624 }
625
626 void operator=(const std::vector<uint16_t> &vec) { ntohcpy(vec, *this); }
627
628 void clear() { reset(*this); }
629
630 uint16_t &operator[](int idx) { return fData[idx]; }
631 const uint16_t &operator[](int idx) const { return fData[idx]; }
632
633 void print(std::ostream &out) const;
634
635 } __attribute__((__packed__));
636
637 struct DimError
638 {
639 uint64_t fTimeStamp;
640 Error fError;
641
642 DimError(const Header &h, const Error &e) :
643 fTimeStamp(h.fTimeStamp),
644 fError(e)
645 {
646 fError.fDestAddress = (e.fDestAddress&0x3)*10 + ((e.fDestAddress>>2)&0xf);
647 fError.fSrcAddress = (e.fSrcAddress &0x3)*10 + ((e.fSrcAddress >>2)&0xf);
648 }
649
650 } __attribute__((__packed__));
651
652 /*
653 struct Command
654 {
655 uint16_t fStartDelimiter;
656 uint16_t fCommand;
657 uint16_t fParam[3];
658
659 Command() { init(*this); }
660
661 void HtoN() { hton(*this); }
662 void NtoH() { ntoh(*this); }
663
664 void operator=(const std::vector<uint16_t> &vec) { ntohcpy(vec, *this); }
665
666 void clear() { reset(*this); }
667
668
669 } __attribute__((__packed__));
670 */
671
672 // --------------------------------------------------------------------
673
674 inline std::ostream &operator<<(std::ostream &out, const FtuResponse &h)
675 {
676 h.print(out);
677 return out;
678 }
679
680 inline std::ostream &operator<<(std::ostream &out, const Header &h)
681 {
682 h.print(out);
683 return out;
684 }
685
686
687 inline std::ostream &operator<<(std::ostream &out, const FtuList &h)
688 {
689 h.print(out);
690 return out;
691 }
692
693 inline std::ostream &operator<<(std::ostream &out, const DynamicDataBoard &h)
694 {
695 h.print(out);
696 return out;
697 }
698
699 inline std::ostream &operator<<(std::ostream &out, const DynamicData &h)
700 {
701 h.print(out);
702 return out;
703 }
704
705 inline std::ostream &operator<<(std::ostream &out, const StaticDataBoard &h)
706 {
707 h.print(out);
708 return out;
709 }
710
711 inline std::ostream &operator<<(std::ostream &out, const StaticData &h)
712 {
713 h.print(out);
714 return out;
715 }
716
717 inline std::ostream &operator<<(std::ostream &out, const Error &h)
718 {
719 h.print(out);
720 return out;
721 }
722};
723
724#endif
Note: See TracBrowser for help on using the repository browser.