summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/Device/Device.h1
-rw-r--r--src/Device/Device.cpp10
2 files changed, 11 insertions, 0 deletions
diff --git a/include/Device/Device.h b/include/Device/Device.h
index 42dad24..bcf0cff 100644
--- a/include/Device/Device.h
+++ b/include/Device/Device.h
@@ -164,6 +164,7 @@ class Device {
void mapFileToCapability();
void mapFirmware();
void mapMacAddress2();
+ void mapMacAddress2Iotr();
void printDir(const std::string dir_name,
std::vector<std::string> &results);
void printJson();
diff --git a/src/Device/Device.cpp b/src/Device/Device.cpp
index fca88e7..b2588eb 100644
--- a/src/Device/Device.cpp
+++ b/src/Device/Device.cpp
@@ -191,6 +191,7 @@ void Device::getSystemTreeJson(const char *dir_name) {
*/
dInputs.push_back("USER_DIO_IN");
dOutputs.push_back("USER_DIO_OUT");
+ mapMacAddress2Iotr();
}
} else if (strcmp(d_name, "mac-eth") == 0) {
deviceInfoList["macAddress"] = fileData;
@@ -362,6 +363,15 @@ void Device::mapFileToCapability() {
}
}
+void Device::mapMacAddress2Iotr() {
+ std::ifstream file("/sys/devices/platform/mts-io/mac-eth1");
+ if (file.is_open()) {
+ std::string line = "";
+ std::getline(file, line);
+ deviceInfoList["macAddress1"] = line;
+ }
+}
+
void Device::mapMacAddress2() {
std::ifstream file("/sys/devices/platform/mts-io/base/mac-eth");
if (file.is_open()) {