adds PV for turning Electornics on and off
Some checks failed
Test And Build / Lint (push) Successful in 2s
Test And Build / Build (push) Failing after 2s

This commit is contained in:
2025-11-18 14:00:26 +01:00
parent c563b07fed
commit 66792837a6
5 changed files with 72 additions and 4 deletions

View File

@@ -12,7 +12,33 @@
/*******************************************************************************
* UDP Packet Definitions
*/
struct __attribute__((__packed__)) UDPHeader {
enum CommandId : std::int16_t { reset = 0, start = 1, stop = 2, cont = 3 };
struct __attribute__((__packed__)) CommandHeader {
uint16_t BufferLength;
uint16_t BufferType;
uint16_t HeaderLength;
uint16_t BufferNumber;
uint16_t Command;
uint16_t McpdIdStatus;
uint16_t TimeStampLo;
uint16_t TimeStampMid;
uint16_t TimeStampHigh;
uint16_t Checksum;
uint16_t Finalizer;
CommandHeader(const CommandId commandId)
: BufferLength(10), BufferType(0x8000), HeaderLength(10),
BufferNumber(0), Command(commandId), McpdIdStatus(0), TimeStampLo(0),
TimeStampMid(0), TimeStampHigh(0), Checksum(0), Finalizer(0xffff) {
Checksum = BufferLength ^ BufferType ^ HeaderLength ^ BufferNumber ^
Command ^ McpdIdStatus ^ TimeStampLo ^ TimeStampMid ^
TimeStampHigh;
}
};
struct __attribute__((__packed__)) DataHeader {
uint16_t BufferLength;
uint16_t BufferType;
uint16_t HeaderLength;
@@ -85,6 +111,8 @@ struct __attribute__((__packed__)) NormalisedEvent {
* i.e.e drvInfo strings that are used to identify the parameters
*/
constexpr static char P_EnableElectronicsString[]{"EN_EL"};
constexpr static char P_StatusString[]{"STATUS"};
constexpr static char P_ResetString[]{"RESET"};
constexpr static char P_StopString[]{"STOP"};
@@ -130,6 +158,7 @@ class asynStreamGeneratorDriver : public asynPortDriver {
protected:
// Parameter Identifying IDs
int P_EnableElectronics;
int P_Status;
int P_Reset;
int P_Stop;