summaryrefslogtreecommitdiff
path: root/src/Device
diff options
context:
space:
mode:
authorHarsh Sharma <harsh.sharma@multitech.com>2020-11-06 09:23:42 -0600
committerHarsh Sharma <harsh.sharma@multitech.com>2020-11-06 09:23:42 -0600
commitf13e498b07f525c9e74e735761efc3150ab45224 (patch)
treee31cfe60901c4aff0263b074faa1f0299bebcd77 /src/Device
parentc730b023549d32899e2831ac6ca03ce91d34201a (diff)
downloadmts-io-sysfs-f13e498b07f525c9e74e735761efc3150ab45224.tar.gz
mts-io-sysfs-f13e498b07f525c9e74e735761efc3150ab45224.tar.bz2
mts-io-sysfs-f13e498b07f525c9e74e735761efc3150ab45224.zip
Fixed spi path and fpga version functionality for mtcdt3
Diffstat (limited to 'src/Device')
-rw-r--r--src/Device/Device.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Device/Device.cpp b/src/Device/Device.cpp
index 129cb14..d367284 100644
--- a/src/Device/Device.cpp
+++ b/src/Device/Device.cpp
@@ -72,11 +72,11 @@ void Device::getSystemTreeJson(const char * dir_name) {
exitHandler(99);
}
while (1) {
- struct dirent * entry = readdir (d); // Gets subsequent entries from "d"
- if (!entry) { // If there are no more entries, exit
+ struct dirent * entry = readdir (d); /* Gets subsequent entries from "d" */
+ if (!entry) { /* If there are no more entries, exit */
break;
}
- const char * d_name = entry->d_name; // Get file name
+ const char * d_name = entry->d_name; /* Get file name */
std::string fileData;
if (!(entry->d_type & DT_DIR) && (MTS::System::readFile(fullPath + "/" + std::string(d_name), fileData) == 0)) {
fileData = MTS::Text::trim(fileData);
@@ -90,7 +90,7 @@ void Device::getSystemTreeJson(const char * dir_name) {
accessoryCard.SetObject();
accessoryCard.AddMember("port", rapidjson::Value().SetString(dir_name, accessoryCardsAlloc), accessoryCardsAlloc);
}
- if (strcmp(d_name, "product-id") == 0) { // Map additional details based on product id not found in mts-io dir
+ if (strcmp(d_name, "product-id") == 0) { /* Map card specific details based on the product id */
if (regex_match(fileData, loraG16Filters)) {
Lora21Card lora21(*this, fileData, dir_name);
} else if (regex_match(fileData, loraG64Filters)) {
@@ -119,11 +119,11 @@ void Device::getSystemTreeJson(const char * dir_name) {
}
}
}
- if (isValidDirectory(entry, fullPath, d_name)) { // Check that the directory is not "d" or d's parent.
- getSystemTreeJson(d_name); // Recursively call with the new path
+ if (isValidDirectory(entry, fullPath, d_name)) { /* Check that the directory is not "d" or d's parent */
+ getSystemTreeJson(d_name); /* Recursively call with the new path */
}
}
- if (closedir (d)) { // After going through all the entries, close the directory.
+ if (closedir (d)) { /* After going through all the entries, close the directory */
logError("Could not close " + std::string(fullPath));
exitHandler(errno);
}
@@ -266,7 +266,7 @@ void Device::printJson() {
}
void Device::printVersion (std::string name) {
- printf("%s %s\nCopyright (C) 2019 by Multi-Tech Systems\nThis program is free software; you may redistribute it under the terms of\nthe GNU General Public License version 2 or (at your option) any later version.\nThis program has absolutely no warranty.\n",name.c_str(), Version::version.c_str());
+ printf("%s %s\nCopyright (C) 2020 by Multi-Tech Systems\nThis program is free software; you may redistribute it under the terms of\nthe GNU General Public License version 2 or (at your option) any later version.\nThis program has absolutely no warranty.\n",name.c_str(), Version::version.c_str());
}
void Device::printUsage(std::string program) {