00001 // Copyright (C) 2007 University of Louisiana at Lafayette 00002 // Author: Chandan Uddaraju 00003 00004 #include "steering_data.H" 00005 00006 #ifndef CAJUN_EMC_SERIAL_H 00007 #define CAJUN_EMC_SERIAL_H 00008 00009 00010 namespace cajun 00011 { 00012 class emc_serial_t 00013 { 00014 public: 00015 static unsigned const MAX_BUFFER_SIZE = 13; 00016 00017 static unsigned const HEADLIGHTS_DEVICE_ID = 1; 00018 static unsigned const WIPERS_DEVICE_ID = 2; 00019 static unsigned const IGNITION_DEVICE_ID = 5; 00020 static unsigned const TURN_SIGNAL_DEVICE_ID = 9; 00021 static unsigned const GEAR_STATUS_DEVICE_ID = 13; 00022 static unsigned const BREAKLIGHT_STATUS_DEVICE_ID = 14; 00023 static unsigned const STARTER_1_DEVICE_ID = 26; 00024 static unsigned const STARTER_2_DEVICE_ID = 28; 00025 00026 emc_serial_t (int fd); 00027 00028 // bool initialize (unsigned unit); 00029 00030 bool set_turn_signals (unsigned unit); 00031 00032 bool set_gear_position (steering_data_t); 00033 00034 int get_status (unsigned device_id); 00035 00036 protected: 00037 int m_fd; 00038 // steering_data_t::gear_t m_gear; 00039 // bool m_init[MAX_UNITS]; 00040 }; 00041 }; 00042 00043 00044 #endif