command.h
Go to the documentation of this file.
1 
6 #ifndef COMMANDS_H
7 #define COMMANDS_H
8 
9 #include <toposens_driver/TsDriverConfig.h>
10 #define USE_INTERNAL_TEMPERATURE -100.0
11 
12 namespace toposens_driver
13 {
22 enum TsParam
23 {
24  UseExternalTemperature = 0b00000001,
26  EchoRejectionThreshold = 0b00000010,
28  NoiseIndicatorThreshold = 0b00000100,
30  NumberOfPulses = 0b00001000,
32  PeakDetectionWindow = 0b00010000,
34  ExternalTemperature = 0b00100000,
35  ScanMode = 0b01000000,
37 };
38 
40 {
43 };
44 
60 class Command
61 {
62 public:
67  Command(TsParam param, float value);
68 
72  Command(TsService service);
73 
79  TsParam getParam() { return _param; }
80 
86  float getValue() { return _value; }
87 
91  char *getBytes() { return _bytes; }
92 
97  std::string getParamName();
98 
99 private:
100  const int MAX_VALUE = 9999;
101  const int MIN_VALUE = -9999;
102 
103  char _bytes[50];
104  static const char kPrefix = 'C';
106  float _value;
113  std::string _getKey(TsParam param);
114 
119  std::string _getKey(TsService service);
120 };
121 
122 } // namespace toposens_driver
123 
124 #endif
bool param(const std::string &param_name, T &param_val, const T &default_val)
std::string getParamName()
Definition: command.cpp:93
std::string _getKey(TsParam param)
Definition: command.cpp:65
static const char kPrefix
Definition: command.h:104
Command(TsParam param, float value)
Definition: command.cpp:21
Generates firmware-compatible commands for tuning performance parameters.
Definition: command.h:60


toposens_driver
Author(s): Adi Singh, Sebastian Dengler, Christopher Lang, Roua Mokchah, Nancy Seckel, Georgiana Barbut
autogenerated on Mon Feb 28 2022 23:57:40