summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSerhii Voloshynov <serhii.voloshynov@globallogic.com>2024-05-15 16:20:54 +0300
committerSerhii Voloshynov <serhii.voloshynov@globallogic.com>2024-05-27 18:29:53 +0300
commit0b55b2997d17bbce5bea3ebe1f5700dca184574f (patch)
treedfb90e834968d88060eaf937f2e9cf83cd1ee477 /include
parent1eea7eae25074cc18e37c80cd5ede91e13213920 (diff)
downloadmts-io-sysfs-0b55b2997d17bbce5bea3ebe1f5700dca184574f.tar.gz
mts-io-sysfs-0b55b2997d17bbce5bea3ebe1f5700dca184574f.tar.bz2
mts-io-sysfs-0b55b2997d17bbce5bea3ebe1f5700dca184574f.zip
[MTX-5302] MTR3 R.7.0: Serial IP functionality support GP-2336
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,