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
|
// SPDX-License-Identifier: BSD-3-Clause
#ifndef INVERTER_TOOLS_COMMON_H
#define INVERTER_TOOLS_COMMON_H
#include "formatter/formatter.h"
enum class DeviceType {
USB,
Serial,
Pseudo
};
enum class Protocol {
P17,
P18,
};
// long opts
enum {
LO_HELP = 1000,
LO_VERBOSE,
LO_RAW,
LO_PROTOCOL,
LO_TIMEOUT,
LO_CACHE_TIMEOUT,
LO_DELAY,
LO_FORMAT,
LO_DEVICE,
LO_DEVICE_ERROR_LIMIT,
LO_USB_VENDOR_ID,
LO_USB_DEVICE_ID,
LO_SERIAL_NAME,
LO_SERIAL_BAUD_RATE,
LO_SERIAL_DATA_BITS,
LO_SERIAL_STOP_BITS,
LO_SERIAL_PARITY,
LO_HOST,
LO_PORT,
};
formatter::Format format_from_string(std::string& s);
Protocol protocol_from_string(std::string& s);
#endif //INVERTER_TOOLS_COMMON_H
|