Skip to content

Commit

Permalink
ntroduced PPUC_structs.h
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Feb 13, 2025
1 parent e9d51e0 commit 224f893
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 48 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ set(PPUC_SOURCES
src/RS485Comm.cpp
src/PPUC.h
src/PPUC.cpp
src/PPUC_structs.h
)

set(PPUC_INCLUDE_DIRS
Expand Down
45 changes: 2 additions & 43 deletions src/PPUC.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#define PPUC_VERSION_MAJOR 0 // X Digits
#define PPUC_VERSION_MINOR 2 // Max 2 Digits
#define PPUC_VERSION_MINOR 3 // Max 2 Digits
#define PPUC_VERSION_PATCH 0 // Max 2 Digits

#define _PPUC_STR(x) #x
Expand All @@ -15,54 +15,13 @@

#ifdef _MSC_VER
#define PPUCAPI __declspec(dllexport)
#define CALLBACK __stdcall
#else
#define PPUCAPI __attribute__((visibility("default")))
#define CALLBACK
#endif

#include "PPUC_structs.h"
#include "yaml-cpp/yaml.h"

typedef void(CALLBACK* PPUC_LogMessageCallback)(const char* format,
va_list args,
const void* userData);

struct PPUCSwitchState {
int number;
int state;

PPUCSwitchState(int n, int s) {
number = n;
state = s;
}
};

struct PPUCSwitch {
uint8_t number;
std::string description;

PPUCSwitch(uint8_t n, const std::string& d)
: number(n), description(d) {}
};

struct PPUCCoil {
uint8_t type;
uint8_t number;
std::string description;

PPUCCoil(uint8_t t, uint8_t n,const std::string& d)
: type(t), number(n), description(d) {}
};

struct PPUCLamp {
uint8_t type;
uint8_t number;
std::string description;

PPUCLamp(uint8_t t, uint8_t n, const std::string& d)
: type(t), number(n), description(d) {}
};

class RS485Comm;

class PPUCAPI PPUC {
Expand Down
6 changes: 1 addition & 5 deletions src/RS485Comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <mutex>
#include <queue>

#include "PPUC.h"
#include "io-boards/Event.h"
#include "libserialport.h"
#include "PPUC_structs.h"

#if _MSC_VER
#define CALLBACK __stdcall
Expand All @@ -34,10 +34,6 @@

#define RS485_COMM_QUEUE_SIZE_MAX 128

typedef void(CALLBACK* PPUC_LogMessageCallback)(const char* format,
va_list args,
const void* userData);

class RS485Comm {
public:
RS485Comm();
Expand Down

0 comments on commit 224f893

Please sign in to comment.