mcuApi.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <boost/function.hpp>
9 #include <boost/system/error_code.hpp>
10 #include <boost/shared_ptr.hpp>
11 #include <list>
12 
13 #include "mcuTypes.h"
14 #include "firmware.h"
15 
16 class McuClient;
17 
23 namespace dpyMcu {
29 
33 {
34  RED = 1,
35  BLUE = 2,
36  GREEN = 3,
37  MAGENTA = 4,
38  YELLOW = 5,
39  CYAN = 6,
40  UNDEFINED = 7
41 };
42 
45 {
46  N_A = 1,
47  POWER_ON = 2,
48  REBOOT = 3,
49  STANDBY = 4,
50  HALT = 5,
51  ABORT = 6,
53 };
54 
56  GPI1 = 1,
57  GPI2 = 2,
58  GPI3 = 3,
59  GPI4 = 4,
60  GPI5 = 5,
61  GPI6 = 6,
62  GPI7 = 7,
63  GPI8 = 8,
64  BUTTON1 = 9,
65  BUTTON2 = 10,
66  BUTTON3 = 11,
67  BUTTON4 = 12,
68  BUTTON5 = 13,
69  BUTTON6 = 14,
70  BUTTON7 = 15,
71  BUTTON8 = 16,
72  POWER_BUTTON = 17,
73  ODO = 18,
74  ODO_REDU = 19,
75  IGN = 20,
76  GPO1 = 21,
77  GPO2 = 22,
78  GPO3 = 23,
79  GPO4 = 24,
80  GPO5 = 25,
81  GPO6 = 26,
82  GPO7 = 27,
83  GPO8 = 28
84 };
85 
87 enum Result {
88  OK = 0,
89  ERROR = 1
90 };
92 
98 struct LedsConfig
101 {
102  std::string timestamp;
104  std::uint32_t period;
105  std::uint32_t duty_cycle;
106 };
107 
110 {
111  std::string timestamp;
112  std::uint32_t gpio;
113  bool value;
114 };
115 
117 struct I2CValue
118 {
119  int bus;
120  int device;
121  std::list<int> address;
122  std::list<int> values;
123 };
124 
127 {
128  std::string timestamp;
129  std::string partition_written;
130 };
131 
134 {
135  std::string timestamp;
136  bool ignition;
140  std::int32_t temperature;
141  bool fault;
143 };
144 
147 {
148  std::string timestamp;
150  std::uint32_t event_flags;
152 };
153 
156 {
157  std::string timestamp;
158  std::uint32_t timer_standby_minutes;
159  std::uint32_t timer_halt_minutes;
160 };
161 
164 {
165  std::string timestamp;
166  std::string part_number;
167  std::string serial_number;
168  std::string cidl_number;
169 };
170 
173 {
174  std::list<struct GUIDConfig> guids;
175 };
176 
179 {
180  std::string timestamp;
181  std::uint32_t power_on_hours_working;
182  std::uint32_t standby_hours_working;
183  std::uint32_t halt_hours_working;
184 };
185 
187 struct MCUStatus
188 {
189  std::string timestamp;
190  std::uint32_t hardware_exceptions;
191  std::uint32_t software_exceptions;
192 };
193 
196 {
197  std::string timestamp;
198  float idle_voltage;
201  std::uint32_t grace_period_minutes;
202 };
203 
206 {
207  std::string timestamp;
208  std::uint32_t seconds;
209  std::uint32_t minutes;
210  std::uint32_t hours;
211  std::uint32_t day;
212  std::uint32_t month;
213  std::uint32_t year;
214 };
216 
221 typedef boost::function<void(const bool &available)> service_availability_handler;
222 
228 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::PowerInformationConfig &)> power_mng_handler_function;
234 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::LedsConfig &)> leds_handler_function;
240 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::PowerStateConfig &)> power_states_handler_function;
246 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::TimersConfig &)> timers_handler_function;
252 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::UpdateConfig &)> update_firmware_handler_function;
258 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::GUIDConfigList &)> guid_handler_function;
265 typedef boost::function<void(boost::system::error_code error_code, char &, char &)> eqvar_handler_function;
271 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::WorkingTimeConfig &)> working_time_handler_function;
277 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::MCUStatus &)> mcu_status_handler_function;
283 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::BatteryProtectionConfig &)> battery_protection_handler_function;
289 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::DateConfig &)> rtc_date_handler_function;
295 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::GpioConfig &)> gpio_handler_function;
301 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::GpiosAvailable &)> gpios_events_handler_function;
307 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::I2CValue &)> i2c_handler_function;
313 typedef boost::function<void(boost::system::error_code error_code, const dpyFirmware::FirmwareVersionInfo& fw_version)> version_handler_function;
319 typedef boost::function<void(boost::system::error_code error_code, dpyMcu::CanStatusEvent &)> can_status_handler_function;
320 
325 typedef boost::function<void(boost::system::error_code error_code)> test_misc_handler_function;
326 
331 typedef boost::function<void(boost::system::error_code error_code)> set_power_button_state_handler_function;
332 
338 typedef boost::function<void(boost::system::error_code error_code, bool enabled)> get_power_button_state_handler_function;
339 
344 typedef boost::function<void(boost::system::error_code error_code)> result_handler_function;
345 
346 }
347 
353 class Mcu
354 {
355 protected:
359  boost::shared_ptr<McuClient> mClient;
360 public:
365  explicit Mcu(std::string ip = "127.0.0.1");
366 
370  virtual ~Mcu();
371 
373 #ifndef TESTING
374 
378  bool isAlive();
379 
380  void monitorServiceAvailability_S(dpyMcu::service_availability_handler handler);
381  void monitorServiceAvailability_U();
382 
388 
396  void asyncSetLedsConfig(dpyMcu::leds_handler_function handler, dpyMcu::LedsColor color, std::uint32_t period, std::uint32_t duty_cycle);
397 
409  void asyncSetBatteryProtectionConfig(dpyMcu::battery_protection_handler_function handler, float idle_voltage, float voltage_percentage_threshold,
410  float hysteresis_percentage, std::uint32_t grace_period_minutes);
411 
417 
423 
429  boost::system::error_code getRtcDateConfig(dpyMcu::DateConfig & config);
430 
436 
442 
448 
454  virtual boost::system::error_code getGUIDValues( dpyMcu::GUIDConfigList &guid_list);
455 
456 
462 
469  virtual boost::system::error_code getEQVar(char &eq_id, char &var_id);
470 
476 
482 
488 
494 
500  void asyncGetGpioValue(dpyMcu::gpio_handler_function handler, std::uint32_t gpio_number);
501 
508  void asyncSetGpioValue(dpyMcu::gpio_handler_function handler, std::uint32_t gpio_number, bool gpio_value);
509 
515 
524  void asyncGetI2CValue(dpyMcu::i2c_handler_function handler, unsigned char busid, unsigned char deviceid, std::list<unsigned char> address, int lenght);
525 
535  void asyncSetI2CValue(dpyMcu::i2c_handler_function handler, unsigned char busid, unsigned char deviceid, std::list<unsigned char> address, std::list<unsigned char> values);
536 
543 
547  void getPowerInformation_U();
548 
549 
560  boost::system::error_code setI2CValue(unsigned char busid, unsigned char deviceid, std::list<unsigned char> address, std::list<unsigned char> values,dpyMcu::I2CValue& result);
561 
572  boost::system::error_code getI2CValue(unsigned char busid, unsigned char deviceid, std::list<unsigned char> address, int length,dpyMcu::I2CValue& result);
573 
579 
580 
581 #else
582  virtual bool isAlive();
584  virtual void asyncSetLedsConfig(dpyMcu::leds_handler_function handler, dpyMcu::LedsColor color, std::uint32_t period, std::uint32_t duty_cycle);
585  virtual void asyncSetBatteryProtectionConfig(dpyMcu::battery_protection_handler_function handler, float idle_voltage, float voltage_percentage_threshold, float hysteresis_percentage, std::uint32_t grace_period_minutes);
588  virtual boost::system::error_code getRtcDateConfig(dpyMcu::DateConfig & config);
592  virtual boost::system::error_code getGUIDValues( dpyMcu::GUIDConfigList &guid_list);
593  virtual void asyncGetEQVar(dpyMcu::eqvar_handler_function handler);
594  virtual boost::system::error_code getEQVar(char &eq_id, char &var_id);
599  virtual void asyncGetGpioValue(dpyMcu::gpio_handler_function handler, std::uint32_t gpio_number);
600  virtual void asyncSetGpioValue(dpyMcu::gpio_handler_function handler, std::uint32_t gpio_number, bool gpio_value);
603  virtual void getPowerInformation_U();
604  virtual boost::system::error_code setI2CValue(unsigned char busid, unsigned char deviceid, std::list<unsigned char> address, std::list<unsigned char> values,dpyMcu::I2CValue& value);
605  virtual boost::system::error_code getI2CValue(unsigned char busid, unsigned char deviceid, std::list<unsigned char> address, int lenght,dpyMcu::I2CValue& value);
606 
607 #endif
608 };
bool fault
fault
Definition: mcuApi.h:141
@ GPO6
GPO6.
Definition: mcuApi.h:81
std::string cidl_number
CIDL Number of the equipment.
Definition: mcuApi.h:168
void asyncGetPowerInformation(dpyMcu::power_mng_handler_function handler)
Method which requests one message with Power information coming from the service periodically.
boost::function< void(boost::system::error_code error_code, dpyMcu::BatteryProtectionConfig &)> battery_protection_handler_function
Prototype of the handler function for obtaining the Battery Protection Configuration.
Definition: mcuApi.h:283
std::uint32_t day
day
Definition: mcuApi.h:211
Working Time struct which contains the response received from the service.
Definition: mcuApi.h:178
std::string timestamp
timestamp
Definition: mcuApi.h:128
void getPowerInformation_U()
Method to stop receiving Power information coming from the service periodically.
std::uint32_t period
Period in seconds (range: 0 - 10)
Definition: mcuApi.h:104
MCU Status struct which contains the response received from the service.
Definition: mcuApi.h:187
boost::function< void(boost::system::error_code error_code, const dpyFirmware::FirmwareVersionInfo &fw_version)> version_handler_function
Prototype of the handler function for obtaining the fw version.
Definition: mcuApi.h:313
@ HALT
Halt.
Definition: mcuApi.h:50
void asyncSetGpioValue(dpyMcu::gpio_handler_function handler, std::uint32_t gpio_number, bool gpio_value)
Method which requests to set a GPIO pin with a value.
@ POWER_BUTTON
POWER_BUTTON.
Definition: mcuApi.h:72
boost::system::error_code getRtcDateConfig(dpyMcu::DateConfig &config)
Method which requests to get RTC date configuration values.
boost::function< void(boost::system::error_code error_code, dpyMcu::GpiosAvailable &)> gpios_events_handler_function
Prototype of the handler function for obtaining the GPIO Events.
Definition: mcuApi.h:301
void asyncSetI2CValue(dpyMcu::i2c_handler_function handler, unsigned char busid, unsigned char deviceid, std::list< unsigned char > address, std::list< unsigned char > values)
Method which requests to set a I2C address pin with a value.
std::string timestamp
timestamp
Definition: mcuApi.h:102
DateConfig struct which contains the response received from the service.
Definition: mcuApi.h:205
float voltage_percentage_over_idle_voltage_threshold
voltage percentage threshold calculated over idle voltage
Definition: mcuApi.h:199
void asyncGetRtcDateConfig(dpyMcu::rtc_date_handler_function handler)
Method which requests to get RTC date configuration values.
PowerInformation struct which contains the response received from the service.
Definition: mcuApi.h:146
@ GPI7
GPI7.
Definition: mcuApi.h:62
std::string timestamp
timestamp
Definition: mcuApi.h:197
float idle_voltage
idle voltage identified by ignition position off, engine off and stationary vehicle
Definition: mcuApi.h:198
@ GPI4
GPI4.
Definition: mcuApi.h:59
boost::function< void(boost::system::error_code error_code, dpyMcu::UpdateConfig &)> update_firmware_handler_function
Prototype of the handler function for obtaining the updated configuration.
Definition: mcuApi.h:252
std::uint32_t year
year
Definition: mcuApi.h:213
@ POWER_ON
Power On.
Definition: mcuApi.h:47
GPIO Struct which contains the response received from the service.
Definition: mcuApi.h:109
LedsColor color
state
Definition: mcuApi.h:103
Result result
result
Definition: mcuApi.h:151
boost::function< void(boost::system::error_code error_code, dpyMcu::PowerStateConfig &)> power_states_handler_function
Prototype of the handler function for obtaining the Power State Configuration.
Definition: mcuApi.h:240
boost::function< void(boost::system::error_code error_code, dpyMcu::WorkingTimeConfig &)> working_time_handler_function
Prototype of the handler function for obtaining the Working Time Values.
Definition: mcuApi.h:271
std::uint32_t halt_hours_working
Halt hours working.
Definition: mcuApi.h:183
virtual ~Mcu()
Destructor of the class.
bool value
GPIO value (values: 0 or 1)
Definition: mcuApi.h:113
std::uint32_t timer_halt_minutes
Halt Timer.
Definition: mcuApi.h:159
@ RED
RED.
Definition: mcuApi.h:34
@ ODO_REDU
ODO_REDU.
Definition: mcuApi.h:74
std::uint32_t timer_standby_minutes
Standby Timer.
Definition: mcuApi.h:158
std::string timestamp
timestamp
Definition: mcuApi.h:148
boost::shared_ptr< McuClient > mClient
Reference to an Client Object.
Definition: mcuApi.h:359
GUID struct which contains the response received from the service.
Definition: mcuApi.h:163
std::string serial_number
Serial Number of the equipment.
Definition: mcuApi.h:167
std::string timestamp
timestamp
Definition: mcuApi.h:157
boost::function< void(boost::system::error_code error_code, char &, char &)> eqvar_handler_function
Prototype of the handler function for obtaining the GUIDs.
Definition: mcuApi.h:265
Timers struct which contains the response received from the service.
Definition: mcuApi.h:155
std::uint32_t power_on_hours_working
Power-On hours working.
Definition: mcuApi.h:181
void getPowerInformation_S(dpyMcu::power_mng_handler_function handler)
Method which receives one message with Power information coming from the service periodically.
float hysteresis_percentage_over_idle_voltage
hysteresis percentage calculated over idle voltage
Definition: mcuApi.h:200
@ BUTTON8
BUTTON8.
Definition: mcuApi.h:71
std::list< int > address
memory address
Definition: mcuApi.h:121
void asyncUpdateMCU(dpyMcu::update_firmware_handler_function handler)
Method which updates the firmware of the MCU (the new image must be in the right PATH of the system)
LedsColor
Possible color to be set.
Definition: mcuApi.h:32
virtual boost::system::error_code getGUIDValues(dpyMcu::GUIDConfigList &guid_list)
Method which requests to get GUID values.
@ CYAN
CYAN.
Definition: mcuApi.h:39
PowerStates
Possible power state to be set.
Definition: mcuApi.h:44
void asyncSetBatteryProtectionConfig(dpyMcu::battery_protection_handler_function handler, float idle_voltage, float voltage_percentage_threshold, float hysteresis_percentage, std::uint32_t grace_period_minutes)
Method which requests to set battery protection configuration values.
std::list< int > values
i2c values
Definition: mcuApi.h:122
@ BUTTON4
BUTTON4.
Definition: mcuApi.h:67
boost::function< void(boost::system::error_code error_code)> test_misc_handler_function
Prototype of the handler function for obtaining the current MISC status.
Definition: mcuApi.h:325
boost::function< void(boost::system::error_code error_code, dpyMcu::TimersConfig &)> timers_handler_function
Prototype of the handler function for obtaining the Timers Configuration.
Definition: mcuApi.h:246
void asyncGetGpioValue(dpyMcu::gpio_handler_function handler, std::uint32_t gpio_number)
Method which requests one message with GPIO information.
boost::function< void(boost::system::error_code error_code, dpyMcu::PowerInformationConfig &)> power_mng_handler_function
Prototype of the handler function for obtaining the Power Information.
Definition: mcuApi.h:228
boost::function< void(boost::system::error_code error_code, dpyMcu::DateConfig &)> rtc_date_handler_function
Prototype of the handler function for obtaining the RTC Date Configuration.
Definition: mcuApi.h:289
@ GPO5
GPO5.
Definition: mcuApi.h:80
void asyncGetWorkingTimeValues(dpyMcu::working_time_handler_function handler)
Method which requests one message with the Power-On, Standby and Halt States working hours.
void asyncGetLedsConfig(dpyMcu::leds_handler_function handler)
Method which requests the LED color state.
std::uint32_t hours
hours
Definition: mcuApi.h:210
std::uint32_t event_flags
set flags to enter in power state
Definition: mcuApi.h:150
boost::function< void(boost::system::error_code error_code)> set_power_button_state_handler_function
Prototype of the handler function for obtaining the result of power button.
Definition: mcuApi.h:331
@ UNDEFINED
UNDEFINED.
Definition: mcuApi.h:40
It contains the current CAN Bus status defined in its timestamp.
Definition: mcuTypes.h:33
void asyncGetBatteryProtectionConfig(dpyMcu::battery_protection_handler_function handler)
Method which requests to get battery protection configuration values.
std::string timestamp
timestamp
Definition: mcuApi.h:180
void asyncGetEQVar(dpyMcu::eqvar_handler_function handler)
Method which requests to get EQ/Var values.
@ BUTTON6
BUTTON6.
Definition: mcuApi.h:69
@ GPO1
GPO1.
Definition: mcuApi.h:76
std::string partition_written
partition_written
Definition: mcuApi.h:129
@ BUTTON3
BUTTON3.
Definition: mcuApi.h:66
@ MAGENTA
MAGENTA.
Definition: mcuApi.h:37
PowerInformation struct which contains the response received from the service.
Definition: mcuApi.h:133
std::uint32_t minutes
minutes
Definition: mcuApi.h:209
boost::function< void(boost::system::error_code error_code)> result_handler_function
Prototype of the handler function for obtaining the result of the operations status.
Definition: mcuApi.h:344
@ GPO7
GPO7.
Definition: mcuApi.h:82
void asyncGetGpiosEvents(dpyMcu::gpios_events_handler_function handler)
Method which receives one message with Gpios events coming from the service.
Battery Protection Config struct which contains the response received from the service.
Definition: mcuApi.h:195
Class which interfaces with the API logic.
Definition: mcuApi.h:353
A structure use to store firmware info.
Definition: firmware.h:30
void asyncGetCanStatus(dpyMcu::can_status_handler_function handler)
Method to get the current CAN Bus status.
@ BUTTON1
BUTTON1.
Definition: mcuApi.h:64
Deepsy Mcu namespace that includes the different enums, structs or method signatures that should be u...
Definition: mcuApi.h:16
void asyncGetMCUStatus(dpyMcu::mcu_status_handler_function handler)
Method which gets one message indicating hardware and software exceptions coming from MCU.
std::list< struct GUIDConfig > guids
GUIDs elements.
Definition: mcuApi.h:174
int bus
bus
Definition: mcuApi.h:119
std::uint32_t software_exceptions
Software exceptions.
Definition: mcuApi.h:191
boost::function< void(const bool &available)> service_availability_handler
Prototype of the handler function used to monitor service availability.
Definition: mcuApi.h:221
std::string timestamp
timestamp
Definition: mcuApi.h:207
void asyncGetI2CValue(dpyMcu::i2c_handler_function handler, unsigned char busid, unsigned char deviceid, std::list< unsigned char > address, int lenght)
Method which requests one message with I2C information.
int device
device
Definition: mcuApi.h:120
I2C Struct which contains the response received from the service.
Definition: mcuApi.h:117
@ GPI3
GPI3.
Definition: mcuApi.h:58
@ GPO2
GPO2.
Definition: mcuApi.h:77
@ YELLOW
YELLOW.
Definition: mcuApi.h:38
@ GPO4
GPO4.
Definition: mcuApi.h:79
@ GPI5
GPI5.
Definition: mcuApi.h:60
virtual boost::system::error_code getEQVar(char &eq_id, char &var_id)
Method which requests to get EQ/Var values.
bool isAlive()
Method to check if MCU Service is Alive.
std::string part_number
Part Number of the equipment.
Definition: mcuApi.h:166
Defines a class for checking firmware binaries available for upgrading.
float battery_inner_percent
battery inner percent
Definition: mcuApi.h:138
void asyncGetGUIDValues(dpyMcu::guid_handler_function handler)
Method which requests one message with Part Number, Serial Number and CIDL of the equipment.
std::string timestamp
timestamp
Definition: mcuApi.h:135
GpiosAvailable
Possible color to be set.
Definition: mcuApi.h:55
Definition: mcuApi.h:100
std::uint32_t hardware_exceptions
Hardware exceptions.
Definition: mcuApi.h:190
@ GPI8
GPI8.
Definition: mcuApi.h:63
@ STANDBY
Standby.
Definition: mcuApi.h:49
std::uint32_t seconds
seconds
Definition: mcuApi.h:208
boost::function< void(boost::system::error_code error_code, dpyMcu::CanStatusEvent &)> can_status_handler_function
Prototype of the handler function for obtaining the CAN Status Information.
Definition: mcuApi.h:319
PowerStates power_state
power_state
Definition: mcuApi.h:149
@ GPI6
GPI6.
Definition: mcuApi.h:61
GUID list struct which contains the response received from the service.
Definition: mcuApi.h:172
@ GPI1
GPI1.
Definition: mcuApi.h:56
float battery_extern_voltage
battery extern voltage
Definition: mcuApi.h:137
bool battery_type
battery type: 1 --> 24V, 0 --> 12V
Definition: mcuApi.h:139
std::uint32_t standby_hours_working
Standby hours working.
Definition: mcuApi.h:182
@ ERROR
ERROR.
Definition: mcuApi.h:89
std::uint32_t duty_cycle
duty_cycle in percentage (range: 0% - 100%)
Definition: mcuApi.h:105
boost::function< void(boost::system::error_code error_code, dpyMcu::MCUStatus &)> mcu_status_handler_function
Prototype of the handler function for obtaining the MCU Status.
Definition: mcuApi.h:277
boost::function< void(boost::system::error_code error_code, dpyMcu::I2CValue &)> i2c_handler_function
Prototype of the handler function for obtaining the I2C information.
Definition: mcuApi.h:307
bool battery_protection_mode
battery protection mode
Definition: mcuApi.h:142
void asyncGetTimersConfig(dpyMcu::timers_handler_function handler)
Method which requests one message with Standby and Halt Timers.
std::string timestamp
timestamp
Definition: mcuApi.h:165
boost::function< void(boost::system::error_code error_code, dpyMcu::LedsConfig &)> leds_handler_function
Prototype of the handler function for obtaining the LEDs configuration.
Definition: mcuApi.h:234
@ ABORT
Abort.
Definition: mcuApi.h:51
@ CRITICAL_BATTERY
Critical battery.
Definition: mcuApi.h:52
void asyncSetLedsConfig(dpyMcu::leds_handler_function handler, dpyMcu::LedsColor color, std::uint32_t period, std::uint32_t duty_cycle)
Method which requests to change the LED color state.
@ BUTTON2
BUTTON2.
Definition: mcuApi.h:65
boost::function< void(boost::system::error_code error_code, bool enabled)> get_power_button_state_handler_function
Prototype of the handler function for obtaining the result of power button.
Definition: mcuApi.h:338
boost::function< void(boost::system::error_code error_code, dpyMcu::GpioConfig &)> gpio_handler_function
Prototype of the handler function for obtaining the GPIO Configuration.
Definition: mcuApi.h:295
std::uint32_t month
month
Definition: mcuApi.h:212
@ GREEN
GREEN.
Definition: mcuApi.h:36
@ BUTTON7
BUTTON7.
Definition: mcuApi.h:70
@ GPI2
GPI2.
Definition: mcuApi.h:57
bool ignition
ignition
Definition: mcuApi.h:136
Result
Possible received result.
Definition: mcuApi.h:87
std::uint32_t gpio
GPIOs values (values: 1 - 4)
Definition: mcuApi.h:112
@ OK
OK.
Definition: mcuApi.h:88
std::string timestamp
timestamp
Definition: mcuApi.h:189
@ BUTTON5
BUTTON5.
Definition: mcuApi.h:68
@ BLUE
BLUE.
Definition: mcuApi.h:35
Rfs
Defines the possible root file systems where binaries are located.
Definition: firmware.h:57
@ IGN
IGNITION.
Definition: mcuApi.h:75
Update struct which contains the response received from the service.
Definition: mcuApi.h:126
Class with the logic of the client.
Definition: mcuClient.h:26
std::uint32_t grace_period_minutes
grace period in minutes used to enter in halt mode irrevocably
Definition: mcuApi.h:201
@ GPO8
GPO8.
Definition: mcuApi.h:83
@ ODO
ODO.
Definition: mcuApi.h:73
boost::system::error_code getI2CValue(unsigned char busid, unsigned char deviceid, std::list< unsigned char > address, int length, dpyMcu::I2CValue &result)
(Sync) Method which requests one message with I2C information
std::string timestamp
timestamp
Definition: mcuApi.h:111
void asyncGetVersion(dpyMcu::version_handler_function handler, dpyFirmware::Rfs rfs)
Method which requests the firware version of the MCU.
Mcu(std::string ip="127.0.0.1")
Constructor of the class.
boost::system::error_code setI2CValue(unsigned char busid, unsigned char deviceid, std::list< unsigned char > address, std::list< unsigned char > values, dpyMcu::I2CValue &result)
(Sync) Method which requests to set a I2C address pin with a value
@ N_A
Not Available.
Definition: mcuApi.h:46
boost::function< void(boost::system::error_code error_code, dpyMcu::GUIDConfigList &)> guid_handler_function
Prototype of the handler function for obtaining the GUIDs.
Definition: mcuApi.h:258
@ REBOOT
Reboot.
Definition: mcuApi.h:48
std::int32_t temperature
temperature
Definition: mcuApi.h:140
@ GPO3
GPO3.
Definition: mcuApi.h:78