123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- #ifndef _INC_ODCOM
- #define _INC_ODCOM
- #include "ODTypes.h"
- typedef tODHandle tPortHandle;
- #define FLOW_NONE 0x00
- #define FLOW_RTSCTS 0x02
- #define FLOW_DEFAULT 0x80
- #define ODPARITY_NONE 0x00
- #define ODPARITY_ODD 0x08
- #define ODPARITY_EVEN 0x18
- #define ODPARITY_MASK 0x18
- #define STOP_ONE 0x00
- #define STOP_ONE_POINT_FIVE 0x04
- #define STOP_TWO 0x04
- #define STOP_MASK 0x04
- #define DATABITS_FIVE 0x00
- #define DATABITS_SIX 0x01
- #define DATABITS_SEVEN 0x02
- #define DATABITS_EIGHT 0x03
- #define DATABITS_MASK 0x03
- #define FIFO_DISABLE 0x00
- #define FIFO_ENABLE 0x01
- #define FIFO_TRIGGER_1 0x00
- #define FIFO_TRIGGER_4 0x40
- #define FIFO_TRIGGER_8 0x80
- #define FIFO_TRIGGER_14 0xc0
- #define SPEED_UNSPECIFIED 0
- #define SIZE_NON_ZERO -1
- typedef enum
- {
- kComMethodUnspecified,
- kComMethodFOSSIL,
- kComMethodUART,
- kComMethodWin32,
- kComMethodDoor32,
- kComMethodSocket,
- kComMethodStdIO
- } tComMethod;
- typedef enum
- {
- kNoCarrier
- } tComEvent;
- tODResult ODComAlloc(tPortHandle *phPort);
- tODResult ODComFree(tPortHandle hPort);
- tODResult ODComSetIdleFunction(tPortHandle hPort,
- void (*pfCallback)(void));
- tODResult ODComSetFlowControl(tPortHandle hPort, BYTE btFlowControlSetting);
- tODResult ODComSetSpeed(tPortHandle hPort, long lSpeed);
- tODResult ODComSetPort(tPortHandle hPort, BYTE btPort);
- tODResult ODComSetIRQ(tPortHandle hPort, BYTE btIRQLevel);
- tODResult ODComSetPortAddress(tPortHandle hPort, int nPortAddress);
- tODResult ODComSetWordFormat(tPortHandle hPort, BYTE btWordFormat);
- tODResult ODComSetRXBuf(tPortHandle hPort, int nReceiveBufferSize);
- tODResult ODComSetTXBuf(tPortHandle hPort, int nTransmitBufferSize);
- tODResult ODComSetFIFO(tPortHandle hPort, BYTE btFIFOSetting);
- tODResult ODComSetPreferredMethod(tPortHandle hPort, tComMethod Method);
- tODResult ODComGetMethod(tPortHandle hPort, tComMethod *pMethod);
- tODResult ODComOpen(tPortHandle hPort);
- tODResult ODComOpenFromExistingHandle(tPortHandle hPort,
- DWORD dwExistingHandle);
- tODResult ODComClose(tPortHandle hPort);
- tODResult ODComClearInbound(tPortHandle hPort);
- tODResult ODComClearOutbound(tPortHandle hPort);
- tODResult ODComInbound(tPortHandle hPort, int *pnInboundWaiting);
- tODResult ODComOutbound(tPortHandle hPort, int *pnOutboundWaiting);
- tODResult ODComCarrier(tPortHandle hPort, BOOL *pbIsCarrier);
- tODResult ODComSetDTR(tPortHandle hPort, BOOL bHigh);
- tODResult ODComSendByte(tPortHandle hPort, BYTE btToSend);
- tODResult ODComGetByte(tPortHandle hPort, char *pbtNext, BOOL bWait);
- tODResult ODComSendBuffer(tPortHandle hPort, BYTE *pbtBuffer, int nSize);
- tODResult ODComGetBuffer(tPortHandle hPort, BYTE *pbtBuffer, int nSize,
- int *pnBytesRead);
- tODResult ODComWaitEvent(tPortHandle hPort, tComEvent Event);
- #endif
|