This is an example for
ByteDataAccessBase
and also the access to the
Inspector datagram.
The Inspector (short
Inspc) is a mechanism to access to target embedded processor systems
which runs often in C to access all data. See
www.vishia.org/Inspc
.
A datagram can be sent via socket communication with UDP, via a serial interface or a Dual-Port-Ram access.
It has a limited size of at maximum 1200 Byte. A datagram starts with a header of at least 4 byte in the following C-language struct:
typedef struct InspcDatagramBase_t
{
int16 nrofBytes;
int16 cmdDatagram;
} InspcDatagramBase;
Depending on the command the item has some more bytes which can be recognized as children of the ByteDataAccess.
The other possibility in C language my be: test and cast. But in C the C-translated version of this class
and
ByteDataAccessBase
is used for too.
For yet used datagram types depending on defined values of
cmdDatagram
this struct can be casted to the following struct of 16 bytes:
typedef struct InspcDatagramSeqEntrant_t
{
InspcDatagramBase base;
int32 encryption;
int32 seqnr;
int16 answer;
int16 entrant;
} InspcDatagramSeqEntrant;
Both head structures are defined as static sub classes of this class.
The Inspector datagram consists of some items which are requests or answers. This items are described in
Inspcitem
.
The
TestInspcDatagram
contains some methods to build and evaluate datagrams to test the algorithm.