summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2022-10-20 08:45:32 -0500
committerJeff Hatch <jhatch@multitech.com>2022-10-20 08:45:32 -0500
commitb90d7dbdb64857b06b51552c115120ef042c1070 (patch)
treeb134ef10f272583ee53ca754f93344080f252d6d
parent70bd943d27ec101f3a85e1b1c03eb77e66cf0b5e (diff)
parent49ee47ad3caae204fd19c31eb94b55bc72fce5e8 (diff)
downloadmts-io-sysfs-b90d7dbdb64857b06b51552c115120ef042c1070.tar.gz
mts-io-sysfs-b90d7dbdb64857b06b51552c115120ef042c1070.tar.bz2
mts-io-sysfs-b90d7dbdb64857b06b51552c115120ef042c1070.zip
Merge branch 'ap/MTX-4685' into 'master'
MTX-4685 MTCDT3 R.6.2.0: hw-version shall be used to detect serial capabilities GP-1779 See merge request !10
-rw-r--r--include/Device/Device.h2
-rw-r--r--src/Device/Device.cpp14
2 files changed, 8 insertions, 8 deletions
diff --git a/include/Device/Device.h b/include/Device/Device.h
index 5f2bf12..7a20f04 100644
--- a/include/Device/Device.h
+++ b/include/Device/Device.h
@@ -28,7 +28,7 @@ class Device {
static const std::regex serialModeFilter;
static const std::regex storeFilters;
static const std::regex showFilters;
- static const std::regex mtcdt3Filters;
+ static const std::regex mtcdt3HwVersionFilters;
static const std::regex mtrFilters;
const unsigned int accessoryCardsListSize = 7;
diff --git a/src/Device/Device.cpp b/src/Device/Device.cpp
index effd4b6..6ef807e 100644
--- a/src/Device/Device.cpp
+++ b/src/Device/Device.cpp
@@ -22,7 +22,7 @@ const std::vector<std::string> Device::apIdentifiers = {
const std::regex
Device::apFilters("(modalias)|(power)(.*)|(subsystem)|(uevent)");
const std::regex Device::serialModeFilter("(.*)(serial-mode)");
-const std::regex Device::mtcdt3Filters("(MTCDT3AC)(.*)");
+const std::regex Device::mtcdt3HwVersionFilters("(MTCDT3AC)(.*)");
const std::regex Device::mtrFilters("(MTR-)(.*)");
const std::regex Device::storeFilters(
"(.*)(mac-)(.*)|(.*)(-id)|(uuid)|(.*)(/eui)|(.*)(/"
@@ -175,6 +175,12 @@ void Device::getSystemTreeJson(const char *dir_name) {
deviceInfoList[toCamelCase(d_name)] = fileData;
} else if (strcmp(d_name, "hw-version") == 0) {
deviceInfoList["hardwareVersion"] = fileData;
+ if (regex_match(fileData, mtcdt3HwVersionFilters)) {
+ capabilityList["rs232"] = true;
+ capabilityList["rs422"] = true;
+ capabilityList["rs485"] = true;
+ capabilityList["serial"] = true;
+ }
} else if (strcmp(d_name, "mac-eth") == 0) {
deviceInfoList["macAddress"] = fileData;
} else if (strcmp(d_name, "has-radio") == 0 &&
@@ -186,12 +192,6 @@ void Device::getSystemTreeJson(const char *dir_name) {
deviceInfoList["oemString2"] = fileData;
};
if (strcmp(d_name, "product-id") == 0) {
- if (regex_match(fileData, mtcdt3Filters)) {
- capabilityList["rs232"] = true;
- capabilityList["rs422"] = true;
- capabilityList["rs485"] = true;
- capabilityList["serial"] = true;
- }
if (regex_match(fileData, mtrFilters)) {
capabilityList["rs232"] = true;
capabilityList["serial"] = true;