45 const std::string busname =
"slcan0";
49 const std::string baudrate =
"500K";
51 PRINT(
"List devices");
55 if (!master.
start(busname, baudrate)) {
56 ERROR(
"Starting master failed.");
60 std::this_thread::sleep_for(std::chrono::seconds(1));
65 for (
size_t i=0; i<num_devices; ++i) {
73 PRINT(
"Loading EDS from library...")
74 const std::
string loaded_eds_file = device.load_dictionary_from_library();
75 PRINT("Loaded the following EDS file from the library: " << loaded_eds_file);
78 device.read_complete_dictionary();
79 device.print_dictionary();
Device & get_device(size_t index) const
Returns a reference to a slave device object.
void start()
Starts the node via NMT protocol and loads mandatory entries, operations, and constants.
size_t num_devices() const
Returns the number of slave devices in the network.
bool start(const std::string busname, const std::string &baudrate)
Starts master and creates Core.
This class represents a master node. It listens for new slaves and provides access to them via get_sl...
uint8_t get_node_id() const
Returns the node ID of the device.
This class represents a CanOpen slave device in the network.