Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit 41e139e

Browse files
committed
wince: fix device name and update vs project
On Windows CE "standard" device name format \\.\COMx doesn't work, CreateFile() just expects another standard name "COM1:" (note the ':' character). Signed-off-by: Petr Stetiar <[email protected]>
1 parent 75ce182 commit 41e139e

File tree

2 files changed

+116
-104
lines changed

2 files changed

+116
-104
lines changed

src/rs232_windows.c

+5
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,12 @@ fix_device_name(char *device)
372372
s++;
373373

374374
if (s && (atoi(s) > 0)) {
375+
/* meh, Windows CE is special and can't handle URN path, just COM1: format */
376+
#ifndef UNDER_CE
375377
snprintf(ret, RS232_STRLEN_DEVICE, "\\\\.\\COM%s", s);
378+
#else
379+
snprintf(ret, RS232_STRLEN_DEVICE, "COM%s:", s);
380+
#endif
376381
return ret;
377382
}
378383

0 commit comments

Comments
 (0)