#include <ngcbIFC.hpp>
Public Member Functions | |
| ngcbIFC () | |
| Constructor without device name. | |
| ngcbIFC (const char *name) | |
| Constructor with device name. | |
| virtual | ~ngcbIFC () |
| Destructor. | |
| char * | ErrMsg () |
| Pointer to last error message. | |
| void | ErrState (const char *msg, int errorId=0, void *origin=NULL) |
| Go to error state with error message. | |
| void | Result2Err (char *s, int resultCode) |
| Convert result code to error string. | |
| void | Verbose (const char *format,...) __attribute__((format(printf |
| Verbose message. | |
| void void | Log (const char *format,...) __attribute__((format(printf |
| Log message. | |
| void void const char * | SofwVersion () |
| Software version. | |
| char * | Name () |
| Device name. | |
| char * | Type () |
| Interface type. | |
| char * | Arg () |
| Driver interface process arguments. | |
| int | Instance () |
| Get interface instance. | |
| void | Instance (int instance) |
| Set interface instance. | |
| int | Open () |
| Open interface with current name. | |
| void | DefaultTimeout (int seconds) |
| Set default timeout. | |
| int | SetTime (double time=0.0) |
| Set device time (seconds since UNIX epoch, time <= 0.0 sets system time). | |
| int | BigEndian () |
| Get endianess. | |
| int | SyncFwd (int flag) |
| Forward SYNC signal. | |
| int | SyncWithData (int flag) |
| SYNC with data-valid. | |
| int | SyncSize (int size) |
| Set SYNC packet size. | |
| int | Configure (const char *s) |
| Configure interface device via interface setup identification string. | |
| int | Configure () |
| Configure interface according to give device setup. | |
| const char * | Setup () |
| Return actual interface setup identification string. | |
| int | Standby () |
| Bring interface to STANDBY state. | |
| int | Online () |
| Bring interface to ONLINE state. | |
| int | Off () |
| Bring interface to OFF state. | |
| int | PythonTask (const char *script) |
| Execute Python task. | |
| int | ReadAddr (const ngcb_route_t &route, int addr, int *buffer, int size) |
| Read from address. | |
| int | WriteAddr (const ngcb_route_t &route, int addr, const int *buffer, int size) |
| Write to address. | |
| int | WriteBuffer (const int *buffer, int size, int *result) |
| Write formatted buffer to device. | |
| int | Event (ngcbEVT *evt) |
| Activate device event. | |
| int | ReadAddr (int addr, int *buffer, int size=1) |
| Read buffer from first board. | |
| int | WriteAddr (int addr, const int *buffer, int size) |
| Write buffer to first board. | |
| int | WriteAddr (int addr, int value) |
| Write to register on first board. | |
| int | ReadAddr64 (const ngcb_route_t &route, int addr, uint64_t *buffer, int size) |
| 64-bit read | |
| int | WriteAddr64 (const ngcb_route_t &route, int addr, const uint64_t *buffer, int size) |
| 64-bit write | |
| int | ReadAddr64 (int addr, uint64_t *buffer, int size=1) |
| Read 64-bit buffer from first board. | |
| int | WriteAddr64 (int addr, const uint64_t *buffer, int size) |
| Write 64-bit buffer to first board. | |
| int | WriteAddr64 (int addr, uint64_t value) |
| Write to 64-bit register on first board. | |
| int | CheckEvent (ngcbEVT *evt, int *result) |
| Check if device event conditions are met. | |
| int | Wait (ngcbEVT *evt, int interval, int *result) |
| Wait for event. | |
| void | Poll () |
| Poll event list. | |
| int | SetChanIp (int idx, ngcb_chan_ip_t ip) |
| Set RTMS channel IP configuration. | |
| int | SetChanMudpi (int idx, ngcb_chan_mudpi_t mudpi) |
| Set RTMS channel MUDPI configuration. | |
| int | SetChanRtms (int idx, ngcb_chan_rtms_t rtms) |
| Set RTMS channel RTMS configuration. | |
| int | SetRtmsNet (ngcb_rtms_net net) |
| Set RTMS common parameters. | |
| int | GetChanIp (int idx, ngcb_chan_ip_t *ip) |
| Get RTMS channel IP configuration. | |
| int | GetChanMudpi (int idx, ngcb_chan_mudpi_t *mudpi) |
| Get RTMS channel MUDPI configuration. | |
| int | GetChanRtms (int idx, ngcb_chan_rtms_t *rtms) |
| Get RTMS channel RTMS configuration. | |
| int | GetRtmsNet (ngcb_rtms_net *net) |
| Get RTMS common parameters. | |
| int | SetChanEnable (int idx, int flag) |
| Enable/disable RTMS channel. | |
| int | GetChanEnable (int idx, int *flag) |
| Get RTMS channel status (enabled/disabled) | |
| int | SetChanSrc (int idx, int src=0, int flag=-1) |
| Enable/disable channel source. | |
| int | GetChanSrc (int idx, int src, int *flag) |
| Get enabled-flag per source and channel. | |
| int | GetChanDrop (int idx, int src, int *flag) |
| Get channel source drop flag. | |
| int | ClearChanDrop (int idx) |
| Clear channel drop flags. | |
| int | SetChanBits (int idx, int bits) |
| Set number of enabled bits on channel. | |
| int | GetChanBits (int idx, int *bits) |
| Get number of enabled bits on channel. | |
| int | SetChanShift (int idx, int shift) |
| Set channel bit shift. | |
| int | GetChanShift (int idx, int *shift) |
| Get channel bit shift. | |
| virtual int | Fd () |
| Return device file descriptor. | |
| virtual int | Pid () |
| Driver interface process id. | |
| virtual int | Port () |
| Driver interface process command port. | |
| virtual const char * | Host () |
| Driver interface process host. | |
| virtual int | Sim (int level) |
| Set simulation level. | |
| virtual int | Open (const char *name) |
| Open interface by name. | |
| virtual int | Close () |
| Close interface. | |
| virtual int | Connect () |
| Connect through to device. | |
| virtual int | Disconnect () |
| Disconnect from device. | |
| virtual int | Ping () |
| Ping device. | |
| virtual void | Keeper (int seconds) |
| Set line keeper interval (seconds) | |
| virtual int | Reset () |
| Reset device. | |
| virtual int | Timeout (int seconds) |
| Set timeout. | |
| virtual int | Timeout () |
| Get timeout. | |
| virtual int | SetTime (uint64_t sec, uint64_t nsec) |
| Set device time (seconds and nanoseconds since UNIX epoch) | |
| virtual void | RpcCopy (void *dest, const void *src, size_t size, size_t items) |
| Copy RPC payload. | |
| virtual int | Str2Payload (const char *cmd, unsigned char *payload, unsigned int max, char *erms) |
| Parse string to RPC payload. | |
| virtual int | RPC (int mod, int target, int req, void *payload, unsigned int size, unsigned int *status) |
| RPC. | |
| virtual int | Read (int *buffer, int size) |
| Read buffer from device. | |
| virtual int | Write (const int *buffer, int size) |
| Write buffer to device. | |
| virtual int | ReadAddr (ngcb_route_t route, int addr, int *buffer, int size, int *result) |
| Read from address. | |
| virtual int | WriteAddr (ngcb_route_t route, int addr, const int *buffer, int size, int *result) |
| Write to address. | |
| virtual int | Event (ngcbEVT *evt, int *result) |
| Activate device event. | |
| virtual int | Status (int *devStatus) |
| Get communication status. | |
| virtual int | ExecServer () |
| Launch driver interface process. | |
| virtual int | KillServer () |
| Terminate driver interface process. | |
| virtual int | Running () |
| Driver interface process is running. | |
| virtual int | Connected () |
| Connected to device. | |
| virtual int | HandleFdEvt () |
| Handle event on file descriptor. | |
| virtual ClientConnection * | GetConnection () |
| Get client connection. | |
| virtual int | TsuStartAt (uint64_t sec, uint64_t nsec) |
| virtual int | TsuStart () |
| Start TSU trigger immediatly. | |
| virtual int | TsuStop () |
| Stop TSU trigger. | |
| virtual int | TsuTrigger () |
| Manual TSU trigger. | |
| virtual int | TsuSnapshot () |
| Take TSU snapshot. | |
| virtual int | TsuStatus (int *value) |
| Get TSU status. | |
| virtual int | TsuConfig (ngcb_tsu_t *cfg) |
| Get TSU configuration. | |
| virtual int | TsuRunning () |
| virtual int | _ReadAddr (ngcb_route_t route, int addr, int *buffer, int size, int *result) |
| Read from address. | |
| virtual int | _WriteAddr (ngcb_route_t route, int addr, const int *buffer, int size, int *result) |
| Write to adress. | |
Public Attributes | |
| FILE * | watchdog |
| External watchdog stream. | |
| ngcbSERVICE * | services |
| System services. | |
| int | ioError |
| Indicates an i/o error. | |
| int | local |
| Interface is local. | |
| char | thisHost [64] |
| Host where this instance is launched. | |
| int | netTimeout |
| Network timeout (seconds) | |
| int | keeper |
| Line keeper interval (seconds) | |
| int | sideLink |
| Connected through sidelink. | |
| int | backPlane |
| Back-plane id. | |
| int | master |
| Index of master device. | |
| int | skip |
| Number of route nodes to skip. | |
| int | chain |
| Chain length from last skipped node to DFE. | |
| ngcb_route_t | cfgRoute |
| Configuration route. | |
| int | serNo1 |
| Interface board serial number part one. | |
| int | serNo2 |
| Interface board serial number part two. | |
| int | id |
| ID-register content. | |
| int | type |
| Board type. | |
| int | version |
| Board version (sub-type) | |
| int | revision |
| Hardware revision. | |
| int | firmware |
| Firmware revision. | |
| int | protocol |
| Incremental protovol id. | |
| ngcb_sctl_t | sync |
| SYNC signal control. | |
| ngcb_rtms_cfg_t | rtms |
| RTMS configuration (WFS) | |
| ngcb_rtms_if | rtmsIf |
| RTMS interface (NGCII) | |
| ngcb_tsu_t | tsu |
| TSU configuration. | |
| int | tsuCtrl |
| Enable/disable automatic start/stop of the TSU. | |
| int | sim |
| Interface simulation level. | |
| int | xterm |
| Start in new terminal. | |
| int | verboseLevel |
| Verbose level. | |
| int | logLevel |
| Logging level. | |
| int | translate |
| RPC payload translation method. | |
| ngcbLIST | evtList |
| Device event list. | |
Protected Member Functions | |
| virtual int | SetupCB (const char *buffer) |
| Setup call-back. | |
NGC Interface class
| ngcbIFC::ngcbIFC | ( | ) |
Constructor without device name.
|
explicit |
Constructor with device name.
|
virtual |
Destructor.
|
virtual |
Read from address.
Reimplemented in ngcbIFC2.
|
virtual |
Write to adress.
Reimplemented in ngcbIFC2.
| char * ngcbIFC::Arg | ( | ) |
Driver interface process arguments.
| int ngcbIFC::BigEndian | ( | ) |
Get endianess.
| int ngcbIFC::CheckEvent | ( | ngcbEVT * | evt, |
| int * | result ) |
Check if device event conditions are met.
| int ngcbIFC::ClearChanDrop | ( | int | idx | ) |
Clear channel drop flags.
|
virtual |
Close interface.
Reimplemented in ngcbIFC2, ngcbIFC3, and ngcbIFC_TCP.
| int ngcbIFC::Configure | ( | ) |
Configure interface according to give device setup.
| int ngcbIFC::Configure | ( | const char * | s | ) |
Configure interface device via interface setup identification string.
|
virtual |
Connect through to device.
Reimplemented in ngcbIFC2, and ngcbIFC_TCP.
|
virtual |
Connected to device.
Reimplemented in ngcbIFC2, ngcbIFC3, and ngcbIFC_TCP.
| void ngcbIFC::DefaultTimeout | ( | int | seconds | ) |
Set default timeout.
|
virtual |
Disconnect from device.
Reimplemented in ngcbIFC2, and ngcbIFC_TCP.
| char * ngcbIFC::ErrMsg | ( | ) |
Pointer to last error message.
| void ngcbIFC::ErrState | ( | const char * | msg, |
| int | errorId = 0, | ||
| void * | origin = NULL ) |
Go to error state with error message.
| int ngcbIFC::Event | ( | ngcbEVT * | evt | ) |
Activate device event.
|
virtual |
Activate device event.
Reimplemented in ngcbIFC_TCP.
|
virtual |
Launch driver interface process.
Reimplemented in ngcbIFC_TCP.
|
virtual |
Return device file descriptor.
Reimplemented in ngcbIFC2, ngcbIFC3, and ngcbIFC_TCP.
| int ngcbIFC::GetChanBits | ( | int | idx, |
| int * | bits ) |
Get number of enabled bits on channel.
| int ngcbIFC::GetChanDrop | ( | int | idx, |
| int | src, | ||
| int * | flag ) |
Get channel source drop flag.
| int ngcbIFC::GetChanEnable | ( | int | idx, |
| int * | flag ) |
Get RTMS channel status (enabled/disabled)
| int ngcbIFC::GetChanIp | ( | int | idx, |
| ngcb_chan_ip_t * | ip ) |
Get RTMS channel IP configuration.
| int ngcbIFC::GetChanMudpi | ( | int | idx, |
| ngcb_chan_mudpi_t * | mudpi ) |
Get RTMS channel MUDPI configuration.
| int ngcbIFC::GetChanRtms | ( | int | idx, |
| ngcb_chan_rtms_t * | rtms ) |
Get RTMS channel RTMS configuration.
| int ngcbIFC::GetChanShift | ( | int | idx, |
| int * | shift ) |
Get channel bit shift.
| int ngcbIFC::GetChanSrc | ( | int | idx, |
| int | src, | ||
| int * | flag ) |
Get enabled-flag per source and channel.
|
virtual |
Get client connection.
Reimplemented in ngcbIFC3.
| int ngcbIFC::GetRtmsNet | ( | ngcb_rtms_net * | net | ) |
Get RTMS common parameters.
|
virtual |
Handle event on file descriptor.
Reimplemented in ngcbIFC_TCP.
|
virtual |
Driver interface process host.
Reimplemented in ngcbIFC_TCP.
| int ngcbIFC::Instance | ( | ) |
Get interface instance.
| void ngcbIFC::Instance | ( | int | instance | ) |
Set interface instance.
|
virtual |
Set line keeper interval (seconds)
Reimplemented in ngcbIFC2.
|
virtual |
Terminate driver interface process.
Reimplemented in ngcbIFC_TCP.
| void ngcbIFC::Log | ( | const char * | format, |
| ... ) |
Log message.
| char * ngcbIFC::Name | ( | ) |
Device name.
| int ngcbIFC::Off | ( | ) |
Bring interface to OFF state.
| int ngcbIFC::Online | ( | ) |
Bring interface to ONLINE state.
| int ngcbIFC::Open | ( | ) |
Open interface with current name.
|
virtual |
Open interface by name.
Reimplemented in ngcbIFC2, ngcbIFC3, and ngcbIFC_TCP.
|
virtual |
Driver interface process id.
Reimplemented in ngcbIFC_TCP.
|
virtual |
Ping device.
Reimplemented in ngcbIFC2.
| void ngcbIFC::Poll | ( | ) |
Poll event list.
|
virtual |
Driver interface process command port.
Reimplemented in ngcbIFC_TCP.
| int ngcbIFC::PythonTask | ( | const char * | script | ) |
Execute Python task.
|
virtual |
Read buffer from device.
| int ngcbIFC::ReadAddr | ( | const ngcb_route_t & | route, |
| int | addr, | ||
| int * | buffer, | ||
| int | size ) |
Read from address.
| int ngcbIFC::ReadAddr | ( | int | addr, |
| int * | buffer, | ||
| int | size = 1 ) |
Read buffer from first board.
|
virtual |
Read from address.
Reimplemented in ngcbIFC2, ngcbIFC3, and ngcbIFC_TCP.
| int ngcbIFC::ReadAddr64 | ( | const ngcb_route_t & | route, |
| int | addr, | ||
| uint64_t * | buffer, | ||
| int | size ) |
64-bit read
| int ngcbIFC::ReadAddr64 | ( | int | addr, |
| uint64_t * | buffer, | ||
| int | size = 1 ) |
Read 64-bit buffer from first board.
|
virtual |
Reset device.
Reimplemented in ngcbIFC2, ngcbIFC3, and ngcbIFC_TCP.
| void ngcbIFC::Result2Err | ( | char * | s, |
| int | resultCode ) |
Convert result code to error string.
|
virtual |
|
virtual |
Copy RPC payload.
|
virtual |
Driver interface process is running.
Reimplemented in ngcbIFC_TCP.
| int ngcbIFC::SetChanBits | ( | int | idx, |
| int | bits ) |
Set number of enabled bits on channel.
| int ngcbIFC::SetChanEnable | ( | int | idx, |
| int | flag ) |
Enable/disable RTMS channel.
| int ngcbIFC::SetChanIp | ( | int | idx, |
| ngcb_chan_ip_t | ip ) |
Set RTMS channel IP configuration.
| int ngcbIFC::SetChanMudpi | ( | int | idx, |
| ngcb_chan_mudpi_t | mudpi ) |
Set RTMS channel MUDPI configuration.
| int ngcbIFC::SetChanRtms | ( | int | idx, |
| ngcb_chan_rtms_t | rtms ) |
Set RTMS channel RTMS configuration.
| int ngcbIFC::SetChanShift | ( | int | idx, |
| int | shift ) |
Set channel bit shift.
| int ngcbIFC::SetChanSrc | ( | int | idx, |
| int | src = 0, | ||
| int | flag = -1 ) |
Enable/disable channel source.
| int ngcbIFC::SetRtmsNet | ( | ngcb_rtms_net | net | ) |
Set RTMS common parameters.
| int ngcbIFC::SetTime | ( | double | time = 0.0 | ) |
Set device time (seconds since UNIX epoch, time <= 0.0 sets system time).
|
virtual |
| const char * ngcbIFC::Setup | ( | ) |
Return actual interface setup identification string.
|
protectedvirtual |
Setup call-back.
|
virtual |
Set simulation level.
Reimplemented in ngcbIFC2, ngcbIFC3, and ngcbIFC_TCP.
| const char * ngcbIFC::SofwVersion | ( | ) |
Software version.
| int ngcbIFC::Standby | ( | ) |
Bring interface to STANDBY state.
|
virtual |
Get communication status.
Reimplemented in ngcbIFC2, and ngcbIFC_TCP.
|
virtual |
Parse string to RPC payload.
| int ngcbIFC::SyncFwd | ( | int | flag | ) |
Forward SYNC signal.
| int ngcbIFC::SyncSize | ( | int | size | ) |
Set SYNC packet size.
| int ngcbIFC::SyncWithData | ( | int | flag | ) |
SYNC with data-valid.
|
virtual |
Get timeout.
|
virtual |
Set timeout.
Reimplemented in ngcbIFC2, ngcbIFC3, and ngcbIFC_TCP.
|
virtual |
Get TSU configuration.
Reimplemented in ngcbIFC2.
|
virtual |
Reimplemented in ngcbIFC2.
|
virtual |
Take TSU snapshot.
Reimplemented in ngcbIFC2.
|
virtual |
Start TSU trigger immediatly.
Reimplemented in ngcbIFC2.
|
virtual |
Reimplemented in ngcbIFC2.
|
virtual |
Get TSU status.
Reimplemented in ngcbIFC2.
|
virtual |
Stop TSU trigger.
Reimplemented in ngcbIFC2.
|
virtual |
Manual TSU trigger.
Reimplemented in ngcbIFC2.
| char * ngcbIFC::Type | ( | ) |
Interface type.
| void ngcbIFC::Verbose | ( | const char * | format, |
| ... ) |
Verbose message.
| int ngcbIFC::Wait | ( | ngcbEVT * | evt, |
| int | interval, | ||
| int * | result ) |
Wait for event.
|
virtual |
Write buffer to device.
| int ngcbIFC::WriteAddr | ( | const ngcb_route_t & | route, |
| int | addr, | ||
| const int * | buffer, | ||
| int | size ) |
Write to address.
| int ngcbIFC::WriteAddr | ( | int | addr, |
| const int * | buffer, | ||
| int | size ) |
Write buffer to first board.
| int ngcbIFC::WriteAddr | ( | int | addr, |
| int | value ) |
Write to register on first board.
|
virtual |
Write to address.
Reimplemented in ngcbIFC2, ngcbIFC3, and ngcbIFC_TCP.
| int ngcbIFC::WriteAddr64 | ( | const ngcb_route_t & | route, |
| int | addr, | ||
| const uint64_t * | buffer, | ||
| int | size ) |
64-bit write
| int ngcbIFC::WriteAddr64 | ( | int | addr, |
| const uint64_t * | buffer, | ||
| int | size ) |
Write 64-bit buffer to first board.
| int ngcbIFC::WriteAddr64 | ( | int | addr, |
| uint64_t | value ) |
Write to 64-bit register on first board.
| int ngcbIFC::WriteBuffer | ( | const int * | buffer, |
| int | size, | ||
| int * | result ) |
Write formatted buffer to device.
| int ngcbIFC::backPlane |
Back-plane id.
| ngcb_route_t ngcbIFC::cfgRoute |
Configuration route.
| int ngcbIFC::chain |
Chain length from last skipped node to DFE.
| ngcbLIST ngcbIFC::evtList |
Device event list.
| int ngcbIFC::firmware |
Firmware revision.
| int ngcbIFC::id |
ID-register content.
| int ngcbIFC::ioError |
Indicates an i/o error.
| int ngcbIFC::keeper |
Line keeper interval (seconds)
| int ngcbIFC::local |
Interface is local.
| int ngcbIFC::logLevel |
Logging level.
| int ngcbIFC::master |
Index of master device.
| int ngcbIFC::netTimeout |
Network timeout (seconds)
| int ngcbIFC::protocol |
Incremental protovol id.
| int ngcbIFC::revision |
Hardware revision.
| ngcb_rtms_cfg_t ngcbIFC::rtms |
RTMS configuration (WFS)
| ngcb_rtms_if ngcbIFC::rtmsIf |
RTMS interface (NGCII)
| int ngcbIFC::serNo1 |
Interface board serial number part one.
| int ngcbIFC::serNo2 |
Interface board serial number part two.
| ngcbSERVICE* ngcbIFC::services |
System services.
| int ngcbIFC::sideLink |
Connected through sidelink.
| int ngcbIFC::sim |
Interface simulation level.
| int ngcbIFC::skip |
Number of route nodes to skip.
| ngcb_sctl_t ngcbIFC::sync |
SYNC signal control.
| char ngcbIFC::thisHost[64] |
Host where this instance is launched.
| int ngcbIFC::translate |
RPC payload translation method.
| ngcb_tsu_t ngcbIFC::tsu |
TSU configuration.
| int ngcbIFC::tsuCtrl |
Enable/disable automatic start/stop of the TSU.
| int ngcbIFC::type |
Board type.
| int ngcbIFC::verboseLevel |
Verbose level.
| int ngcbIFC::version |
Board version (sub-type)
| FILE* ngcbIFC::watchdog |
External watchdog stream.
| int ngcbIFC::xterm |
Start in new terminal.