forked from NOVACProject/MobileDOAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSerialConnection.h
More file actions
45 lines (32 loc) · 998 Bytes
/
SerialConnection.h
File metadata and controls
45 lines (32 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
class CSerialConnection
{
public:
CSerialConnection(void);
~CSerialConnection(void);
bool Init(long speed);
int Check(long timeOut);
void Write(void *ptTxt,long byteNum);
long Read(void *ptBuf,long byteNum);
void FlushSerialPort(long timeOut);
void Close();
int InitCommunication();
int ChangeBaudRate();
void CloseAll();
int ResetSpectrometer(long speed);
/* data definition */
char serbuf[10]; // the serial communication buffer
int serbufpt; // current character is serbuf[serbufpt]
char serialPort[20];
long m_delay; /* communication delay */
long baudrate; // spectrometer baudrate
long sysBaud; // system baudrate
long br2;
long br1;
BOOL *fRun; /* pointer to spectrometer->runFlag */
CString *statusMsg; /* pointer to spectrometer->m_statusMsg */
// ErrorLogHandler errorLog; /* same error handler as spectrometer uses */
int startChn, stopChn;
HANDLE hComm;
private:
};