int CmdHFEPACollectPACENonces(const char *Cmd)
{
// requested nonce size
- uint8_t m = 0;
+ unsigned int m = 0;
// requested number of Nonces
unsigned int n = 0;
// delay between requests
unsigned int d = 0;
- sscanf(Cmd, "%"hhu" %u %u", &m, &n, &d);
+ sscanf(Cmd, "%u %u %u", &m, &n, &d);
// values are expected to be > 0
m = m > 0 ? m : 1;
COMMTIMEOUTS ct; // Serial port time-out configuration
} serial_port_windows;
+void upcase(char *p) {
+ while(*p != '\0') {
+ if(*p >= 97 && *p <= 122) {
+ *p -= 32;
+ }
+ ++p;
+ }
+}
+
serial_port uart_open(const char* pcPortName)
{
char acPortName[255];
// Copy the input "com?" to "\\.\COM?" format
sprintf(acPortName,"\\\\.\\%s",pcPortName);
- _strupr(acPortName);
+ upcase(acPortName);
// Try to open the serial port
sp->hPort = CreateFileA(acPortName,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);