We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f97208 commit ee77ddcCopy full SHA for ee77ddc
src/src/serial_unix.cpp
@@ -1,6 +1,6 @@
1
-#include <fstream>
2
#if defined(__unix__) || defined(__unix) || defined(__APPLE__)
3
#include "serial.h"
+#include <fstream>
4
#include <unistd.h> // UNIX standard function definitions
5
#include <fcntl.h> // File control definitions
6
#include <sys/ioctl.h> // Used for TCGETS2, which is required for custom baud rates
@@ -32,7 +32,13 @@ void serialOpen(
32
// Open new serial connection
33
hSerialPort = open(portName, O_RDWR);
34
35
- log << strerror(errno);
+ if(hSerialPort == -1){
36
+ log << strerror(errno);
37
+ }
38
+ else {
39
+ log << hSerialPort;
40
41
+
42
43
// Error if open fails
44
ioctl(hSerialPort, TCGETS2, &tty);
0 commit comments