#include "adr2205.H"
#include "util.H"
#include "serial_io.H"
#include "data_queue.H"
#include "data_logger.H"
#include "queue_factory.H"
#include "cbmesg_logger.H"
#include "cb_time.H"
#include <libgen.h>
#include <csignal>
#include <iostream>
#include <unistd.h>
#include <sys/poll.h>
#include "conf.H"
Functions | |
void | sig_handler (int sig) |
bool | read_conf (conf_t &conf_) |
void | reset_control_lines () |
void | set_control_lines (control_line_data_t const &d) |
void | set_control_lines (steering_data_t const &s) |
void | output_control_lines (adr2205_t &adr2205, bool const unit_used[adr2205_t::MAX_UNITS]) |
void | output_initial_controls (adr2205_t &adr2205, bool const unit_used[adr2205_t::MAX_UNITS]) |
bool | filter_kill (bool k_sig, cbmesg_logger_t &msg_logger) |
int | main (int argc, char **argv) |
Variables | |
unsigned | LINE_ESTOP_PAUSE |
unsigned | LINE_ESTOP_KILL |
unsigned | LINE_ENGINE_ON |
unsigned | LINE_GENERATOR_ON |
unsigned | UNIT_ESTOP_PAUSE |
unsigned | UNIT_ESTOP_KILL |
unsigned | UNIT_ENGINE_ON |
unsigned | UNIT_GENERATOR_ON |
unsigned | LINE_LEFT_BLINKER |
unsigned | LINE_RIGHT_BLINKER |
unsigned | LINE_BRAKE_LIGHTS |
unsigned | LINE_SAFETY_LIGHTS |
unsigned | LINE_SAFETY_SIREN |
unsigned | LINE_ENGINE_STARTER |
unsigned | LINE_GENERATOR_STARTER |
unsigned | LINE_PARK |
unsigned | LINE_DRIVE |
unsigned | LINE_REVERSE |
unsigned | LINE_NEUTRAL |
unsigned | UNIT_LEFT_BLINKER |
unsigned | UNIT_RIGHT_BLINKER |
unsigned | UNIT_BRAKE_LIGHTS |
unsigned | UNIT_SAFETY_LIGHTS |
unsigned | UNIT_SAFETY_SIREN |
unsigned | UNIT_ENGINE_STARTER |
unsigned | UNIT_GENERATOR_STARTER |
unsigned | UNIT_PARK |
unsigned | UNIT_DRIVE |
unsigned | UNIT_REVERSE |
unsigned | UNIT_NEUTRAL |
bool | reverse_pause |
bool | reverse_kill |
double | time_to_change_gear = 1 |
unsigned | kill_count_threshold = 2 |
unsigned | kill_counter = 0 |
unsigned | output [adr2205_t::MAX_UNITS] |
bool filter_kill | ( | bool | k_sig, | |
cbmesg_logger_t & | msg_logger | |||
) |
References kill_count_threshold, and kill_counter.
Referenced by main().
int main | ( | int | argc, | |
char ** | argv | |||
) |
References die, filter_kill(), cajun::adr2205_t::get_input_lines(), cajun::adr2205_t::initialize(), LINE_ENGINE_ON, LINE_ESTOP_KILL, LINE_ESTOP_PAUSE, LINE_GENERATOR_ON, msg_logger, output_control_lines(), output_initial_controls(), progname, read_conf(), reset_control_lines(), reverse_kill, reverse_pause, set_control_lines(), sig_handler(), time_to_change_gear, UNIT_BRAKE_LIGHTS, UNIT_ENGINE_ON, UNIT_ENGINE_STARTER, UNIT_ESTOP_KILL, UNIT_ESTOP_PAUSE, UNIT_GENERATOR_ON, UNIT_GENERATOR_STARTER, UNIT_LEFT_BLINKER, UNIT_RIGHT_BLINKER, UNIT_SAFETY_LIGHTS, and UNIT_SAFETY_SIREN.
void output_control_lines | ( | adr2205_t & | adr2205, | |
bool const | unit_used[adr2205_t::MAX_UNITS] | |||
) |
References output, and cajun::adr2205_t::set_output_lines().
Referenced by main(), and output_initial_controls().
void output_initial_controls | ( | adr2205_t & | adr2205, | |
bool const | unit_used[adr2205_t::MAX_UNITS] | |||
) |
References output_control_lines(), reset_control_lines(), and set_control_lines().
Referenced by main().
bool read_conf | ( | conf_t & | conf_ | ) |
References LINE_BRAKE_LIGHTS, LINE_DRIVE, LINE_ENGINE_ON, LINE_ENGINE_STARTER, LINE_ESTOP_KILL, LINE_ESTOP_PAUSE, LINE_GENERATOR_ON, LINE_GENERATOR_STARTER, LINE_LEFT_BLINKER, LINE_NEUTRAL, LINE_PARK, LINE_REVERSE, LINE_RIGHT_BLINKER, LINE_SAFETY_LIGHTS, LINE_SAFETY_SIREN, reverse_kill, reverse_pause, time_to_change_gear, UNIT_BRAKE_LIGHTS, UNIT_DRIVE, UNIT_ENGINE_ON, UNIT_ENGINE_STARTER, UNIT_ESTOP_KILL, UNIT_ESTOP_PAUSE, UNIT_GENERATOR_ON, UNIT_GENERATOR_STARTER, UNIT_LEFT_BLINKER, UNIT_NEUTRAL, UNIT_PARK, UNIT_REVERSE, UNIT_RIGHT_BLINKER, UNIT_SAFETY_LIGHTS, and UNIT_SAFETY_SIREN.
void reset_control_lines | ( | ) |
References output.
Referenced by main(), and output_initial_controls().
void set_control_lines | ( | steering_data_t const & | s | ) |
References LINE_DRIVE, LINE_NEUTRAL, LINE_PARK, LINE_REVERSE, output, UNIT_DRIVE, UNIT_NEUTRAL, UNIT_PARK, and UNIT_REVERSE.
void set_control_lines | ( | control_line_data_t const & | d | ) |
References LINE_BRAKE_LIGHTS, LINE_ENGINE_STARTER, LINE_GENERATOR_STARTER, LINE_LEFT_BLINKER, LINE_RIGHT_BLINKER, LINE_SAFETY_LIGHTS, LINE_SAFETY_SIREN, output, UNIT_BRAKE_LIGHTS, UNIT_ENGINE_STARTER, UNIT_GENERATOR_STARTER, UNIT_LEFT_BLINKER, UNIT_RIGHT_BLINKER, UNIT_SAFETY_LIGHTS, and UNIT_SAFETY_SIREN.
Referenced by main(), and output_initial_controls().
void sig_handler | ( | int | sig | ) |
References die.
unsigned kill_count_threshold = 2 |
Referenced by filter_kill().
unsigned kill_counter = 0 |
Referenced by filter_kill().
unsigned LINE_BRAKE_LIGHTS |
Referenced by read_conf(), and set_control_lines().
unsigned LINE_DRIVE |
Referenced by read_conf(), and set_control_lines().
unsigned LINE_ENGINE_ON |
Referenced by main(), and read_conf().
unsigned LINE_ENGINE_STARTER |
Referenced by read_conf(), and set_control_lines().
unsigned LINE_ESTOP_KILL |
Referenced by main(), and read_conf().
unsigned LINE_ESTOP_PAUSE |
Referenced by main(), and read_conf().
unsigned LINE_GENERATOR_ON |
Referenced by main(), and read_conf().
unsigned LINE_GENERATOR_STARTER |
Referenced by read_conf(), and set_control_lines().
unsigned LINE_LEFT_BLINKER |
Referenced by read_conf(), and set_control_lines().
unsigned LINE_NEUTRAL |
Referenced by read_conf(), and set_control_lines().
unsigned LINE_PARK |
Referenced by read_conf(), and set_control_lines().
unsigned LINE_REVERSE |
Referenced by read_conf(), and set_control_lines().
unsigned LINE_RIGHT_BLINKER |
Referenced by read_conf(), and set_control_lines().
unsigned LINE_SAFETY_LIGHTS |
Referenced by read_conf(), and set_control_lines().
unsigned LINE_SAFETY_SIREN |
Referenced by read_conf(), and set_control_lines().
unsigned output[adr2205_t::MAX_UNITS] |
Referenced by output_control_lines(), reset_control_lines(), and set_control_lines().
bool reverse_kill |
Referenced by main(), and read_conf().
bool reverse_pause |
Referenced by main(), and read_conf().
double time_to_change_gear = 1 |
Referenced by main(), and read_conf().
unsigned UNIT_BRAKE_LIGHTS |
Referenced by main(), read_conf(), and set_control_lines().
unsigned UNIT_DRIVE |
Referenced by read_conf(), and set_control_lines().
unsigned UNIT_ENGINE_ON |
Referenced by main(), and read_conf().
unsigned UNIT_ENGINE_STARTER |
Referenced by main(), read_conf(), and set_control_lines().
unsigned UNIT_ESTOP_KILL |
Referenced by main(), and read_conf().
unsigned UNIT_ESTOP_PAUSE |
Referenced by main(), and read_conf().
unsigned UNIT_GENERATOR_ON |
Referenced by main(), and read_conf().
unsigned UNIT_GENERATOR_STARTER |
Referenced by main(), read_conf(), and set_control_lines().
unsigned UNIT_LEFT_BLINKER |
Referenced by main(), read_conf(), and set_control_lines().
unsigned UNIT_NEUTRAL |
Referenced by read_conf(), and set_control_lines().
unsigned UNIT_PARK |
Referenced by read_conf(), and set_control_lines().
unsigned UNIT_REVERSE |
Referenced by read_conf(), and set_control_lines().
unsigned UNIT_RIGHT_BLINKER |
Referenced by main(), read_conf(), and set_control_lines().
unsigned UNIT_SAFETY_LIGHTS |
Referenced by main(), read_conf(), and set_control_lines().
unsigned UNIT_SAFETY_SIREN |
Referenced by main(), read_conf(), and set_control_lines().