xf.li | bdd93d5 | 2023-05-12 07:10:14 -0700 | [diff] [blame] | 1 | #ifndef CSERIAL_H_INCLUDED |
| 2 | #define CSERIAL_H_INCLUDED |
| 3 | |
| 4 | #include "define.h" |
| 5 | |
| 6 | #define BAUDRATE B115200 |
| 7 | #define READLENGTH 1024 |
| 8 | #define CFLAGS_TO_SET (CREAD | HUPCL) |
| 9 | #define CFLAGS_TO_CLEAR (CSTOPB | PARENB | CLOCAL) |
| 10 | #define CFLAGS_HARDFLOW (CRTSCTS) |
| 11 | |
| 12 | int Open(const char *portName); |
| 13 | int Close(); |
| 14 | /* send AT cmd, and return */ |
| 15 | int SendATString(const char *Dev_tty, const char *AtString, char *RebackString); |
| 16 | BOOL SendData(const BYTE *pbyWriteBuffer, size_t dwWriteCount, DWORD dwSleepAfterAction, DWORD dwTimeoutCount); |
| 17 | BOOL ReadData(BYTE *pbyWriteBuffer, size_t dwWriteCount, DWORD dwSleepAfterAction, DWORD dwTimeoutCount); |
| 18 | BYTE *ReadDataExtraFuncB(DWORD dwReadCount, DWORD dwSleepAfterAction,DWORD dwTimeoutCount); |
| 19 | |
| 20 | #endif // CSERIAL_H_INCLUDED |