全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:2065
推到 Plurk!
推到 Facebook!

怎樣讀取串口每個引腳的值

答題得分者是:cmf
cxg
中階會員


發表:116
回覆:192
積分:76
註冊:2004-02-12

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-12-21 11:26:22 IP:222.35.xxx.xxx 未訂閱
怎樣讀取串口每個引腳的值
cmf
尊榮會員


發表:84
回覆:918
積分:1032
註冊:2002-06-26

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-12-23 12:32:16 IP:61.218.xxx.xxx 未訂閱

COMSTAT


The COMSTAT structure contains information about a communications device. This structure is filled by theClearCommError function.

typedef struct _COMSTAT { 
 DWORD fDsrHold  :1;  
DWORD fXoffHold  :1;  
DWORD fEof  :1;  DWORD fReserved  :25;  
DWORD cbOutQue;
} COMSTAT, *LPCOMSTAT;

Parameters

hFile
[in] Handle to the communications device. The CreateFile function returns this handle.
lpErrors
[out] Pointer to a variable to be filled with a mask indicating the type of error. This parameter can be one or more of the following values.
Value Meaning
CE_BREAK The hardware detected a break condition.
CE_DNS
Windows Me/98/95: A parallel device is not selected.
CE_FRAME The hardware detected a framing error.
CE_IOE An I/O error occurred during communications with the device.
CE_MODE The requested mode is not supported, or the hFile parameter is invalid. If this value is specified, it is the only valid error.
CE_OOP
Windows Me/98/95: A parallel device signaled that it is out of paper.
CE_OVERRUN A character-buffer overrun has occurred. The next character is lost.
CE_PTO
Windows Me/98/95: A time-out occurred on a parallel device.
CE_RXOVER An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character.
CE_RXPARITY The hardware detected a parity error.
CE_TXFULL The application tried to transmit a character, but the output buffer was full.
lpStat
[out] Pointer to a COMSTAT structure in which the device's status information is returned. If this parameter is NULL, no status information is returned.

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, callGetLastError.

Remarks

If a communications port has been set up with a TRUE value for the fAbortOnError member of the setupDCB structure, the communications software will terminate all read and write operations on the communications port when a communications error occurs. No new read or write operations will be accepted until the application acknowledges the communications error by calling the ClearCommError function.
The ClearCommError function fills the status buffer pointed to by thelpStat parameter with the current status of the communications device specified by the hFile parameter.
http://netbook.mm520.net
------
︿︿
系統時間:2024-04-27 11:47:38
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!