Skip to content

Commit

Permalink
Add \\\\.\\ to portname for serial_network on windows
Browse files Browse the repository at this point in the history
To Manage COM Port number greater than COM9.
  • Loading branch information
BHAY-3DiTex committed Jan 25, 2024
1 parent d9b6ed5 commit 3136002
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion network/serial_network/HAL/NATIVE/serial_network_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size)

// Open the serial port
#ifdef _WIN32
char tmp[128];
sprintf(tmp, "\\\\.\\%s", portname);
hSerial = CreateFile(
portname,
tmp,
GENERIC_READ | GENERIC_WRITE,
0, // exclusive access
NULL, // no security
Expand Down

0 comments on commit 3136002

Please sign in to comment.