blob: 67e67fe8233a5e4f1c84bb48616c750eec33b6bc [file] [log] [blame]
xf.libdd93d52023-05-12 07:10:14 -07001#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
12int Open(const char *portName);
13int Close();
14/* send AT cmd, and return */
15int SendATString(const char *Dev_tty, const char *AtString, char *RebackString);
16BOOL SendData(const BYTE *pbyWriteBuffer, size_t dwWriteCount, DWORD dwSleepAfterAction, DWORD dwTimeoutCount);
17BOOL ReadData(BYTE *pbyWriteBuffer, size_t dwWriteCount, DWORD dwSleepAfterAction, DWORD dwTimeoutCount);
18BYTE *ReadDataExtraFuncB(DWORD dwReadCount, DWORD dwSleepAfterAction,DWORD dwTimeoutCount);
19
20#endif // CSERIAL_H_INCLUDED