mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user