如何透過DCB直接控制RTS和 DTR訊號? |
尚未結案
|
Boy
一般會員 發表:5 回覆:10 積分:3 註冊:2002-11-30 發送簡訊給我 |
|
andychang1690
資深會員 發表:20 回覆:694 積分:442 註冊:2003-03-14 發送簡訊給我 |
Boy:請參考EscapeCommFunction 見BCB->Help->Windows SDK 引用線上說明如下: The EscapeCommFunction function directs a specified communications device to perform an extended function. BOOL EscapeCommFunction( HANDLE hFile, // handle to communications device DWORD dwFunc // extended function to perform ); Parameters hFile Identifies the communications device. The CreateFile function returns this handle. dwFunc Specifies the code of the extended function to perform. This parameter can be one of the following values: Value Meaning CLRDTR Clears the DTR (data-terminal-ready) signal. CLRRTS Clears the RTS (request-to-send) signal. SETDTR Sends the DTR (data-terminal-ready) signal. SETRTS Sends the RTS (request-to-send) signal. SETXOFF Causes transmission to act as if an XOFF character has been received. SETXON Causes transmission to act as if an XON character has been received. SETBREAK Suspends character transmission and places the transmission line in a break state until the ClearCommBreak function is called (or EscapeCommFunction is called with the CLRBREAK extended function code). The SETBREAK extended function code is identical to the SetCommBreak function. Note that this extended function does not flush data that has not been transmitted. CLRBREAK Restores character transmission and places the transmission line in a nonbreak state. The CLRBREAK extended function code is identical to the ClearCommBreak function. Return Values If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. See Also ClearCommBreak, CreateFile, SetCommBreak 請參考!Andy Chang
------
Andy Chang |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |