InertiaSDK

Loading...
Searching...
No Matches
RadioConfig.h
1#pragma once
2
3#include "data/config/LegacyConfig.h"
4
5 namespace inertia
6{
7
8#define RADIO_POWER_DEFAULT 0x0A // default transmit power (certified -10dBm + PA = 10 dBm) (version 0)
9#define RADIO_CHANNEL_DEFAULT 11 // default channel number
10#define RADIO_SLOT_FREQ_DEFAULT 2000 // default slot frequency
11#define RADIO_SLOTS_DEFAULT 40 // default number of slots
12#define RADIO_VERSION_DEFAULT RADIO_V1 // default radio version
13#define RADIO_CHIP_DEFAULT RADIO_A1 // default radio version
14#define RADIO_RATE_DEFAULT 4000 // default transmission rate
15
17 enum RadioConfigVersion : unsigned {
18 RADIO_V0 = 0,
19 RADIO_V1 = 1
20};
21
23 enum RadioChip : unsigned {
24 RADIO_CC2430 = 0,
25 RADIO_CC2530 = 1,
26 RADIO_A0 = 2,
27 RADIO_A1 = 3
28};
29
30 struct INERTIA_API RadioConfig
31 : LegacyConfig
32{
33 bool highGain; // true for enabling High Gain Mode (HGM) (only radio V0)
34 bool listenAllSlots; // true for enabling listening in all slots
35 bool radioEnabled; // true for enabling the radio (only radio V1)
36 bool worEnabled;
37 RadioConfigVersion radioConfigVersion; // radio config version
38 RadioChip radioChip; // type of radio chip
39 uint8_t transmitPower; // for config V0
40 int8_t transmitdBm; // for config V1
41 uint8_t channel;
42 uint16_t slotFrequency; // in hertz
43 uint8_t nSlots; // number of slots
44 uint16_t transmissionRate; // in kbps
45 uint8_t worEventChannel;
46
47 RadioConfig();
48 RadioConfig(uint8_t const* in);
49 RadioConfig(std::wstring const& argString);
50
51#ifdef WITH_BOOST_PROGRAM_OPTIONS
52 static const po::options_description GetOptionDescription();
53#endif
54
55 static unsigned GetLength(uint8_t const* in);
56 void GetBytes(std::vector<uint8_t>& out) const override;
57 ConfigType GetConfigType() const override;
58 const std::wstring ToString() const override;
59 const std::wstring ToSimpleString() const;
60};
61
62}
inertia
Definition FlashCommands.h:6
inertia::RadioChip
RadioChip
Definition RadioConfig.h:23
inertia::RadioConfigVersion
RadioConfigVersion
Definition RadioConfig.h:17
inertia::ConfigType
ConfigType
Definition ConfigChannel.h:7