[問題] VC 寫 UART 程式
請問有人用 VC win32api 寫 uart 應用程式嗎?
我遇到一個問題就是我 裝置管理員->系統 有 com1 和 com11 com12
com11 和 com12 是 usb轉rs232
com1 可以開啟來操作,
但是 com11 com12 都不行,
請問有人遇過類似的狀況嗎?
在 Create File 就死了
hCom = CreateFile( pcCommPort,
GENERIC_READ | GENERIC_WRITE,
0, // comm devices must be opened w/exclusive-access
NULL, // no security attributes
OPEN_EXISTING, // comm devices must use OPEN_EXISTING
0, // not overlapped I/O
NULL // hTemplate must be NULL for comm devices
);
if (hCom == INVALID_HANDLE_VALUE) {
// Handle the error.
printf ("CreateFile failed with error %d.\n", GetLastError());
return (1);
}
錯誤編號 : 2 系統找不到指定的檔案
我開超級終端機可以連上我 uart 另一邊的 device
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.118.20.167
→
12/22 21:53, , 1F
12/22 21:53, 1F
→
12/22 21:54, , 2F
12/22 21:54, 2F
推
12/22 21:58, , 3F
12/22 21:58, 3F
→
12/23 13:22, , 4F
12/23 13:22, 4F