FreeRDP
|
#include <winpr/collections.h>
#include <winpr/file.h>
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
Data Structures | |
struct | DCB |
struct | COMMCONFIG |
struct | COMMPROP |
struct | COMMTIMEOUTS |
struct | COMSTAT |
struct | _SERIAL_IOCTL_NAME |
Macros | |
#define | NOPARITY 0 |
#define | ODDPARITY 1 |
#define | EVENPARITY 2 |
#define | MARKPARITY 3 |
#define | SPACEPARITY 4 |
#define | ONESTOPBIT 0 |
#define | ONE5STOPBITS 1 |
#define | TWOSTOPBITS 2 |
#define | IGNORE 0 |
#define | CBR_110 110 |
#define | CBR_300 300 |
#define | CBR_600 600 |
#define | CBR_1200 1200 |
#define | CBR_2400 2400 |
#define | CBR_4800 4800 |
#define | CBR_9600 9600 |
#define | CBR_14400 14400 |
#define | CBR_19200 19200 |
#define | CBR_38400 38400 |
#define | CBR_56000 56000 |
#define | CBR_57600 57600 |
#define | CBR_115200 115200 |
#define | CBR_128000 128000 |
#define | CBR_256000 256000 |
#define | CE_RXOVER 0x0001 |
#define | CE_OVERRUN 0x0002 |
#define | CE_RXPARITY 0x0004 |
#define | CE_FRAME 0x0008 |
#define | CE_BREAK 0x0010 |
#define | CE_TXFULL 0x0100 |
#define | CE_PTO 0x0200 |
#define | CE_IOE 0x0400 |
#define | CE_DNS 0x0800 |
#define | CE_OOP 0x1000 |
#define | CE_MODE 0x8000 |
#define | IE_BADID (-1) |
#define | IE_OPEN (-2) |
#define | IE_NOPEN (-3) |
#define | IE_MEMORY (-4) |
#define | IE_DEFAULT (-5) |
#define | IE_HARDWARE (-10) |
#define | IE_BYTESIZE (-11) |
#define | IE_BAUDRATE (-12) |
#define | EV_RXCHAR 0x0001 |
#define | EV_RXFLAG 0x0002 |
#define | EV_TXEMPTY 0x0004 |
#define | EV_CTS 0x0008 |
#define | EV_DSR 0x0010 |
#define | EV_RLSD 0x0020 |
#define | EV_BREAK 0x0040 |
#define | EV_ERR 0x0080 |
#define | EV_RING 0x0100 |
#define | EV_PERR 0x0200 |
#define | EV_RX80FULL 0x0400 |
#define | EV_EVENT1 0x0800 |
#define | EV_EVENT2 0x1000 |
#define | SETXOFF 1 |
#define | SETXON 2 |
#define | SETRTS 3 |
#define | CLRRTS 4 |
#define | SETDTR 5 |
#define | CLRDTR 6 |
#define | RESETDEV 7 |
#define | SETBREAK 8 |
#define | CLRBREAK 9 |
#define | PURGE_TXABORT 0x0001 |
#define | PURGE_RXABORT 0x0002 |
#define | PURGE_TXCLEAR 0x0004 |
#define | PURGE_RXCLEAR 0x0008 |
#define | LPTx 0x80 |
#define | MS_CTS_ON ((DWORD)0x0010) |
#define | MS_DSR_ON ((DWORD)0x0020) |
#define | MS_RING_ON ((DWORD)0x0040) |
#define | MS_RLSD_ON ((DWORD)0x0080) |
#define | SP_SERIALCOMM ((DWORD)0x00000001) |
#define | PST_UNSPECIFIED ((DWORD)0x00000000) |
#define | PST_RS232 ((DWORD)0x00000001) |
#define | PST_PARALLELPORT ((DWORD)0x00000002) |
#define | PST_RS422 ((DWORD)0x00000003) |
#define | PST_RS423 ((DWORD)0x00000004) |
#define | PST_RS449 ((DWORD)0x00000005) |
#define | PST_MODEM ((DWORD)0x00000006) |
#define | PST_FAX ((DWORD)0x00000021) |
#define | PST_SCANNER ((DWORD)0x00000022) |
#define | PST_NETWORK_BRIDGE ((DWORD)0x00000100) |
#define | PST_LAT ((DWORD)0x00000101) |
#define | PST_TCPIP_TELNET ((DWORD)0x00000102) |
#define | PST_X25 ((DWORD)0x00000103) |
#define | PCF_DTRDSR ((DWORD)0x0001) |
#define | PCF_RTSCTS ((DWORD)0x0002) |
#define | PCF_RLSD ((DWORD)0x0004) |
#define | PCF_PARITY_CHECK ((DWORD)0x0008) |
#define | PCF_XONXOFF ((DWORD)0x0010) |
#define | PCF_SETXCHAR ((DWORD)0x0020) |
#define | PCF_TOTALTIMEOUTS ((DWORD)0x0040) |
#define | PCF_INTTIMEOUTS ((DWORD)0x0080) |
#define | PCF_SPECIALCHARS ((DWORD)0x0100) |
#define | PCF_16BITMODE ((DWORD)0x0200) |
#define | SP_PARITY ((DWORD)0x0001) |
#define | SP_BAUD ((DWORD)0x0002) |
#define | SP_DATABITS ((DWORD)0x0004) |
#define | SP_STOPBITS ((DWORD)0x0008) |
#define | SP_HANDSHAKING ((DWORD)0x0010) |
#define | SP_PARITY_CHECK ((DWORD)0x0020) |
#define | SP_RLSD ((DWORD)0x0040) |
#define | BAUD_075 ((DWORD)0x00000001) |
#define | BAUD_110 ((DWORD)0x00000002) |
#define | BAUD_134_5 ((DWORD)0x00000004) |
#define | BAUD_150 ((DWORD)0x00000008) |
#define | BAUD_300 ((DWORD)0x00000010) |
#define | BAUD_600 ((DWORD)0x00000020) |
#define | BAUD_1200 ((DWORD)0x00000040) |
#define | BAUD_1800 ((DWORD)0x00000080) |
#define | BAUD_2400 ((DWORD)0x00000100) |
#define | BAUD_4800 ((DWORD)0x00000200) |
#define | BAUD_7200 ((DWORD)0x00000400) |
#define | BAUD_9600 ((DWORD)0x00000800) |
#define | BAUD_14400 ((DWORD)0x00001000) |
#define | BAUD_19200 ((DWORD)0x00002000) |
#define | BAUD_38400 ((DWORD)0x00004000) |
#define | BAUD_56K ((DWORD)0x00008000) |
#define | BAUD_128K ((DWORD)0x00010000) |
#define | BAUD_115200 ((DWORD)0x00020000) |
#define | BAUD_57600 ((DWORD)0x00040000) |
#define | BAUD_USER ((DWORD)0x10000000) |
#define | DATABITS_5 ((WORD)0x0001) |
#define | DATABITS_6 ((WORD)0x0002) |
#define | DATABITS_7 ((WORD)0x0004) |
#define | DATABITS_8 ((WORD)0x0008) |
#define | DATABITS_16 ((WORD)0x0010) |
#define | DATABITS_16X ((WORD)0x0020) |
#define | STOPBITS_10 ((WORD)0x0001) |
#define | STOPBITS_15 ((WORD)0x0002) |
#define | STOPBITS_20 ((WORD)0x0004) |
#define | PARITY_NONE ((WORD)0x0100) |
#define | PARITY_ODD ((WORD)0x0200) |
#define | PARITY_EVEN ((WORD)0x0400) |
#define | PARITY_MARK ((WORD)0x0800) |
#define | PARITY_SPACE ((WORD)0x1000) |
#define | COMMPROP_INITIALIZED ((DWORD)0xE73CF52E) |
#define | DTR_CONTROL_DISABLE 0x00 |
#define | DTR_CONTROL_ENABLE 0x01 |
#define | DTR_CONTROL_HANDSHAKE 0x02 |
#define | RTS_CONTROL_DISABLE 0x00 |
#define | RTS_CONTROL_ENABLE 0x01 |
#define | RTS_CONTROL_HANDSHAKE 0x02 |
#define | RTS_CONTROL_TOGGLE 0x03 |
#define | BuildCommDCB BuildCommDCBA |
#define | BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsA |
#define | CommConfigDialog CommConfigDialogA |
#define | GetDefaultCommConfig GetDefaultCommConfigA |
#define | SetDefaultCommConfig SetDefaultCommConfigA |
#define | MAXULONG (4294967295UL) |
#define | IOCTL_SERIAL_SET_BAUD_RATE 0x001B0004 |
#define | IOCTL_SERIAL_GET_BAUD_RATE 0x001B0050 |
#define | IOCTL_SERIAL_SET_LINE_CONTROL 0x001B000C |
#define | IOCTL_SERIAL_GET_LINE_CONTROL 0x001B0054 |
#define | IOCTL_SERIAL_SET_TIMEOUTS 0x001B001C |
#define | IOCTL_SERIAL_GET_TIMEOUTS 0x001B0020 |
#define | IOCTL_SERIAL_GET_CHARS 0x001B0058 |
#define | IOCTL_SERIAL_SET_CHARS 0x001B005C |
#define | IOCTL_SERIAL_SET_DTR 0x001B0024 |
#define | IOCTL_SERIAL_CLR_DTR 0x001B0028 |
#define | IOCTL_SERIAL_RESET_DEVICE 0x001B002C |
#define | IOCTL_SERIAL_SET_RTS 0x001B0030 |
#define | IOCTL_SERIAL_CLR_RTS 0x001B0034 |
#define | IOCTL_SERIAL_SET_XOFF 0x001B0038 |
#define | IOCTL_SERIAL_SET_XON 0x001B003C |
#define | IOCTL_SERIAL_SET_BREAK_ON 0x001B0010 |
#define | IOCTL_SERIAL_SET_BREAK_OFF 0x001B0014 |
#define | IOCTL_SERIAL_SET_QUEUE_SIZE 0x001B0008 |
#define | IOCTL_SERIAL_GET_WAIT_MASK 0x001B0040 |
#define | IOCTL_SERIAL_SET_WAIT_MASK 0x001B0044 |
#define | IOCTL_SERIAL_WAIT_ON_MASK 0x001B0048 |
#define | IOCTL_SERIAL_IMMEDIATE_CHAR 0x001B0018 |
#define | IOCTL_SERIAL_PURGE 0x001B004C |
#define | IOCTL_SERIAL_GET_HANDFLOW 0x001B0060 |
#define | IOCTL_SERIAL_SET_HANDFLOW 0x001B0064 |
#define | IOCTL_SERIAL_GET_MODEMSTATUS 0x001B0068 |
#define | IOCTL_SERIAL_GET_DTRRTS 0x001B0078 |
#define | IOCTL_SERIAL_GET_COMMSTATUS 0x001B006C |
#define | IOCTL_SERIAL_GET_PROPERTIES 0x001B0074 |
#define | IOCTL_SERIAL_CONFIG_SIZE 0x001B0080 |
#define | IOCTL_USBPRINT_GET_1284_ID 0x220034 |
Typedefs | |
typedef struct DCB * | LPDCB |
typedef struct COMMCONFIG * | LPCOMMCONFIG |
typedef struct COMMPROP * | LPCOMMPROP |
typedef struct COMMTIMEOUTS * | LPCOMMTIMEOUTS |
typedef struct COMSTAT * | LPCOMSTAT |
Enumerations | |
enum | SERIAL_DRIVER_ID { SerialDriverUnknown = 0 , SerialDriverSerialSys , SerialDriverSerCxSys , SerialDriverSerCx2Sys } |
Functions | |
WINPR_API BOOL | BuildCommDCBA (LPCSTR lpDef, LPDCB lpDCB) |
WINPR_API BOOL | BuildCommDCBW (LPCWSTR lpDef, LPDCB lpDCB) |
WINPR_API BOOL | BuildCommDCBAndTimeoutsA (LPCSTR lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts) |
WINPR_API BOOL | BuildCommDCBAndTimeoutsW (LPCWSTR lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts) |
WINPR_API BOOL | CommConfigDialogA (LPCSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC) |
WINPR_API BOOL | CommConfigDialogW (LPCWSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC) |
WINPR_API BOOL | GetCommConfig (HANDLE hCommDev, LPCOMMCONFIG lpCC, LPDWORD lpdwSize) |
WINPR_API BOOL | SetCommConfig (HANDLE hCommDev, LPCOMMCONFIG lpCC, DWORD dwSize) |
WINPR_API BOOL | GetCommMask (HANDLE hFile, PDWORD lpEvtMask) |
WINPR_API BOOL | SetCommMask (HANDLE hFile, DWORD dwEvtMask) |
WINPR_API BOOL | GetCommModemStatus (HANDLE hFile, PDWORD lpModemStat) |
WINPR_API BOOL | GetCommProperties (HANDLE hFile, LPCOMMPROP lpCommProp) |
WINPR_API BOOL | GetCommState (HANDLE hFile, LPDCB lpDCB) |
WINPR_API BOOL | SetCommState (HANDLE hFile, LPDCB lpDCB) |
WINPR_API BOOL | GetCommTimeouts (HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts) |
WINPR_API BOOL | SetCommTimeouts (HANDLE hFile, LPCOMMTIMEOUTS lpCommTimeouts) |
WINPR_API BOOL | GetDefaultCommConfigA (LPCSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize) |
WINPR_API BOOL | GetDefaultCommConfigW (LPCWSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize) |
WINPR_API BOOL | SetDefaultCommConfigA (LPCSTR lpszName, LPCOMMCONFIG lpCC, DWORD dwSize) |
WINPR_API BOOL | SetDefaultCommConfigW (LPCWSTR lpszName, LPCOMMCONFIG lpCC, DWORD dwSize) |
WINPR_API BOOL | SetCommBreak (HANDLE hFile) |
WINPR_API BOOL | ClearCommBreak (HANDLE hFile) |
WINPR_API BOOL | ClearCommError (HANDLE hFile, PDWORD lpErrors, LPCOMSTAT lpStat) |
WINPR_API BOOL | PurgeComm (HANDLE hFile, DWORD dwFlags) |
WINPR_API BOOL | SetupComm (HANDLE hFile, DWORD dwInQueue, DWORD dwOutQueue) |
WINPR_API BOOL | EscapeCommFunction (HANDLE hFile, DWORD dwFunc) |
WINPR_API BOOL | TransmitCommChar (HANDLE hFile, char cChar) |
WINPR_API BOOL | WaitCommEvent (HANDLE hFile, PDWORD lpEvtMask, LPOVERLAPPED lpOverlapped) |
WINPR_API BOOL | DefineCommDevice (LPCTSTR lpDeviceName, LPCTSTR lpTargetPath) |
WINPR_API DWORD | QueryCommDevice (LPCTSTR lpDeviceName, LPTSTR lpTargetPath, DWORD ucchMax) |
WINPR_API BOOL | IsCommDevice (LPCTSTR lpDeviceName) |
WINPR_API HANDLE | CommCreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) |
WINPR_API const char * | _comm_serial_ioctl_name (ULONG number) |
WINPR_API void | _comm_setServerSerialDriver (HANDLE hComm, SERIAL_DRIVER_ID) |
WINPR_API BOOL | _comm_set_permissive (HANDLE hDevice, BOOL permissive) |
WINPR_API BOOL | CommDeviceIoControl (HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) |
WINPR_API BOOL | CommReadFile (HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped) |
WINPR_API BOOL | CommWriteFile (HANDLE hDevice, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) |
#define BAUD_075 ((DWORD)0x00000001) |
#define BAUD_110 ((DWORD)0x00000002) |
#define BAUD_115200 ((DWORD)0x00020000) |
#define BAUD_1200 ((DWORD)0x00000040) |
#define BAUD_128K ((DWORD)0x00010000) |
#define BAUD_134_5 ((DWORD)0x00000004) |
#define BAUD_14400 ((DWORD)0x00001000) |
#define BAUD_150 ((DWORD)0x00000008) |
#define BAUD_1800 ((DWORD)0x00000080) |
#define BAUD_19200 ((DWORD)0x00002000) |
#define BAUD_2400 ((DWORD)0x00000100) |
#define BAUD_300 ((DWORD)0x00000010) |
#define BAUD_38400 ((DWORD)0x00004000) |
#define BAUD_4800 ((DWORD)0x00000200) |
#define BAUD_56K ((DWORD)0x00008000) |
#define BAUD_57600 ((DWORD)0x00040000) |
#define BAUD_600 ((DWORD)0x00000020) |
#define BAUD_7200 ((DWORD)0x00000400) |
#define BAUD_9600 ((DWORD)0x00000800) |
#define BAUD_USER ((DWORD)0x10000000) |
#define BuildCommDCB BuildCommDCBA |
#define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsA |
#define CBR_110 110 |
#define CBR_115200 115200 |
#define CBR_1200 1200 |
#define CBR_128000 128000 |
#define CBR_14400 14400 |
#define CBR_19200 19200 |
#define CBR_2400 2400 |
#define CBR_256000 256000 |
#define CBR_300 300 |
#define CBR_38400 38400 |
#define CBR_4800 4800 |
#define CBR_56000 56000 |
#define CBR_57600 57600 |
#define CBR_600 600 |
#define CBR_9600 9600 |
#define CE_BREAK 0x0010 |
#define CE_DNS 0x0800 |
#define CE_FRAME 0x0008 |
#define CE_IOE 0x0400 |
#define CE_MODE 0x8000 |
#define CE_OOP 0x1000 |
#define CE_OVERRUN 0x0002 |
#define CE_PTO 0x0200 |
#define CE_RXOVER 0x0001 |
#define CE_RXPARITY 0x0004 |
#define CE_TXFULL 0x0100 |
#define CLRBREAK 9 |
#define CLRDTR 6 |
#define CLRRTS 4 |
#define CommConfigDialog CommConfigDialogA |
#define COMMPROP_INITIALIZED ((DWORD)0xE73CF52E) |
#define DATABITS_16 ((WORD)0x0010) |
#define DATABITS_16X ((WORD)0x0020) |
#define DATABITS_5 ((WORD)0x0001) |
#define DATABITS_6 ((WORD)0x0002) |
#define DATABITS_7 ((WORD)0x0004) |
#define DATABITS_8 ((WORD)0x0008) |
#define DTR_CONTROL_DISABLE 0x00 |
#define DTR_CONTROL_ENABLE 0x01 |
#define DTR_CONTROL_HANDSHAKE 0x02 |
#define EV_BREAK 0x0040 |
#define EV_CTS 0x0008 |
#define EV_DSR 0x0010 |
#define EV_ERR 0x0080 |
#define EV_EVENT1 0x0800 |
#define EV_EVENT2 0x1000 |
#define EV_PERR 0x0200 |
#define EV_RING 0x0100 |
#define EV_RLSD 0x0020 |
#define EV_RX80FULL 0x0400 |
#define EV_RXCHAR 0x0001 |
#define EV_RXFLAG 0x0002 |
#define EV_TXEMPTY 0x0004 |
#define EVENPARITY 2 |
#define GetDefaultCommConfig GetDefaultCommConfigA |
#define IE_BADID (-1) |
#define IE_BAUDRATE (-12) |
#define IE_BYTESIZE (-11) |
#define IE_DEFAULT (-5) |
#define IE_HARDWARE (-10) |
#define IE_MEMORY (-4) |
#define IE_NOPEN (-3) |
#define IE_OPEN (-2) |
#define IGNORE 0 |
#define IOCTL_SERIAL_CLR_DTR 0x001B0028 |
#define IOCTL_SERIAL_CLR_RTS 0x001B0034 |
#define IOCTL_SERIAL_CONFIG_SIZE 0x001B0080 |
#define IOCTL_SERIAL_GET_BAUD_RATE 0x001B0050 |
#define IOCTL_SERIAL_GET_CHARS 0x001B0058 |
#define IOCTL_SERIAL_GET_COMMSTATUS 0x001B006C |
#define IOCTL_SERIAL_GET_DTRRTS 0x001B0078 |
#define IOCTL_SERIAL_GET_HANDFLOW 0x001B0060 |
#define IOCTL_SERIAL_GET_LINE_CONTROL 0x001B0054 |
#define IOCTL_SERIAL_GET_MODEMSTATUS 0x001B0068 |
#define IOCTL_SERIAL_GET_PROPERTIES 0x001B0074 |
#define IOCTL_SERIAL_GET_TIMEOUTS 0x001B0020 |
#define IOCTL_SERIAL_GET_WAIT_MASK 0x001B0040 |
#define IOCTL_SERIAL_IMMEDIATE_CHAR 0x001B0018 |
#define IOCTL_SERIAL_PURGE 0x001B004C |
#define IOCTL_SERIAL_RESET_DEVICE 0x001B002C |
#define IOCTL_SERIAL_SET_BAUD_RATE 0x001B0004 |
#define IOCTL_SERIAL_SET_BREAK_OFF 0x001B0014 |
#define IOCTL_SERIAL_SET_BREAK_ON 0x001B0010 |
#define IOCTL_SERIAL_SET_CHARS 0x001B005C |
#define IOCTL_SERIAL_SET_DTR 0x001B0024 |
#define IOCTL_SERIAL_SET_HANDFLOW 0x001B0064 |
#define IOCTL_SERIAL_SET_LINE_CONTROL 0x001B000C |
#define IOCTL_SERIAL_SET_QUEUE_SIZE 0x001B0008 |
#define IOCTL_SERIAL_SET_RTS 0x001B0030 |
#define IOCTL_SERIAL_SET_TIMEOUTS 0x001B001C |
#define IOCTL_SERIAL_SET_WAIT_MASK 0x001B0044 |
#define IOCTL_SERIAL_SET_XOFF 0x001B0038 |
#define IOCTL_SERIAL_SET_XON 0x001B003C |
#define IOCTL_SERIAL_WAIT_ON_MASK 0x001B0048 |
#define IOCTL_USBPRINT_GET_1284_ID 0x220034 |
#define LPTx 0x80 |
#define MARKPARITY 3 |
#define MAXULONG (4294967295UL) |
#define MS_CTS_ON ((DWORD)0x0010) |
#define MS_DSR_ON ((DWORD)0x0020) |
#define MS_RING_ON ((DWORD)0x0040) |
#define MS_RLSD_ON ((DWORD)0x0080) |
#define NOPARITY 0 |
WinPR: Windows Portable Runtime Serial Communication API
Copyright 2011 O.S. Systems Software Ltda. Copyright 2011 Eduardo Fiss Beloni belon Copyright 2014 Marc-Andre Moreau i@os syste ms.c om.brmarca Copyright 2014 Hewlett-Packard Development Company, L.P. ndre .more au@g mail. com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
#define ODDPARITY 1 |
#define ONE5STOPBITS 1 |
#define ONESTOPBIT 0 |
#define PARITY_EVEN ((WORD)0x0400) |
#define PARITY_MARK ((WORD)0x0800) |
#define PARITY_NONE ((WORD)0x0100) |
#define PARITY_ODD ((WORD)0x0200) |
#define PARITY_SPACE ((WORD)0x1000) |
#define PCF_16BITMODE ((DWORD)0x0200) |
#define PCF_DTRDSR ((DWORD)0x0001) |
#define PCF_INTTIMEOUTS ((DWORD)0x0080) |
#define PCF_PARITY_CHECK ((DWORD)0x0008) |
#define PCF_RLSD ((DWORD)0x0004) |
#define PCF_RTSCTS ((DWORD)0x0002) |
#define PCF_SETXCHAR ((DWORD)0x0020) |
#define PCF_SPECIALCHARS ((DWORD)0x0100) |
#define PCF_TOTALTIMEOUTS ((DWORD)0x0040) |
#define PCF_XONXOFF ((DWORD)0x0010) |
#define PST_FAX ((DWORD)0x00000021) |
#define PST_LAT ((DWORD)0x00000101) |
#define PST_MODEM ((DWORD)0x00000006) |
#define PST_NETWORK_BRIDGE ((DWORD)0x00000100) |
#define PST_PARALLELPORT ((DWORD)0x00000002) |
#define PST_RS232 ((DWORD)0x00000001) |
#define PST_RS422 ((DWORD)0x00000003) |
#define PST_RS423 ((DWORD)0x00000004) |
#define PST_RS449 ((DWORD)0x00000005) |
#define PST_SCANNER ((DWORD)0x00000022) |
#define PST_TCPIP_TELNET ((DWORD)0x00000102) |
#define PST_UNSPECIFIED ((DWORD)0x00000000) |
#define PST_X25 ((DWORD)0x00000103) |
#define PURGE_RXABORT 0x0002 |
#define PURGE_RXCLEAR 0x0008 |
#define PURGE_TXABORT 0x0001 |
#define PURGE_TXCLEAR 0x0004 |
#define RESETDEV 7 |
#define RTS_CONTROL_DISABLE 0x00 |
#define RTS_CONTROL_ENABLE 0x01 |
#define RTS_CONTROL_HANDSHAKE 0x02 |
#define RTS_CONTROL_TOGGLE 0x03 |
#define SETBREAK 8 |
#define SetDefaultCommConfig SetDefaultCommConfigA |
#define SETDTR 5 |
#define SETRTS 3 |
#define SETXOFF 1 |
#define SETXON 2 |
#define SP_BAUD ((DWORD)0x0002) |
#define SP_DATABITS ((DWORD)0x0004) |
#define SP_HANDSHAKING ((DWORD)0x0010) |
#define SP_PARITY ((DWORD)0x0001) |
#define SP_PARITY_CHECK ((DWORD)0x0020) |
#define SP_RLSD ((DWORD)0x0040) |
#define SP_SERIALCOMM ((DWORD)0x00000001) |
#define SP_STOPBITS ((DWORD)0x0008) |
#define SPACEPARITY 4 |
#define STOPBITS_10 ((WORD)0x0001) |
#define STOPBITS_15 ((WORD)0x0002) |
#define STOPBITS_20 ((WORD)0x0004) |
#define TWOSTOPBITS 2 |
typedef struct COMMCONFIG * LPCOMMCONFIG |
typedef struct COMMPROP * LPCOMMPROP |
typedef struct COMMTIMEOUTS * LPCOMMTIMEOUTS |
enum SERIAL_DRIVER_ID |
IOCTLs table according the server's serial driver: http://msdn.microsoft.com/en-us/library/windows/hardware/dn265347%28v=vs.85%29.aspx
Enumerator | |
---|---|
SerialDriverUnknown | |
SerialDriverSerialSys | |
SerialDriverSerCxSys | |
SerialDriverSerCx2Sys |
WINPR_API const char* _comm_serial_ioctl_name | ( | ULONG | number | ) |
FIXME: got a proper function name and place
WINPR_API BOOL _comm_set_permissive | ( | HANDLE | hDevice, |
BOOL | permissive | ||
) |
FIXME: got a proper function name and place
permissive mode is disabled by default.
WinPR: Windows Portable Runtime Serial Communication API
Copyright 2014 Hewlett-Packard Development Company, L.P.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
WINPR_API void _comm_setServerSerialDriver | ( | HANDLE | hComm, |
SERIAL_DRIVER_ID | driverId | ||
) |
FIXME: got a proper function name and place
Sets
WINPR_API BOOL BuildCommDCBAndTimeoutsA | ( | LPCSTR | lpDef, |
LPDCB | lpDCB, | ||
LPCOMMTIMEOUTS | lpCommTimeouts | ||
) |
WINPR_API BOOL BuildCommDCBAndTimeoutsW | ( | LPCWSTR | lpDef, |
LPDCB | lpDCB, | ||
LPCOMMTIMEOUTS | lpCommTimeouts | ||
) |
WINPR_API BOOL ClearCommBreak | ( | HANDLE | hFile | ) |
WINPR_API BOOL CommConfigDialogA | ( | LPCSTR | lpszName, |
HWND | hWnd, | ||
LPCOMMCONFIG | lpCC | ||
) |
WINPR_API BOOL CommConfigDialogW | ( | LPCWSTR | lpszName, |
HWND | hWnd, | ||
LPCOMMCONFIG | lpCC | ||
) |
WINPR_API HANDLE CommCreateFileA | ( | LPCSTR | lpDeviceName, |
DWORD | dwDesiredAccess, | ||
DWORD | dwShareMode, | ||
LPSECURITY_ATTRIBUTES | lpSecurityAttributes, | ||
DWORD | dwCreationDisposition, | ||
DWORD | dwFlagsAndAttributes, | ||
HANDLE | hTemplateFile | ||
) |
A handle can only be created on defined devices with DefineCommDevice(). This also ensures that CommCreateFileA() has been registered through RegisterHandleCreator().
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363198%28v=vs.85%29.aspx
lpDeviceName | e.g. COM1, ... |
dwDesiredAccess | expects GENERIC_READ | GENERIC_WRITE, a warning message is printed otherwise. TODO: better support. |
dwShareMode | must be zero, INVALID_HANDLE_VALUE is returned otherwise and GetLastError() should return ERROR_SHARING_VIOLATION. |
lpSecurityAttributes | NULL expected, a warning message is printed otherwise. TODO: better support. |
dwCreationDisposition | must be OPEN_EXISTING. If the communication device doesn't exist INVALID_HANDLE_VALUE is returned and GetLastError() returns ERROR_FILE_NOT_FOUND. |
dwFlagsAndAttributes | zero expected, a warning message is printed otherwise. |
hTemplateFile | must be NULL. |
WINPR_API BOOL CommDeviceIoControl | ( | HANDLE | hDevice, |
DWORD | dwIoControlCode, | ||
LPVOID | lpInBuffer, | ||
DWORD | nInBufferSize, | ||
LPVOID | lpOutBuffer, | ||
DWORD | nOutBufferSize, | ||
LPDWORD | lpBytesReturned, | ||
LPOVERLAPPED | lpOverlapped | ||
) |
FIXME: to be moved in comm_ioctl.h
FIXME: to be used through winpr-io's DeviceIoControl
Any previous error as returned by GetLastError is cleared.
ERRORS: ERROR_INVALID_HANDLE ERROR_INVALID_PARAMETER ERROR_NOT_SUPPORTED lpOverlapped is not supported ERROR_INSUFFICIENT_BUFFER ERROR_CALL_NOT_IMPLEMENTED unimplemented ioctl
WINPR_API BOOL CommReadFile | ( | HANDLE | hDevice, |
LPVOID | lpBuffer, | ||
DWORD | nNumberOfBytesToRead, | ||
LPDWORD | lpNumberOfBytesRead, | ||
LPOVERLAPPED | lpOverlapped | ||
) |
FIXME: to be moved in comm_io.h
ERRORS: ERROR_INVALID_HANDLE ERROR_NOT_SUPPORTED ERROR_INVALID_PARAMETER ERROR_TIMEOUT ERROR_IO_DEVICE ERROR_BAD_DEVICE
WINPR_API BOOL CommWriteFile | ( | HANDLE | hDevice, |
LPCVOID | lpBuffer, | ||
DWORD | nNumberOfBytesToWrite, | ||
LPDWORD | lpNumberOfBytesWritten, | ||
LPOVERLAPPED | lpOverlapped | ||
) |
FIXME: to be moved in comm_io.h
ERRORS: ERROR_INVALID_HANDLE ERROR_NOT_SUPPORTED ERROR_INVALID_PARAMETER ERROR_BAD_DEVICE
WINPR_API BOOL DefineCommDevice | ( | LPCTSTR | lpDeviceName, |
LPCTSTR | lpTargetPath | ||
) |
Returns TRUE on success, FALSE otherwise. To get extended error information, call GetLastError.
ERRORS: ERROR_DLL_INIT_FAILED ERROR_OUTOFMEMORY was not possible to get mappings. ERROR_INVALID_DATA was not possible to add the device.
WINPR_API BOOL EscapeCommFunction | ( | HANDLE | hFile, |
DWORD | dwFunc | ||
) |
WINPR_API BOOL GetCommConfig | ( | HANDLE | hCommDev, |
LPCOMMCONFIG | lpCC, | ||
LPDWORD | lpdwSize | ||
) |
WINPR_API BOOL GetCommMask | ( | HANDLE | hFile, |
PDWORD | lpEvtMask | ||
) |
WINPR_API BOOL GetCommModemStatus | ( | HANDLE | hFile, |
PDWORD | lpModemStat | ||
) |
WINPR_API BOOL GetCommProperties | ( | HANDLE | hFile, |
LPCOMMPROP | lpCommProp | ||
) |
ERRORS: ERROR_DLL_INIT_FAILED ERROR_INVALID_HANDLE
ERRORS: ERROR_INVALID_HANDLE ERROR_INVALID_DATA ERROR_IO_DEVICE ERROR_OUTOFMEMORY
WINPR_API BOOL GetCommTimeouts | ( | HANDLE | hFile, |
LPCOMMTIMEOUTS | lpCommTimeouts | ||
) |
ERRORS: ERROR_INVALID_HANDLE
WINPR_API BOOL GetDefaultCommConfigA | ( | LPCSTR | lpszName, |
LPCOMMCONFIG | lpCC, | ||
LPDWORD | lpdwSize | ||
) |
WINPR_API BOOL GetDefaultCommConfigW | ( | LPCWSTR | lpszName, |
LPCOMMCONFIG | lpCC, | ||
LPDWORD | lpdwSize | ||
) |
WINPR_API BOOL IsCommDevice | ( | LPCTSTR | lpDeviceName | ) |
Checks whether lpDeviceName is a valid and registered Communication device.
WINPR_API BOOL PurgeComm | ( | HANDLE | hFile, |
DWORD | dwFlags | ||
) |
WINPR_API DWORD QueryCommDevice | ( | LPCTSTR | lpDeviceName, |
LPTSTR | lpTargetPath, | ||
DWORD | ucchMax | ||
) |
Returns the number of target paths in the buffer pointed to by lpTargetPath.
The current implementation returns in any case 0 and 1 target path. A NULL lpDeviceName is not supported yet to get all the paths.
ERRORS: ERROR_SUCCESS ERROR_DLL_INIT_FAILED ERROR_OUTOFMEMORY was not possible to get mappings. ERROR_NOT_SUPPORTED equivalent QueryDosDevice feature not supported. ERROR_INVALID_DATA was not possible to retrieve any device information. ERROR_INSUFFICIENT_BUFFER too small lpTargetPath
WINPR_API BOOL SetCommBreak | ( | HANDLE | hFile | ) |
WINPR_API BOOL SetCommConfig | ( | HANDLE | hCommDev, |
LPCOMMCONFIG | lpCC, | ||
DWORD | dwSize | ||
) |
WINPR_API BOOL SetCommMask | ( | HANDLE | hFile, |
DWORD | dwEvtMask | ||
) |
As of today, SetCommState() can fail half-way with some settings applied and some others not. SetCommState() returns on the first failure met. FIXME: or is it correct?
ERRORS: ERROR_INVALID_HANDLE ERROR_IO_DEVICE
ioctl calls stage
upcomingTermios stage
WINPR_API BOOL SetCommTimeouts | ( | HANDLE | hFile, |
LPCOMMTIMEOUTS | lpCommTimeouts | ||
) |
ERRORS: ERROR_INVALID_HANDLE
WINPR_API BOOL SetDefaultCommConfigA | ( | LPCSTR | lpszName, |
LPCOMMCONFIG | lpCC, | ||
DWORD | dwSize | ||
) |
WINPR_API BOOL SetDefaultCommConfigW | ( | LPCWSTR | lpszName, |
LPCOMMCONFIG | lpCC, | ||
DWORD | dwSize | ||
) |
WINPR_API BOOL SetupComm | ( | HANDLE | hFile, |
DWORD | dwInQueue, | ||
DWORD | dwOutQueue | ||
) |
WINPR_API BOOL TransmitCommChar | ( | HANDLE | hFile, |
char | cChar | ||
) |
WINPR_API BOOL WaitCommEvent | ( | HANDLE | hFile, |
PDWORD | lpEvtMask, | ||
LPOVERLAPPED | lpOverlapped | ||
) |