forked from IntelRealSense/RealSenseID
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommonTypes.h
44 lines (37 loc) · 912 Bytes
/
CommonTypes.h
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
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2020-2021 Intel Corporation. All Rights Reserved.
#pragma once
#include <chrono>
// enable [[nodiscard]] if c++17 is available
#if __cplusplus >= 201703L
#define RSID_NO_DISCARD [[nodiscard]]
#else
#define RSID_NO_DISCARD
#endif //__cplusplus
namespace RealSenseID
{
namespace PacketManager
{
struct SerialConfig
{
const char* port = nullptr;
unsigned int baudrate = 115200;
unsigned char bytesize = 8;
unsigned char stopbits = 0; // 0=1 stopbits, 1=1.5 stopbits, 2=2 stopbits
unsigned char parity = 0;
};
enum class RSID_NO_DISCARD SerialStatus
{
Ok = 100,
OpenFailed,
SendFailed,
RecvTimeout,
RecvFailed,
RecvUnexpectedPacket,
SecurityError,
VersionMismatch,
CrcError
};
using timeout_t = std::chrono::milliseconds;
} // namespace PacketManager
} // namespace RealSenseID