diff options
author | John Klug <john.klug@multitech.com> | 2023-11-27 10:30:29 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2023-11-27 10:30:29 -0600 |
commit | aa172072fd91a48cf0c14d20e6dd733d43b7c951 (patch) | |
tree | 91d23f7e99a9059d74f3d4e11e769f96470b35ea /include | |
parent | a826d13ae7b3e20648566ddecca23bd6fe8f856b (diff) | |
parent | ee0e497a8fdb840bf63018372d101a0396913b15 (diff) | |
download | mts-io-sysfs-aa172072fd91a48cf0c14d20e6dd733d43b7c951.tar.gz mts-io-sysfs-aa172072fd91a48cf0c14d20e6dd733d43b7c951.tar.bz2 mts-io-sysfs-aa172072fd91a48cf0c14d20e6dd733d43b7c951.zip |
Merge branch 'sv/digital-io' into 'master'
Sv/digital io
See merge request !14
Diffstat (limited to 'include')
-rw-r--r-- | include/Device/Device.h | 11 | ||||
-rw-r--r-- | include/General.h | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/include/Device/Device.h b/include/Device/Device.h index e02c352..42dad24 100644 --- a/include/Device/Device.h +++ b/include/Device/Device.h @@ -23,12 +23,15 @@ 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; static const std::regex storeFilters; static const std::regex showFilters; static const std::regex mtcdt3HwVersionFilters; + static const std::regex iotRtrVersionFilters; static const std::regex mtrFilters; const unsigned int accessoryCardsListSize = 7; @@ -128,7 +131,7 @@ class Device { void AddToDeviceInfo(const std::string Port, const std::string ProductID); }; - + class gpio_request { private: struct gpiod_request_config *request_config; @@ -146,7 +149,7 @@ class Device { }; std::vector<std::unique_ptr<AccessoryCard>> accessoryCardsList; - + public: Device(); void getSystemTreeJson(const char *dir_name); @@ -171,9 +174,11 @@ class Device { void sortAccessoryCards(); void store(std::string name, std::string value); void storeTrigger(std::string name, std::string value); + void storeOutputStateToNonvolatile(const std::string& name, const std::string& value); void Verbose(bool val); bool Verbose(); - void writeJson(); + 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); }; diff --git a/include/General.h b/include/General.h index 5e32f0b..4429b3d 100644 --- a/include/General.h +++ b/include/General.h @@ -72,6 +72,10 @@ typedef unsigned int uint; // 32 bit - even on 64 bit machines #define RESET_SHORT_CMD "reset_short_handler" #define RESET_LONG_CMD "reset_long_handler" #define KILL_SIGNAL "kill -l " +#define STORED_DIGITAL_OUTPUTS_STATE_FILE "/var/config/pin_states.json" +#define KEY_EXTIO "extIo" +#define KEY_DOUTPUTS "dOutputs" +#define KEY_DINPUTS "dInputs" enum HardwareType { HARDWARE_MTCDT, |