diff options
Diffstat (limited to 'src/Device')
-rw-r--r-- | src/Device/Device.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/Device/Device.cpp b/src/Device/Device.cpp index e7e295b..2b56895 100644 --- a/src/Device/Device.cpp +++ b/src/Device/Device.cpp @@ -489,6 +489,7 @@ void Device::printUsage(std::string program) { printf(" : is an expected full path. i.e. /dev/spidevX.X\n"); printf(" -i, --input : input file for upgrade\n"); printf(" : files are stored in /usr/lib/mts-flash-binaries\n"); + printf(" -u, --duration : optional field for <store> operation. it defines in milliseconds\n"); printf("Usage:\n"); printf(" Load : mts-io-sysfs -l -p <path> -i <file>\n"); printf(" Check : mts-io-sysfs -c -p <path>\n"); @@ -765,16 +766,12 @@ void Device::store(std::string name, std::string value) { if (gr.request()) { retval = gpiod_line_request_set_value(gr.request(),gr.offset(),lv); - if(retval != -1) { - storeOutputStateToNonvolatile(name, value); - exitHandler(0); - } - else + if(retval == -1) { simpleError("Could not set GPIO value",errno,111); + } } } } - std::ofstream fileToWrite(SYSFS_PLATFORM + name); if (fileToWrite.is_open()) { fileToWrite << value; @@ -783,13 +780,12 @@ void Device::store(std::string name, std::string value) { name.c_str(),strerror(errno)); exitHandler(98); } - storeOutputStateToNonvolatile(name, value); fileToWrite.close(); - exitHandler(0); + } else { + printError("Can't open %s%s: %s", SYSFS_PLATFORM, + name.c_str(),strerror(errno)); + exitHandler(99); } - printError("Can't open %s%s: %s", SYSFS_PLATFORM, - name.c_str(),strerror(errno)); - exitHandler(99); } void Device::storeTrigger(std::string name, std::string value) { |