summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrii Pientsov <andrii.pientsov@globallogic.com>2022-10-20 14:39:48 +0300
committerAndrii Pientsov <andrii.pientsov@globallogic.com>2022-10-20 14:39:48 +0300
commit88521b551e67bc0aa23265defcd7703a6f8d9304 (patch)
tree72d9125dee0a6f4f8be4e3d16495b7774106bf4d /src
parent70bd943d27ec101f3a85e1b1c03eb77e66cf0b5e (diff)
downloadmts-io-sysfs-88521b551e67bc0aa23265defcd7703a6f8d9304.tar.gz
mts-io-sysfs-88521b551e67bc0aa23265defcd7703a6f8d9304.tar.bz2
mts-io-sysfs-88521b551e67bc0aa23265defcd7703a6f8d9304.zip
MTX-4685 MTCDT3 R.6.2.0: hw-version shall be used to detect serial capabilities GP-1779
Diffstat (limited to 'src')
-rw-r--r--src/Device/Device.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Device/Device.cpp b/src/Device/Device.cpp
index effd4b6..c6e1186 100644
--- a/src/Device/Device.cpp
+++ b/src/Device/Device.cpp
@@ -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, mtcdt3Filters)) {
+ 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;