InertiaSDK

Loading...
Searching...
No Matches
GlobalSamplingConfig.h
1#pragma once
2
3#include "data/config/LegacyConfig.h"
4
5 namespace inertia
6{
7
8#define SAMPLING_FREQ_DEFAULT 200
9#define SAMPLING_FRAME_SIZE_DEFAULT 4
10
12 enum TransmitType {
13 TRANSMIT_NONE = 0,
14 TRANSMIT_RADIO = 0x01,
15 TRANSMIT_SERIAL = 0x02,
16 TRANSMIT_BLUETOOTH = 0x04,
17 TRANSMIT_RADIO_SERIAL = TRANSMIT_RADIO | TRANSMIT_SERIAL,
18 TRANSMIT_RADIO_BLUETOOTH = TRANSMIT_RADIO | TRANSMIT_BLUETOOTH,
19 TRANSMIT_SERIAL_BLUETOOTH = TRANSMIT_SERIAL | TRANSMIT_BLUETOOTH,
20 TRANSMIT_RADIO_SERIAL_BLUETOOTH = TRANSMIT_RADIO | TRANSMIT_SERIAL | TRANSMIT_BLUETOOTH
21};
22
24 enum SamplingTimerSource {
25 SAMPLING_TIMER_HIGH_FREQ = 0,
26 SAMPLING_TIMER_LOW_FREQ = 1
27};
28
30 enum SamplingTriggerSource {
31 SAMPLING_TRIGGER_FASTMAC = 0,
32 SAMPLING_TRIGGER_NONE = 1
33};
34
35 struct INERTIA_API GlobalSamplingConfig
36 : LegacyConfig
37{
38 bool globalEnable;
39 bool transmitEnable;
40 bool zeroPackets;
41 bool disableAutoStart;
42 bool bootEventChannelEnabled;
43
44 uint16_t freq;
45 SamplingTimerSource timerSource;
46 SamplingTriggerSource triggerSource;
47 uint8_t frameSize;
48 uint8_t transmitTypes;
49 uint8_t bootEventChannel;
50
51 GlobalSamplingConfig();
52 GlobalSamplingConfig(uint8_t const* in);
53 GlobalSamplingConfig(std::wstring const& argString);
54
55#ifdef WITH_BOOST_PROGRAM_OPTIONS
56 static const po::options_description GetOptionDescription();
57#endif
58
59 static unsigned GetLength();
60 void GetBytes(std::vector<uint8_t>& out) const override;
61 ConfigType GetConfigType() const override;
62 static bool CheckTransmitType(uint8_t input, TransmitType type);
63 bool CheckTransmitType(TransmitType type) const;
64 const std::wstring ToString() const override;
65 const std::wstring ToSimpleString() const;
66};
67
68}
inertia
Definition FlashCommands.h:6
inertia::SamplingTimerSource
SamplingTimerSource
Definition GlobalSamplingConfig.h:24
inertia::ConfigType
ConfigType
Definition ConfigChannel.h:7
inertia::SamplingTriggerSource
SamplingTriggerSource
Definition GlobalSamplingConfig.h:30
inertia::TransmitType
TransmitType
Definition GlobalSamplingConfig.h:12