InertiaSDK

Loading...
Searching...
No Matches
StatusConfig.h
1#pragma once
2
3#include "data/config/LegacyConfig.h"
4
5 namespace inertia
6{
7
9 enum StatusConfigVersion : uint8_t
10{
11 STATUS_V0 = 0,
12 STATUS_V1,
13 STATUS_V2,
14 STATUS_V3,
15 STATUS_V4,
16 STATUS_V5,
17 STATUS_V6,
18 STATUS_V7
19};
20
21 enum StatusMeasurementID : unsigned
22{
23 STATUS_ID_BAT_VOLTAGE = 0,
24 STATUS_ID_BAT_SOC,
25 STATUS_ID_TEMP_INSIDE,
26 STATUS_ID_TEMP_AMBIENT,
27 STATUS_ID_POWER_INPUT_PRESENT,
28 STATUS_ID_POWER_INPUT_VOLTAGE,
29 STATUS_ID_POWER_CONSUMPTION,
30 STATUS_ID_CHARGE_CURRENT,
31 STATUS_ID_LAST,
32};
33
34 struct INERTIA_API StatusConfig
35 : LegacyConfig
36{
37 bool enableBattery; // for STATUS_V0, where it will enable bat, temp and extIn
38 bool enableTemperature; // only STATUS_V1
39 bool enablePowerInput; // only STATUS_V1
40 bool enablePowerConsumption; // only STATUS_V1
41
42 StatusConfigVersion statusVersion;
43 uint8_t samplingChannel;
44 uint16_t interval;
45
46 StatusConfig();
47 StatusConfig(uint8_t const* in);
48 StatusConfig(std::wstring const& argString);
49
50#ifdef WITH_BOOST_PROGRAM_OPTIONS
51 static const po::options_description GetOptionDescription();
52#endif
53
54 static unsigned GetLength();
55 void GetBytes(std::vector<uint8_t>& out) const override;
56 ConfigType GetConfigType() const override;
57 const std::wstring ToString() const override;
58 const std::pair<unsigned, Channel> GetChannel() const;
59};
60
61}
inertia
Definition FlashCommands.h:6
inertia::StatusConfigVersion
StatusConfigVersion
Definition StatusConfig.h:10
inertia::ConfigType
ConfigType
Definition ConfigChannel.h:7