31 command_buffer.
attach(toDevice);
32 reply_buffer.
attach(fromDevice);
75 if (
nullptr == m_iserial)
91bool SerialPort_nws_yarp::detach()
97bool SerialPort_nws_yarp::receive(
Bottle& msg)
99 if (m_iserial !=
nullptr)
110int SerialPort_nws_yarp::receiveChar(
char&
c)
112 if (m_iserial !=
nullptr)
122bool SerialPort_nws_yarp::closeMain()
132 if (callback_impl) {
delete callback_impl; callback_impl=
nullptr;}
154 std::lock_guard <std::mutex>
lg(m_mutex);
157 return m_iser->
setDTR(enable);
165 std::lock_guard <std::mutex>
lg(m_mutex);
168 return m_iser->
flush();
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
void setInterfaces(yarp::dev::ISerialDevice *iser)
bool setDTR(bool enable) override
Callback implementation after buffered input.
yarp::dev::ISerialDevice * m_iser
ImplementCallbackHelper2()
void onRead(Bottle &b) override
Callback method.
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
virtual ~SerialPort_nws_yarp() override
void run() override
Main body of the new thread.
bool close() override
Close the DeviceDriver.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
A generic interface to serial port devices.
virtual bool setDTR(bool enable)=0
Enable/Disable DTR protocol.
virtual int flush()=0
Flushes the internal buffer.
virtual bool send(const yarp::os::Bottle &msg)=0
Sends a string of chars to the serial communications channel.
virtual int receiveChar(char &chr)=0
Gets one single char from the receive queue.
virtual bool receive(yarp::os::Bottle &msg)=0
Gets the existing chars in the receive queue.
A container for a device driver.
A simple collection of objects that can be described and transmitted in a portable way.
void clear()
Empties the bottle of any objects it contains.
A mini-server for performing network communication in the background.
An interface for reading from a network connection.
void attach(Port &port)
Attach this buffer to a particular port.
void useCallback(TypedReaderCallback< T > &callback) override
Set an object whose onRead method will be called when data is available.
void disableCallback() override
Remove a callback set up with useCallback()
T & get()
A synonym of PortWriterBuffer::prepare.
void write(bool forceStrict=false)
Try to write the last buffer returned by PortWriterBuffer::get.
void attach(Port &port)
Set the Port to which objects will be written.
void setReader(PortReader &reader) override
Set an external reader for port data.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
A base class for nested structures that can be searched.
static void delaySystem(double seconds)
bool stop()
Stop the thread.
bool isStopping()
Returns true if the thread is stopping (Thread::stop has been called).
bool isRunning()
Returns true if the thread is running (Thread::start has been called successfully and the thread has ...
bool start()
Start the new thread running.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)