00001 00025 #ifndef NUMATAC_CAN_DRIVER_NUMATAC_CAN_DRIVER_H 00026 #define NUMATAC_CAN_DRIVER_NUMATAC_CAN_DRIVER_H 00027 00028 #include <stdint.h> 00029 #include <string> 00030 #include <vector> 00031 00032 #include "numatac_can_driver/bt_can.h" 00033 00034 00035 00036 00037 00038 namespace numatac_can_driver 00039 { 00040 00041 enum 00042 { 00043 PAC = 0, 00044 PDC = 1 00045 }; 00046 00047 class NumaTacCANDriver 00048 { 00049 public: 00050 NumaTacCANDriver(std::string canbus_dev, uint8_t number_of_sensors); 00051 00052 bool connect(); 00053 bool isConnected(); 00054 bool getData(); 00055 int16_t getPAC(uint8_t id); 00056 uint16_t getPDC(uint8_t id); 00057 00058 private: 00059 int socket_; 00060 std::string canbus_dev_; // CAN interface ID 00061 bool is_connected_; 00062 uint8_t number_of_sensors_; 00063 00064 std::vector<int16_t> pac_; 00065 std::vector<uint16_t> pdc_; 00066 }; 00067 00068 } // namespace numatac_can_driver 00069 00070 #endif // NUMATAC_CAN_DRIVER_NUMATAC_CAN_DRIVER_H