00001 /*************************************************************************** 00002 tag: Peter Soetens Mon Jan 19 14:11:20 CET 2004 CANBusInterface.hpp 00003 00004 CANBusInterface.hpp - description 00005 ------------------- 00006 begin : Mon January 19 2004 00007 copyright : (C) 2004 Peter Soetens 00008 email : peter.soetens@mech.kuleuven.ac.be 00009 00010 *************************************************************************** 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of the GNU Lesser General Public * 00013 * License as published by the Free Software Foundation; either * 00014 * version 2.1 of the License, or (at your option) any later version. * 00015 * * 00016 * This library is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00019 * Lesser General Public License for more details. * 00020 * * 00021 * You should have received a copy of the GNU Lesser General Public * 00022 * License along with this library; if not, write to the Free Software * 00023 * Foundation, Inc., 59 Temple Place, * 00024 * Suite 330, Boston, MA 02111-1307 USA * 00025 * * 00026 ***************************************************************************/ 00027 00028 #ifndef CANBUSINTERFACE_HPP 00029 #define CANBUSINTERFACE_HPP 00030 00031 namespace RTT 00032 { 00033 namespace CAN 00034 { 00035 class CANDeviceInterface; 00036 class CANMessage; 00037 class CANControllerInterface; 00038 class CANListenerInterface; 00039 00043 struct CANBusInterface 00044 { 00045 virtual ~CANBusInterface() 00046 { 00047 } 00048 00052 virtual void setController(CANControllerInterface* c) = 0; 00053 00061 virtual bool addDevice(CANDeviceInterface* dev) = 0; 00062 00070 virtual void removeDevice(CANDeviceInterface* dev) = 0; 00071 00079 virtual bool addListener(CANListenerInterface* dev) = 0; 00080 00088 virtual void removeListener(CANListenerInterface* dev) = 0; 00089 00097 virtual void write(const CANMessage *msg) = 0; 00098 00102 virtual CANControllerInterface* getController() = 0; 00103 00104 }; 00105 00106 } 00107 } 00108 00109 #endif 00110