FACT++  1.0
int StateMachineMCP::HandleFadConnections ( const EventImp d)
inlineprivate

Definition at line 55 of file mcp.cc.

References EventImp::GetSize(), i, EventImp::Ptr(), and reset().

Referenced by StateMachineMCP().

56  {
57  if (d.GetSize()!=41)
58  return GetCurrentState();
59 
60  const uint8_t *ptr = d.Ptr<uint8_t>();
61 
62  fNumConnectedFad = 0;
63  fFadConnected.assign(40, false);
64 
65  vector<bool> reset(4);
66 
67  for (int i=0; i<40; i++)
68  {
69  const uint8_t stat1 = ptr[i]&3;
70  const uint8_t stat2 = ptr[i]>>3;
71 
72  // disconnected: ignore
73  if (stat1==0 && stat2==0)
74  continue;
75 
76  fFadConnected[i] = true;
77 
78  if (stat1>=2 && stat2==8)
79  fNumConnectedFad++;
80 
81  // Does not need reset
82  if (stat1>2 && stat2==8)
83  continue;
84 
85  // Not configured (stat1==2?kLedGreen:kLedGreenCheck)
86  // Connection problem (stat1==1&&stat2==1?kLedRed:kLedOrange)
87  reset[i/10] = true;
88  }
89  return GetCurrentState();
90  }
int GetCurrentState() const
return the current state of the machine
int i
Definition: db_dim_client.c:21
vector< bool > fFadConnected
Definition: mcp.cc:34
uint16_t fNumConnectedFad
Definition: mcp.cc:41
void reset(S &s)
Definition: ByteOrder.h:13
const T * Ptr(size_t offset=0) const
Definition: EventImp.h:74
virtual size_t GetSize() const
Definition: EventImp.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function: