HardwareCanSourcePeak.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 //----------------------------------------------------------------------
22 //----------------------------------------------------------------------
23 #ifndef ICL_HARDWARE_CAN_SOURCE_HARDWARE_CAN_SOURCE_PEAK_H_INCLUDED
24 #define ICL_HARDWARE_CAN_SOURCE_HARDWARE_CAN_SOURCE_PEAK_H_INCLUDED
25 
28 
31 
32 #include <vector>
33 
34 namespace icl_hardware {
35 namespace can {
36 
41 {
42 private:
46  class WorkerThread;
47 
48 public:
50  typedef boost::shared_ptr<HardwareCanSourcePeak> Ptr;
52  typedef boost::shared_ptr<const HardwareCanSourcePeak> ConstPtr;
53 
55  static icl_sourcesink::URISchemeMap supportedURISchemes()
56  {
57  using namespace icl_sourcesink;
58  URISchemeMap schemes;
59  schemes.insert(
60  std::make_pair(
61  "can+live",
62  URISchemeInfo(
63  "Reads CAN message data via a Peak CAN device.",
64  "can+live://<path>[?baudrate=<baudrate>][&can_mask=<can_mask>|can_id=<can_id>][&buffer_size=<buffer_size>]",
65  "<path> Path to CAN device (default: /dev/pcan0)\n"
66  "<baudrate> CAN baudrate [kbps] (default: 500).\n"
67  "<can_mask> Path to CAN mask file\n"
68  " (default: from config option /icl_hardware_can/can_mask)\n"
69  "<can_id> Specific CAN ID to extract while ignoring all others\n"
70  "<buffer_size> Internal buffer size (default: 256 messages)")));
71  return schemes;
72  }
73 
74  virtual CanMessageStamped::Ptr get() const
75  {
76  return m_buffer;
77  }
78 
79  virtual bool isSeekable() const { return false; }
80 
82 
83 protected:
85  HardwareCanSourcePeak(const std::string& uri = "",
86  const std::string& name = "HardwareCanSourcePeak");
87 
89  friend class icl_sourcesink::SourceSinkManager;
90 
92  friend class icl_sourcesink::DataSourceFactory<HardwareCanSourcePeak>;
93 
95  bool advance();
96 
97 private:
100 
106 
110  boost::scoped_ptr<WorkerThread> m_worker_thread;
111 };
112 
113 SOURCESINK_DECLARE_GENERIC_SOURCE_FACTORY(HardwareCanSourcePeak)
114 
115 }
116 }
117 
118 #endif
unsigned int uint32_t
boost::shared_ptr< HardwareCanSourcePeak > Ptr
Shared pointer shorthand.
icl_sourcesink::DataSource< tCanMessage > HardwareCanSource
Base type for all sources providing tCanMessage data.
#define ICL_HARDWARE_CAN_SOURCE_IMPORT_EXPORT
boost::shared_ptr< const HardwareCanSourcePeak > ConstPtr
Const shared pointer shorthand.
boost::shared_ptr< Stamped< DataType > > Ptr
CanMessageStamped::Ptr m_buffer
Buffers the latest data element.
This modul constructs a map of a can-mask-file the map can be request by getcanmatrix() ...
boost::scoped_ptr< WorkerThread > m_worker_thread
static icl_sourcesink::URISchemeMap supportedURISchemes()
URI schemes supported by this source.


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