summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Device/Device.h23
-rw-r--r--include/General.h1
2 files changed, 21 insertions, 3 deletions
diff --git a/include/Device/Device.h b/include/Device/Device.h
index bcf0cff..a1c0b1b 100644
--- a/include/Device/Device.h
+++ b/include/Device/Device.h
@@ -23,8 +23,6 @@ class Device {
static std::map<std::string, bool> capabilityList;
static std::map<std::string, std::string> ethSwitchList;
static std::map<std::string, std::string> deviceInfoList;
- static std::vector<std::string> dInputs;
- static std::vector<std::string> dOutputs;
static const std::regex apFilters;
static const std::regex serialModeFilter;
@@ -33,6 +31,8 @@ class Device {
static const std::regex mtcdt3HwVersionFilters;
static const std::regex iotRtrVersionFilters;
static const std::regex mtrFilters;
+ static std::string extIoStr;
+ static std::string serialStr;
const unsigned int accessoryCardsListSize = 7;
@@ -150,6 +150,18 @@ class Device {
std::vector<std::unique_ptr<AccessoryCard>> accessoryCardsList;
+ const std::string SERIAL_MODE = "mode";
+ const std::string SERIAL_TERMINATION = "rs4xx-term-res";
+ const std::string SERIAL_MODE_RS232 = "rs232";
+ const std::string SERIAL_MODE_RS485 = "rs485-half";
+ const std::map<std::string, uint32_t> mModes = {{SERIAL_MODE_RS232, 0}, {SERIAL_MODE_RS485, 0}};
+
+ const std::string CONTROL_PIN_SERIAL_MODE = "MXC2_RS485_EN";
+ const std::string CONTROL_PIN_TERMINATION = "MXC2_RS485_TERM_EN";
+ const std::string HW_VERSION_FILE = "/sys/devices/platform/mts-io/hw-version";
+ std::string program_name;
+ std::string hw_version;
+
public:
Device();
void getSystemTreeJson(const char *dir_name);
@@ -169,7 +181,7 @@ class Device {
std::vector<std::string> &results);
void printJson();
void printVersion(std::string name);
- void printUsage(std::string program);
+ void printUsage();
void show(std::string program);
void showTrigger(std::string name);
void sortAccessoryCards();
@@ -181,6 +193,11 @@ class Device {
void writeJson(const rapidjson::Document &json, const std::string &file);
bool readJson(rapidjson::Document &json, const std::string &file);
void simpleError(std::string msg, int error, int exitval);
+ void setSerialModesMTR3(const std::string &mode, const std::string &value);
+ void showSerialModesMTR3(const std::string &mode);
+ int getPinValue(const std::string &name);
+ void setProgramName(const std::string &name);
+ void setHWVersion();
};
#endif /* DEVICE_H_ */
diff --git a/include/General.h b/include/General.h
index 4429b3d..58c2a09 100644
--- a/include/General.h
+++ b/include/General.h
@@ -76,6 +76,7 @@ typedef unsigned int uint; // 32 bit - even on 64 bit machines
#define KEY_EXTIO "extIo"
#define KEY_DOUTPUTS "dOutputs"
#define KEY_DINPUTS "dInputs"
+#define KEY_SERIALS "serialPorts"
enum HardwareType {
HARDWARE_MTCDT,