MIRA
CANDriverMLCAN.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 MetraLabs GmbH (MLAB), GERMANY.
3  * All rights reserved.
4  * Contact: info@MetraLabs.com
5  *
6  * Commercial Usage:
7  * Licensees holding valid commercial licenses may use this file in
8  * accordance with the commercial license agreement provided with the
9  * software or, alternatively, in accordance with the terms contained in
10  * a written agreement between you and MetraLabs.
11  *
12  * GNU General Public License Usage:
13  * Alternatively, this file may be used under the terms of the GNU
14  * General Public License version 3.0 as published by the Free Software
15  * Foundation and appearing in the file LICENSE.GPL3 included in the
16  * packaging of this file. Please review the following information to
17  * ensure the GNU General Public License version 3.0 requirements will be
18  * met: http://www.gnu.org/copyleft/gpl.html.
19  * Alternatively you may (at your option) use any later version of the GNU
20  * General Public License if such license has been publicly approved by
21  * MetraLabs (or its successors, if any).
22  *
23  * IN NO EVENT SHALL "MLAB" BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
24  * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
25  * OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF "MLABS" HAS BEEN
26  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * "MLAB" SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
29  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30  * A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
31  * "AS IS" BASIS, AND "MLAB" HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
32  * SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS.
33  */
34 
43 #ifndef _MIRA_CANDRIVERMLCAN_H_
44 #define _MIRA_CANDRIVERMLCAN_H_
45 
46 #include <can/CANDriver.h>
47 
48 namespace mira { namespace can {
49 
51 
56 {
58 
59 public:
62 
64  virtual ~CANDriverMLCAN();
65 
66 public:
69 
70  virtual std::string getDriverInfo();
71 
72  virtual void open();
73 
74  virtual void close();
75 
76  virtual CANStatusFlags getStatus();
77 
79 
80 public:
83 
84  virtual void sendMessage(const CANMessage& msg);
85 
86  virtual bool waitForNextMessage(Duration timeout);
87 
88  virtual void receiveMessage(CANMessage& oMsg, Time& oReceiveTime);
89 
91 private:
92  bool extractMessageFromBuffer();
93 
94 private:
95  struct MLCANContext;
96  MLCANContext* mContext;
97 };
98 
100 
101 }} // namespace
102 
103 #endif
A driver for the MetraLabs CAN device.
Definition: CANDriverMLCAN.h:55
A general interface for a CAN driver.
Definition: CANDriver.h:57
#define MIRA_OBJECT(classIdentifier)
#define MLAB_CAN_EXPORT
Definition: CANExports.h:57
CANStatusFlags
CAN status enum definitions.
Definition: CANDefs.h:76
Base class for all CAN-Bus drivers.
A definition of a CAN message.
Definition: CANDefs.h:105