UseDummyCan.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
25 //----------------------------------------------------------------------
26 #ifndef _icl_hardware_can_UseDummyCan_h_
27 #define _icl_hardware_can_UseDummyCan_h_
28 
31 
32 namespace icl_hardware {
33 namespace can {
34 
35 typedef int tCanDescriptor;
36 static tCanDescriptor no_can_instances = 0;
37 
38 inline bool CanDescriptorValid(tCanDescriptor can_device)
39 {
40  return can_device != 0;
41 }
42 
43 inline tCanDescriptor InvalidCanDescriptor()
44 {
45  return 0;
46 }
47 
48 inline const char* CanDriverName()
49 {
50  return "DummyCAN";
51 }
52 
53 inline tCanDescriptor CanDeviceOpen(const char* /*device_name*/, int /*flags*/,
54  unsigned char /*acceptance_code*/, unsigned char /*acceptance_mask*/, unsigned int /*baud_rate*/,
55  unsigned /*send_fifo_size*/, unsigned /*receive_fifo_size*/)
56 {
57  tCanDescriptor can_device = no_can_instances++;
58  LOGGING_INFO(CAN, "Opening DummyCAN (" << can_device << ")" << endl);
59  return can_device;
60 }
61 
62 inline int CanDeviceClose(tCanDescriptor /*_can_device*/)
63 {
64  return 0;
65 }
66 
67 inline int CanDeviceSend(tCanDescriptor /*_can_device*/, const tCanMessage& /*msg*/)
68 {
69  return 0;
70 }
71 
72 inline int CanDeviceReceive(tCanDescriptor /*_can_device*/, tCanMessage& /*msg*/)
73 {
74  return 0;
75 }
76 
77 inline int CanDeviceReset(tCanDescriptor /*_can_device*/)
78 {
79  return 0;
80 }
81 
82 }
83 }
84 
85 #endif
int CanDeviceClose(tCanDescriptor)
Definition: UseDummyCan.h:62
Implements a struct representing a can message.
Definition: tCanMessage.h:43
#define LOGGING_INFO(streamname, arg)
bool CanDescriptorValid(tCanDescriptor can_device)
Definition: UseDummyCan.h:38
static tCanDescriptor no_can_instances
Definition: UseDummyCan.h:36
int CanDeviceReset(tCanDescriptor)
Definition: UseDummyCan.h:77
const char * CanDriverName()
Definition: UseDummyCan.h:48
Contains CAN driver interface functions.
ThreadStream & endl(ThreadStream &stream)
tCanDescriptor InvalidCanDescriptor()
Definition: UseDummyCan.h:43
tCanDescriptor CanDeviceOpen(const char *, int, unsigned char, unsigned char, unsigned int, unsigned, unsigned)
Open a can device and set parameters.
Definition: UseDummyCan.h:53
int CanDeviceSend(tCanDescriptor, const tCanMessage &)
Definition: UseDummyCan.h:67
int CanDeviceReceive(tCanDescriptor, tCanMessage &)
Definition: UseDummyCan.h:72


fzi_icl_can
Author(s):
autogenerated on Mon Jun 10 2019 13:17:02