123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
-
- #ifndef __CSERIALPORT_GLOBAL_H__
- #define __CSERIALPORT_GLOBAL_H__
- #include "osplatformutil.h"
- #include <iostream>
- #ifdef I_OS_WIN
- #if defined(__MINGW32__) || defined(__MINGW64__)
- typedef long long int64;
- #else
- typedef __int64 int64;
- #endif
- #define DLL_EXPORT __declspec(dllexport)
- #elif defined I_OS_UNIX
- #define DLL_EXPORT __attribute__((visibility("default")))
- #else
- #endif
- #ifdef _UNICODE
- #ifndef UNICODE
- #define UNICODE
- #endif
- #endif
- #ifdef UNICODE
- #ifndef _UNICODE
- #define _UNICODE
- #endif
- #endif
- namespace itas109
- {
- enum OperateMode
- {
- AsynchronousOperate,
- SynchronousOperate
- };
- enum BaudRate
- {
- BaudRate110 = 110,
- BaudRate300 = 300,
- BaudRate600 = 600,
- BaudRate1200 = 1200,
- BaudRate2400 = 2400,
- BaudRate4800 = 4800,
- BaudRate9600 = 9600,
- BaudRate14400 = 14400,
- BaudRate19200 = 19200,
- BaudRate38400 = 38400,
- BaudRate56000 = 56000,
- BaudRate57600 = 57600,
- BaudRate115200 = 115200,
- BaudRate921600 = 921600
- };
- enum DataBits
- {
- DataBits5 = 5,
- DataBits6 = 6,
- DataBits7 = 7,
- DataBits8 = 8
- };
- enum Parity
- {
- ParityNone = 0,
- ParityOdd = 1,
- ParityEven = 2,
- ParityMark = 3,
- ParitySpace = 4,
- };
- enum StopBits
- {
- StopOne = 0,
- StopOneAndHalf = 1,
- StopTwo = 2
- };
- enum FlowControl
- {
- FlowNone = 0,
- FlowHardware = 1,
- FlowSoftware = 2
- };
- enum SerialPortError
- {
- SystemError = -1,
- NoError = 0,
- DeviceNotFoundError,
- PermissionError,
- OpenError,
- ParityError,
- FramingError,
- BreakConditionError,
- WriteError,
- ReadError,
- ResourceError,
- UnsupportedOperationError,
- UnknownError,
- TimeoutError,
- NotOpenError,
- InvalidParameterError
- };
- }
- #endif
|