Drivers: Ensure serial numbers are uppercase

This prevents mismatches if the device sends a lowercase
serial number, which may happen due to an oversight in
production.
This commit is contained in:
Paul Hollinsky
2022-05-28 14:41:41 -04:00
parent 00024990e9
commit 407ccccedd
4 changed files with 13 additions and 1 deletions
+3
View File
@@ -7,6 +7,7 @@
#include <fstream>
#include <map>
#include <algorithm>
#include <cctype>
#include <termios.h>
#include <fcntl.h>
#include <unistd.h>
@@ -67,6 +68,8 @@ public:
try {
std::ifstream reader(ss.str());
std::getline(reader, serial);
for (auto& c : serial)
c = toupper(c);
} catch(...) {
succeeded = false;
return;