Go to the documentation of this file.
12 #include <boost/thread/condition_variable.hpp>
13 #include <boost/chrono/system_clocks.hpp>
14 #include <boost/lexical_cast.hpp>
49 void abort(uint32_t reason);
63 std::bind(&
SDOClient::
read, this, std::placeholders::_1, std::placeholders::_2),
64 std::bind(&
SDOClient::
write, this, std::placeholders::_1, std::placeholders::_2))
76 bool read(uint8_t* b,
const size_t len);
77 void write(
const uint8_t* b,
const size_t len);
105 if(!tpdo->init(storage, com_index, map_index))
121 if(!rpdo->init(storage, com_index, map_index))
136 std::unordered_set<RPDO::RPDOSharedPtr>
rpdos_;
137 std::unordered_set<TPDO::TPDOSharedPtr>
tpdos_;
183 virtual void addNode(
void *
const ptr) = 0;
184 virtual void removeNode(
void *
const ptr) = 0;
232 template<
typename T>
int wait_for(
const State &s,
const T &timeout);
236 boost::condition_variable
cond;
263 void call(
void (T::*func)(
void)){
264 typename std::vector<MemberSharedPtr>::iterator it =
elements.begin();
270 template<
typename V>
void call(
void (T::*func)(
const V&),
const std::vector<V> &vs){
271 typename std::vector<MemberSharedPtr>::iterator it =
elements.begin();
272 typename std::vector<V>::const_iterator it_v = vs.begin();
273 while(it_v != vs.end() && it !=
elements.end()){
274 ((**it).*func)(*it_v);
278 template<
typename V>
void call(
void (T::*func)(V&), std::vector<V> &vs){
281 typename std::vector<MemberSharedPtr>::iterator it =
elements.begin();
282 typename std::vector<V>::iterator it_v = vs.begin();
283 while(it_v != vs.end() && it !=
elements.end()){
284 ((**it).*func)(*it_v);
virtual void handleDiag(LayerReport &report)
FrameOverlay(const Header &h)
int wait_for(const State &s, const T &timeout)
std::vector< MemberSharedPtr > elements
SyncLayer(const SyncProperties &p)
T get(const ObjectDict::Key &k)
bool read(uint8_t *b, const size_t len)
can::FrameListenerConstSharedPtr listener_
virtual void handleInit(LayerStatus &status)
SyncProperties(const can::Header &h, const uint16_t &p, const uint8_t &o)
Node(const can::CommInterfaceSharedPtr interface, const ObjectDictSharedPtr dict, uint8_t node_id, const SyncCounterSharedPtr sync=SyncCounterSharedPtr())
virtual void handleRecover(LayerStatus &status)
const can::CommInterfaceSharedPtr interface_
void call(void(T::*func)(const V &), const std::vector< V > &vs)
void resetErrors(LayerStatus &status)
void setHeartbeatInterval()
FrameOverlay(const can::Frame &f)
const ObjectStorageSharedPtr storage_
std::shared_ptr< TPDO > TPDOSharedPtr
virtual void addNode(void *const ptr)=0
void call(void(T::*func)(void))
virtual void handleDiag(LayerReport &report)
bool processFrame(const can::Frame &msg)
boost::chrono::high_resolution_clock::time_point heartbeat_timeout_
StateListenerConstSharedPtr addStateListener(const StateFunc &s)
std::shared_ptr< Buffer > BufferSharedPtr
const uint16_t period_ms_
std::unordered_set< RPDO::RPDOSharedPtr > rpdos_
void handleNMT(const can::Frame &msg)
bool operator==(const SyncProperties &p) const
void switchState(const uint8_t &s)
virtual void handleShutdown(LayerStatus &status)
std::shared_ptr< CommInterface > CommInterfaceSharedPtr
virtual void handleRead(LayerStatus &status, const LayerState ¤t_state)
boost::condition_variable cond
boost::chrono::high_resolution_clock::time_point time_point
void sync(LayerStatus &status)
virtual void handleRead(LayerStatus &status, const LayerState ¤t_state)
std::shared_ptr< RPDO > RPDOSharedPtr
can::BufferedReader reader_
ObjectStorage::Entry< uint8_t > error_register_
bool init(const ObjectStorageSharedPtr storage, LayerStatus &status)
virtual SyncLayerSharedPtr getSync(const SyncProperties &properties)=0
std::shared_ptr< const Listener > ListenerConstSharedPtr
boost::chrono::high_resolution_clock::duration time_duration
RPDO(const can::CommInterfaceSharedPtr interface)
const can::CommInterfaceSharedPtr interface_
const can::CommInterfaceSharedPtr interface_
void read(const canopen::ObjectDict::Entry &entry, String &data)
std::shared_ptr< Master > MasterSharedPtr
std::function< void(const State &)> StateFunc
std::shared_ptr< SyncCounter > SyncCounterSharedPtr
virtual void handleHalt(LayerStatus &status)
void add(MemberSharedPtr t)
void parse_and_set_mapping(const ObjectStorageSharedPtr &storage, const uint16_t &com_index, const uint16_t &map_index, const bool &read, const bool &write)
virtual void handleShutdown(LayerStatus &status)
can::Listener< const StateFunc, const State & > StateListener
void abort(uint32_t reason)
can::SimpleDispatcher< StateListener > state_dispatcher_
const SyncProperties properties
ObjectDict::ObjectDictSharedPtr ObjectDictSharedPtr
uint16_t getHeartbeatInterval()
virtual void handleHalt(LayerStatus &status)
std::array< value_type, 8 > data
const ObjectStorageSharedPtr getStorage()
can::FrameListenerConstSharedPtr nmt_listener_
static TPDOSharedPtr create(const can::CommInterfaceSharedPtr interface, const ObjectStorageSharedPtr &storage, const uint16_t &com_index, const uint16_t &map_index)
const can::CommInterfaceSharedPtr interface_
EMCYHandler(const can::CommInterfaceSharedPtr interface, const ObjectStorageSharedPtr storage)
ObjectStorage::Entry< ObjectStorage::DataType< ObjectDict::DEFTYPE_UNSIGNED16 >::type > heartbeat_
ObjectStorage::Entry< uint8_t > num_errors_
void write(const uint8_t *b, const size_t len)
SDOClient(const can::CommInterfaceSharedPtr interface, const ObjectDictSharedPtr dict, uint8_t node_id)
PDOMapper(const can::CommInterfaceSharedPtr interface)
virtual void handleWrite(LayerStatus &status, const LayerState ¤t_state)
std::unordered_set< TPDO::TPDOSharedPtr > tpdos_
virtual void handleWrite(LayerStatus &status, const LayerState ¤t_state)
bool init(const ObjectStorageSharedPtr &storage, const uint16_t &com_index, const uint16_t &map_index)
std::atomic< bool > has_error_
std::vector< char > buffer
const canopen::ObjectDict::Entry * current_entry
void read(LayerStatus &status)
can::FrameListenerConstSharedPtr emcy_listener_
Master::MasterSharedPtr MasterSharedPtr
const can::Header header_
virtual void removeNode(void *const ptr)=0
virtual void handleInit(LayerStatus &status)
CommInterface::FrameListenerConstSharedPtr FrameListenerConstSharedPtr
std::shared_ptr< Node > NodeSharedPtr
const SyncCounterSharedPtr sync_
static RPDOSharedPtr create(const can::CommInterfaceSharedPtr interface, const ObjectStorageSharedPtr &storage, const uint16_t &com_index, const uint16_t &map_index)
const std::vector< typename Chain< T >::MemberSharedPtr > & getElements()
time_point get_abs_time(const time_duration &timeout)
SyncCounter(const SyncProperties &p)
TPDO(const can::CommInterfaceSharedPtr interface)
void transmitAndWait(const canopen::ObjectDict::Entry &entry, const String &data, String *result)
virtual void handleRecover(LayerStatus &status)
virtual MasterSharedPtr allocate(const std::string &name, can::CommInterfaceSharedPtr interface)=0
const ObjectStorageSharedPtr storage_
void enterState(const State &s)
void call(void(T::*func)(V &), std::vector< V > &vs)
void write(const canopen::ObjectDict::Entry &entry, const String &data)
void handleEMCY(const can::Frame &msg)
bool init(const ObjectStorageSharedPtr &storage, const uint16_t &com_index, const uint16_t &map_index)
std::vector< BufferSharedPtr > buffers
const can::CommInterfaceSharedPtr interface_
std::shared_ptr< T > MemberSharedPtr
std::shared_ptr< SyncLayer > SyncLayerSharedPtr
void handleFrame(const can::Frame &msg)
ObjectStorage::ObjectStorageSharedPtr ObjectStorageSharedPtr
StateListener::ListenerConstSharedPtr StateListenerConstSharedPtr
Master & operator=(const Master &)=delete
uint8_t transmission_type
canopen_master
Author(s): Mathias Lüdtke
autogenerated on Wed Mar 2 2022 00:52:26