Skip to content
Snippets Groups Projects
Commit 8d2d51b4 authored by Timothe Jost's avatar Timothe Jost
Browse files

improvement in proxyInit and openSerialPort

parent b299a2ad
No related branches found
No related tags found
No related merge requests found
...@@ -101,6 +101,7 @@ static int openSerialPort(const char *serial_port) ...@@ -101,6 +101,7 @@ static int openSerialPort(const char *serial_port)
printf("Input Serial Port Baud Rate: %d\n", input_baud); printf("Input Serial Port Baud Rate: %d\n", input_baud);
printf("Output Serial Port Baud Rate: %d\n", output_baud); printf("Output Serial Port Baud Rate: %d\n", output_baud);
printf("serial_fd value: %d\n", fd);
return fd; return fd;
} }
...@@ -122,14 +123,14 @@ void proxyInit(unsigned int udp_port, char *serial_device, const char *udp_addre ...@@ -122,14 +123,14 @@ void proxyInit(unsigned int udp_port, char *serial_device, const char *udp_addre
for (int i = 0; i < MAX_SERIAL_PORTS; i++) for (int i = 0; i < MAX_SERIAL_PORTS; i++)
{ {
serial_fd = openSerialPort(serial_ports[i]); serial_fd = openSerialPort(serial_ports[i]);
if (serial_fd) if (serial_fd < 0)
{ {
printf("Successfully opened serial port: %s\n", serial_ports[i]); printf("Failed to open serial port: %s\n", serial_ports[i]);
break;
} }
else else
{ {
printf("Failed to open serial port: %s\n", serial_ports[i]); printf("Successfully opened serial port: %s\n", serial_ports[i]);
break;
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment