17 const std::string port = rokubimini_serial_setup->
serialPort_;
20 ROS_ERROR(
"[%s] The name of the port is empty.", rokubimini_setup->name_.c_str());
26 if (
rokubimini->getName() == rokubimini_serial_setup->name_)
45 auto impl_ptr = std::make_shared<RokubiminiSerialImpl>(
46 rokubiminiSerialSetup->name_, rokubiminiSerialSetup->serialPort_, rokubiminiSerialSetup->baudRate_);
56 if (!rokubimini_serial->init())
58 ROS_ERROR(
"[%s] The Serial device could not initialize", rokubimini_serial->getName().c_str());
69 if (!rokubimini_serial->setConfigMode())
71 ROS_ERROR(
"[%s] The Serial device could not switch to configuration mode", rokubimini_serial->getName().c_str());
79 if (!rokubimini_serial->setRunMode())
81 ROS_ERROR(
"[%s] The Serial device could not switch to run mode", rokubimini_serial->getName().c_str());
bool startupCommunication() override
Initializes the communication with the serial devices.
std::vector< std::shared_ptr< RokubiminiSerial > > attachedRokubiminiSerials_
std::string serialPort_
The serial port name.
void setImplPointer(const RokubiminiSerialImplPtr &implPtr)
Sets a pointer to the implementation.
The Rokubimini Serial class.
bool addRokubiminiToBus(RokubiminiSerial *rokubimini, const std::shared_ptr< setup::RokubiminiSerial > &rokubiminiSerialSetup) const
Creates a RokubiminiSerial Implementation object for the.
The Rokubimini Serial Setup class.
void setConfigMode() override
Sets all the serial devices in config mode.
std::vector< std::shared_ptr< setup::Rokubimini > > attachedRokubiminiSetups_
void setRunMode() override
Sets all the serial devices in run mode.
bool loadSetup(std::vector< std::shared_ptr< rokubimini::Rokubimini >> &rokubiminis) override
Checks for non-empty serial port names and calls the addRokubiminiToBus() method. ...