DUNE: Uniform Navigational Environment
2019.02.1
|
Public Member Functions | |
Task (const std::string &name, Tasks::Context &ctx) | |
~Task (void) | |
void | onUpdateParameters (void) |
void | onEntityReservation (void) |
void | onResourceAcquisition (void) |
void | onResourceRelease (void) |
void | onResourceInitialization (void) |
void | updateEEPROM (bool version_pre24) |
void | processADCs (const uint8_t *data) |
void | processLeaks (const uint8_t *data) |
void | processPowerInfo (const uint8_t *data) |
void | processMode (const uint8_t *data) |
void | onCommand (uint8_t cmd, const uint8_t *data, int data_size) |
void | onVersion (unsigned major, unsigned minor, unsigned patch) |
bool | waitForCommand (uint8_t code, unsigned retries=10) |
void | setLeakStatus (int idx, bool leak) |
void | setPowerChannelState (unsigned channel, unsigned state) |
void | onReportEntityState (void) |
void | consume (const IMC::QueryPowerChannelState *msg) |
void | consume (const IMC::PowerChannelControl *msg) |
void | consume (const IMC::SetLedBrightness *msg) |
void | consume (const IMC::QueryLedBrightness *msg) |
void | dispatchPowerChannelStates (void) |
void | onMain (void) |
Public Attributes | |
Hardware::LUCL::Protocol | m_proto |
IMC::Message * | m_adcs [c_adcs_count] |
IMC::EntityState | m_leaks [c_leak_count] |
PowerChannels | m_channels |
IMC::PowerOperation | m_pwr_op |
IMC::LedBrightness | m_led_bright [c_led_count] |
bool | m_pwr_down |
IMC::Temperature | m_temp |
Time::Counter< double > | m_wdog |
Time::Counter< double > | m_state_timer |
Arguments | m_args |
std::map< std::string, unsigned > | m_led_map |
|
inline |
References Power::PCTLv2::Arguments::adc_elabels, Power::PCTLv2::Arguments::adc_factors, Power::PCTLv2::Arguments::adc_messages, Power::PCTLv2::Arguments::adc_ref, Power::PCTLv2::Arguments::chn_eme_state, Power::PCTLv2::Arguments::leak_elabels, Power::PCTLv2::Arguments::leak_medium, Power::PCTLv2::Arguments::leds, Power::PCTLv2::Arguments::pwr_main, Power::PCTLv2::Arguments::pwr_names, Power::PCTLv2::Arguments::pwr_states, Power::PCTLv2::Arguments::uart_dev, Power::PCTLv2::Arguments::vol_min, Power::PCTLv2::Arguments::vol_wup, and Power::PCTLv2::Arguments::wdog_tout.
|
inline |
|
inline |
|
inline |
|
inline |
References Power::PCTLv2::CMD_LED_CTL.
|
inline |
|
inline |
Dispatch power channel state messages to bus.
References Power::PCTLv2::PowerChannels::begin(), and Power::PCTLv2::PowerChannels::end().
|
inline |
On Command call.
[in] | cmd | command. |
[in] | data | buffer of data. |
[in] | data_size | size of data. |
References Power::PCTLv2::CMD_STATE, and Power::PCTLv2::CMD_TEMP.
|
inline |
Reserve entities.
References Power::PCTLv2::Arguments::adc_elabels, and Power::PCTLv2::Arguments::leak_elabels.
|
inline |
References Power::PCTLv2::CMD_STATE.
|
inline |
Report leak entities.
|
inline |
Acquire resources.
References Power::PCTLv2::Arguments::uart_dev, and Power::PCTLv2::Arguments::wdog_tout.
|
inline |
Initialize resources.
References Power::PCTLv2::PowerChannels::begin(), and Power::PCTLv2::PowerChannels::end().
|
inline |
Release resources.
References Power::PCTLv2::CMD_LED_CTL, and Power::PCTLv2::Arguments::pwr_states.
|
inline |
Update parameters.
References Power::PCTLv2::Arguments::adc_elabels, Power::PCTLv2::Arguments::adc_messages, Power::PCTLv2::PowerChannels::add(), Power::PCTLv2::PowerChannels::clear(), Power::PCTLv2::PowerChannel::id, Power::PCTLv2::Arguments::leds, Power::PCTLv2::Arguments::pwr_names, Power::PCTLv2::Arguments::pwr_states, and Power::PCTLv2::PowerChannel::state.
|
inline |
On version call.
[in] | major | major version number. |
[in] | minor | minor version number. |
[in] | patch | patch version number. |
|
inline |
Process data from ADCs.
[in] | data | data buffer. |
References Power::PCTLv2::Arguments::adc_factors, and Power::PCTLv2::Arguments::adc_ref.
|
inline |
Process data from leak sensors.
[in] | data | data buffer. |
|
inline |
Process device mode.
[in] | data | data buffer. |
References Power::PCTLv2::PWR_MODE_EMERGENCY, Power::PCTLv2::PWR_MODE_EMERGENCY_IP, and Power::PCTLv2::PWR_MODE_OFF_IP.
|
inline |
Process power information.
[in] | data | data buffer. |
References Power::PCTLv2::PowerChannels::begin(), and Power::PCTLv2::PowerChannels::end().
|
inline |
Set Leak status.
[in] | idx | leak index. |
[in] | leak | leak status. |
References Power::PCTLv2::Arguments::leak_medium.
|
inline |
Define power channel state.
[in] | channel | channel. |
[in] | state | state of the power channel. |
References Power::PCTLv2::CMD_PWR_CTL.
|
inline |
Update EEPROM data.
References Power::PCTLv2::Arguments::adc_factors, Power::PCTLv2::Arguments::adc_ref, Power::PCTLv2::Arguments::chn_eme_state, Power::PCTLv2::CMD_EEPROM, Power::PCTLv2::EEPROM_SIZE, Power::PCTLv2::EEPROM_START, Power::PCTLv2::Arguments::vol_min, and Power::PCTLv2::Arguments::vol_wup.
|
inline |
Wait for command.
[in] | code | command code. |
[in] | retries | number of retries. |
IMC::Message* Power::PCTLv2::Task::m_adcs[c_adcs_count] |
ADC messages.
PowerChannels Power::PCTLv2::Task::m_channels |
Power channels.
IMC::EntityState Power::PCTLv2::Task::m_leaks[c_leak_count] |
Leak detection.
IMC::LedBrightness Power::PCTLv2::Task::m_led_bright[c_led_count] |
LED brightness.
std::map<std::string, unsigned> Power::PCTLv2::Task::m_led_map |
LED name to id map.
Hardware::LUCL::Protocol Power::PCTLv2::Task::m_proto |
Device protocol handler.
bool Power::PCTLv2::Task::m_pwr_down |
Power down is in progress.
IMC::PowerOperation Power::PCTLv2::Task::m_pwr_op |
Power operation.
Time::Counter<double> Power::PCTLv2::Task::m_state_timer |
State timer.
IMC::Temperature Power::PCTLv2::Task::m_temp |
Temperature.
Time::Counter<double> Power::PCTLv2::Task::m_wdog |
Watchdog.