Skip to content

Commit 7e5d4b4

Browse files
BHAY-3DiTexnicolas-rabault
authored andcommitted
Add \\\\.\\ to portname for serial_network on windows
To Manage COM Port number greater than COM9.
1 parent 603c0f2 commit 7e5d4b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

network/serial_network/HAL/NATIVE/serial_network_hal.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,10 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size)
185185

186186
// Open the serial port
187187
#ifdef _WIN32
188+
char tmp[128];
189+
sprintf(tmp, "\\\\.\\%s", portname);
188190
hSerial = CreateFile(
189-
portname,
191+
tmp,
190192
GENERIC_READ | GENERIC_WRITE,
191193
0, // exclusive access
192194
NULL, // no security

0 commit comments

Comments
 (0)