00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- 00002 // -- BEGIN LICENSE BLOCK ---------------------------------------------- 00003 // This file is part of FZIs ic_workspace. 00004 // 00005 // This program is free software licensed under the LGPL 00006 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3). 00007 // You can find a copy of this license in LICENSE folder in the top 00008 // directory of the source code. 00009 // 00010 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany 00011 // 00012 // -- END LICENSE BLOCK ------------------------------------------------ 00013 //---------------------------------------------------------------------- 00020 //---------------------------------------------------------------------- 00021 00022 #ifndef TCANDEVICEDUMMY_H 00023 #define TCANDEVICEDUMMY_H 00024 00025 #include "icl_hardware_can/tCanDevice.h" 00026 namespace icl_hardware { 00027 namespace can { 00028 00029 class ICL_HARDWARE_CAN_IMPORT_EXPORT tCanDeviceDummy : public tCanDevice 00030 { 00031 public: 00032 tCanDeviceDummy (const char* device_name, int flags, unsigned char acceptance_code, unsigned char acceptance_mask, unsigned int baud_rate, unsigned int send_fifo_size, unsigned int receive_fifo_size); 00033 00034 virtual ~tCanDeviceDummy(); 00035 virtual int Send(const tCanMessage &msg); 00036 virtual int Receive(tCanMessage &msg); 00037 virtual void Reset(); 00038 virtual bool IsInitialized(); 00039 00040 virtual tCanMessage getLastMessage() const; 00041 00052 virtual void addResponse(const tCanMessage& msg, const bool wait_for_send = true); 00053 00054 protected: 00055 std::vector<tCanMessage> m_sent_messages; 00056 std::vector<tCanMessage> m_received_messages; 00057 00058 bool m_receive_enabled; 00059 }; 00060 00061 }} // End of NS 00062 00063 #endif // TCANDEVICEDUMMY_H