diff options
Diffstat (limited to 'src/Device/Device.cpp')
-rw-r--r-- | src/Device/Device.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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()) { |