#include <windows.h>
#include <winioctl.h>
#include <tchar.h>
#include <stdio.h>
#include "rs232.h"
Go to the source code of this file.
◆ Rs232ClosePortWin32()
◆ Rs232ConfigurePortWin32()
BOOL Rs232ConfigurePortWin32 |
( |
TCHAR * |
DeviceControlString | ) |
|
Definition at line 96 of file rs232.c.
97{
100
101#if 0
103 {
105
107
109 }
110
111 dcb.BaudRate = BaudRate;
113 dcb.Parity = Parity;
116 dcb.fDsrSensitivity =
FALSE;
121 dcb.fAbortOnError =
TRUE;
122 dcb.fOutxCtsFlow =
FALSE;
123 dcb.fOutxDsrFlow =
FALSE;
125 dcb.fDsrSensitivity =
FALSE;
127 dcb.fOutxCtsFlow =
FALSE;
128 dcb.fOutxCtsFlow =
FALSE;
129#endif
130
132 dcb.DCBlength = sizeof(dcb);
134 {
136
138
140 }
141
143 {
145
147
149 }
150
151
153 {
155 }
156
158}
BOOL WINAPI SetCommState(HANDLE handle, LPDCB lpdcb)
BOOL WINAPI GetCommState(HANDLE handle, LPDCB lpdcb)
BOOL Rs232SetCommunicationTimeoutsWin32(DWORD ReadIntervalTimeout, DWORD ReadTotalTimeoutMultiplier, DWORD ReadTotalTimeoutConstant, DWORD WriteTotalTimeoutMultiplier, DWORD WriteTotalTimeoutConstant)
_In_ NDIS_ERROR_CODE ErrorCode
DWORD WINAPI GetLastError(void)
#define DTR_CONTROL_DISABLE
#define RTS_CONTROL_DISABLE
Referenced by Rs232Thread().
◆ Rs232OpenPortWin32()
Definition at line 32 of file rs232.c.
33{
36
37
38
40 {
41 _tprintf(
TEXT(
"Port handle not NULL. Must be already open. Returning FALSE...\n"));
43 }
44
46
49 0,
50 0,
52 0,
53 0);
54
56 {
59
61
63 }
64
66}
static UNICODE_STRING PortName
#define INVALID_HANDLE_VALUE
Referenced by Rs232Thread().
◆ Rs232ReadByteWin32()
BOOL Rs232ReadByteWin32 |
( |
BYTE * |
DataByte | ) |
|
Definition at line 215 of file rs232.c.
216{
219
220
222 {
224
226
228 }
229
230
231
233 {
235 }
236
238}
#define ReadFile(a, b, c, d, e)
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Referenced by Rs232Thread().
◆ Rs232SetCommunicationTimeoutsWin32()
BOOL Rs232SetCommunicationTimeoutsWin32 |
( |
DWORD |
ReadIntervalTimeout, |
|
|
DWORD |
ReadTotalTimeoutMultiplier, |
|
|
DWORD |
ReadTotalTimeoutConstant, |
|
|
DWORD |
WriteTotalTimeoutMultiplier, |
|
|
DWORD |
WriteTotalTimeoutConstant |
|
) |
| |
Definition at line 183 of file rs232.c.
184{
187
189 {
191
193
195 }
196
202
204 {
206
208
210 }
211
213}
BOOL WINAPI SetCommTimeouts(HANDLE hComm, LPCOMMTIMEOUTS lptimeouts)
BOOL WINAPI GetCommTimeouts(HANDLE hComm, LPCOMMTIMEOUTS lptimeouts)
DWORD WriteTotalTimeoutConstant
DWORD ReadTotalTimeoutMultiplier
DWORD ReadTotalTimeoutConstant
DWORD ReadIntervalTimeout
DWORD WriteTotalTimeoutMultiplier
Referenced by Rs232ConfigurePortWin32().
◆ Rs232WriteByteWin32()
BOOL Rs232WriteByteWin32 |
( |
BYTE |
DataByte | ) |
|
Definition at line 240 of file rs232.c.
241{
245
247
249 {
251
253
255 }
256
258}
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Referenced by Rs232Thread().
◆ hPortHandle