10 #include <rokubimini/setup/Rokubimini.hpp> 22 using namespace soem_interface;
35 using BusMap = std::unordered_map<std::string, std::unique_ptr<rokubimini::soem_interface::EthercatBusBase>>;
58 bool addEthercatBus(std::unique_ptr<rokubimini::soem_interface::EthercatBusBase> bus);
65 bool startupAllBuses();
72 bool startupCommunication()
override;
77 void setBussesSafeOperational();
82 void setBussesPreOperational();
87 void setBussesOperational();
99 const unsigned int maxRetries = 40,
const double retrySleep = 0.001);
104 void readAllBuses()
override;
109 void writeToAllBuses()
override;
114 void shutdownAllBuses()
override;
126 return buses_.at(name).get();
137 std::unique_ptr<rokubimini::soem_interface::EthercatBusBase> extractBusByName(
const std::string& name);
169 bool loadSetup(std::vector<std::shared_ptr<rokubimini::Rokubimini>>& rokubiminis)
override;
190 const std::shared_ptr<setup::RokubiminiEthercat>& rokubiminiEthercatSetup)
const;
201 void setConfigMode()
override;
214 void setRunMode()
override;
The Rokubimini Ethercat class.
std::recursive_mutex busMutex_
Mutex prohibiting simultaneous access to EtherCAT bus manager.
BusMap buses_
Map with all the Ethercat buses available.
virtual bool addRokubiminiToBus(Rokubimini *rokubimini, const std::shared_ptr< setup::Rokubimini > &rokubiminiSetup) const
rokubimini::soem_interface::EthercatBusBase * getBusByName(const std::string &name) const
Returns a non owning bus pointer. The manager still manages all the buses.
std::unordered_map< std::string, std::unique_ptr< rokubimini::soem_interface::EthercatBusBase >> BusMap
std::shared_ptr< RokubiminiEthercatBusManager > RokubiminiEthercatBusManagerPtr
Class for managing an ethercat bus containing one or multiple slaves.
Inherits from RokubiminiBusManager. It's used for managing the Ethercat buses.