summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2023-12-20 08:02:30 -0600
committerJeff Hatch <jhatch@multitech.com>2023-12-20 08:02:30 -0600
commitd2fc936a71fc31fe9b42c64391454fa2f84bd234 (patch)
treee41ef7829f79283df56271d4cafde99ad5b2f19a
parentc854bb5872898fc0e3527094341132e50e456eeb (diff)
parentf81785474b715f3a16e8c53455473b4d2dfbbb72 (diff)
downloadmts-io-sysfs-d2fc936a71fc31fe9b42c64391454fa2f84bd234.tar.gz
mts-io-sysfs-d2fc936a71fc31fe9b42c64391454fa2f84bd234.tar.bz2
mts-io-sysfs-d2fc936a71fc31fe9b42c64391454fa2f84bd234.zip
Merge branch 'sv/digital-io' into 'master'
move digitalIO feature to IOTR See merge request !16
-rw-r--r--src/Device/Device.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Device/Device.cpp b/src/Device/Device.cpp
index 680cf44..7f92e75 100644
--- a/src/Device/Device.cpp
+++ b/src/Device/Device.cpp
@@ -25,7 +25,7 @@ const std::regex
Device::apFilters("(modalias)|(power)(.*)|(subsystem)|(uevent)");
const std::regex Device::serialModeFilter("(.*)(serial-mode)");
const std::regex Device::mtcdt3HwVersionFilters("(MTCDT3AC)(.*)");
-const std::regex Device::iotRtrVersionFilters("(MTCAP3)(.*)"); // TODO - change it after getting IOTROUTER hardware
+const std::regex Device::iotRtrVersionFilters("(IOTR)(.*)");
const std::regex Device::mtrFilters("(MTR-)(.*)");
const std::regex Device::storeFilters(
"(.*)(mac-)(.*)|(.*)(-id)|(uuid)|(.*)(/eui)|(.*)(/"
@@ -187,14 +187,12 @@ void Device::getSystemTreeJson(const char *dir_name) {
capabilityList["serial"] = true;
}
if (regex_match(fileData, iotRtrVersionFilters)) {
- capabilityList["din"] = true; // TODO - remove it when it will be in EEPROM
- capabilityList["dout"] = true; // TODO - remove it when it will be in EEPROM
/*
The order of the elements is important! This array is used to access Digital IOs,
in particular in SMS commands!
*/
- dInputs.push_back("led-power"); //TODO - change it to real names after getting IOTRouter HW
- dOutputs.push_back("led-lora"); //TODO - change it to real names after getting IOTRouter HW
+ dInputs.push_back("USER_DIO_IN");
+ dOutputs.push_back("USER_DIO_OUT");
}
} else if (strcmp(d_name, "mac-eth") == 0) {
deviceInfoList["macAddress"] = fileData;
@@ -827,7 +825,7 @@ void Device::writeJson(const rapidjson::Document &json, const std::string &file)
bool Device::readJson(rapidjson::Document &json, const std::string &file) {
std::ifstream is(file);
if (!is.is_open()) {
- printWarning("Can't read to %s: %s", file.c_str(), strerror(errno));
+ printDebug("Can't read to %s: %s", file.c_str(), strerror(errno));
return false;
}
rapidjson::IStreamWrapper isw { is };