EHS
COM.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/EHS.h"
4
5namespace ehs
6{
7 enum class Parity : UInt_8
8 {
9 NONE,
10 ODD,
11 EVEN,
12 MARK,
13 SPACE
14 };
15
16 enum class StopBits : UInt_8
17 {
18 ONE,
20 TWO
21 };
22
23 class EHS_LIB_IO COM
24 {
25 private:
26 UInt_8 port;
27 UInt_32 baudRate;
28 UInt_8 byteSize;
29 Parity parity;
30 StopBits stopBits;
31 void* hdl;
32 bool initialized;
33
34 public:
35 COM();
36
37 COM(const UInt_8 port, const UInt_32 baudRate, const UInt_8 byteSize, const Parity parity, const StopBits stopBits);
38
39 COM(const COM& com) = default;
40
41 void Initialize();
42
43 void UnInitialize();
44
45 UInt_32 Wait();
46
47 void Transmit(const Char_8 data);
48
49 UInt_32 Send(const Char_8* data, const UInt_32 size);
50
51 UInt_32 Receive(const Char_8* data, const UInt_32 size);
52
53 void Flush();
54 };
55}
Definition: COM.h:24
COM(const COM &com)=default
Definition: Anchor.h:6
Parity
Definition: COM.h:8
unsigned int UInt_32
Definition: Types.h:49
char Char_8
Definition: Types.h:40
unsigned char UInt_8
Definition: Types.h:43
EHS_LIB_IO void Initialize(Str_8 appName, Str_8 appVerId, const Version &appVer)
Definition: EHS.cpp:34
StopBits
Definition: COM.h:17