ROSaic
Public Member Functions | Protected Member Functions | Protected Attributes
io_comm_rx::AsyncManager< StreamT > Class Template Reference

This is the central interface between ROSaic and the Rx(s), managing I/O operations such as reading messages and sending commands.. More...

#include <async_manager.hpp>

Inheritance diagram for io_comm_rx::AsyncManager< StreamT >:
Inheritance graph
[legend]
Collaboration diagram for io_comm_rx::AsyncManager< StreamT >:
Collaboration graph
[legend]

Public Member Functions

 AsyncManager (boost::shared_ptr< StreamT > stream, boost::shared_ptr< boost::asio::io_service > io_service, std::size_t buffer_size=8192)
 Class constructor. More...
 
virtual ~AsyncManager ()
 
void setCallback (const Callback &callback)
 Sets the callback function. More...
 
void wait (uint16_t *count)
 Waits count seconds before throwing ROS_INFO message in case no message from the receiver arrived. More...
 
bool send (std::string cmd, std::size_t size)
 Sends commands via the I/O stream. More...
 
bool isOpen () const
 Determines whether or not the connection is open. More...
 
- Public Member Functions inherited from io_comm_rx::Manager
virtual ~Manager ()
 

Protected Member Functions

void read ()
 Reads in via async_read_some and hands certain number of bytes (bytes_transferred) over to async_read_some_handler. More...
 
void asyncReadSomeHandler (const boost::system::error_code &error, std::size_t bytes_transferred)
 Handler for async_read_some (Boost library).. More...
 
void write (std::string cmd, std::size_t size)
 Sends command "cmd" to the Rx. More...
 
void close ()
 Closes stream "stream_". More...
 
void tryParsing ()
 Tries parsing SBF/NMEA whenever the boolean class variable "try_parsing" is true. More...
 
void callAsyncWait (uint16_t *count)
 Handles the ROS_INFO throwing (if no incoming message) More...
 

Protected Attributes

boost::mutex parse_mutex_
 Mutex to control changes of class variable "try_parsing". More...
 
bool try_parsing_
 Determines when the tryParsing() method will attempt parsing SBF/NMEA. More...
 
bool allow_writing_
 Determines when the asyncReadSomeHandler() method should write SBF/NMEA into the circular buffer. More...
 
boost::condition_variable parsing_condition_
 Condition variable complementing "parse_mutex". More...
 
boost::shared_ptr< StreamT > stream_
 Stream, represents either serial or TCP/IP connection. More...
 
boost::shared_ptr< boost::asio::io_service > io_service_
 io_context object More...
 
std::vector< uint8_t > in_
 Buffer for async_read_some() to read continuous SBF/NMEA stream. More...
 
CircularBuffer circular_buffer_
 Circular buffer to avoid unsuccessful SBF/NMEA parsing due to incomplete messages. More...
 
uint8_t * to_be_parsed_
 Memory location where read_callback_ will start reading unless part of SBF/NMEA had to be appended before. More...
 
boost::shared_ptr< boost::thread > async_background_thread_
 New thread for receiving incoming messages. More...
 
Callback read_callback_
 Callback to be called once message arrives. More...
 
bool stopping_
 Whether or not we want to sever the connection to the Rx. More...
 
const std::size_t buffer_size_
 Size of in_ buffers. More...
 
boost::asio::deadline_timer timer_
 Boost timer for throwing ROS_INFO message once timed out due to lack of incoming messages. More...
 
const uint16_t count_max_
 Number of seconds before ROS_INFO message is thrown (if no incoming message) More...
 
uint16_t do_read_count_
 Number of times the DoRead() method has been called (only counts initially) More...
 

Additional Inherited Members

- Public Types inherited from io_comm_rx::Manager
typedef boost::function< void(const uint8_t *, std::size_t &)> Callback
 

Detailed Description

template<typename StreamT>
class io_comm_rx::AsyncManager< StreamT >

This is the central interface between ROSaic and the Rx(s), managing I/O operations such as reading messages and sending commands..

StreamT is either boost::asio::serial_port or boost::asio::tcp::ip

Definition at line 112 of file async_manager.hpp.

Constructor & Destructor Documentation

◆ AsyncManager()

template<typename StreamT >
io_comm_rx::AsyncManager< StreamT >::AsyncManager ( boost::shared_ptr< StreamT >  stream,
boost::shared_ptr< boost::asio::io_service >  io_service,
std::size_t  buffer_size = 8192 
)

Class constructor.

Parameters
streamWhether TCP/IP or serial communication, either boost::asio::serial_port or boost::asio::tcp::ip
io_serviceThe io_context object. The io_context represents your program's link to the operating system's I/O services.

Definition at line 296 of file async_manager.hpp.

References io_comm_rx::AsyncManager< StreamT >::async_background_thread_, io_comm_rx::AsyncManager< StreamT >::buffer_size_, io_comm_rx::AsyncManager< StreamT >::callAsyncWait(), io_comm_rx::AsyncManager< StreamT >::in_, io_comm_rx::AsyncManager< StreamT >::io_service_, io_comm_rx::AsyncManager< StreamT >::stream_, and io_comm_rx::AsyncManager< StreamT >::tryParsing().

298  : timer_(*(io_service.get()), boost::posix_time::seconds(1)),
299  stopping_(false), try_parsing_(false), allow_writing_(true), do_read_count_(0), buffer_size_(buffer_size),
300  count_max_(6), circular_buffer_(buffer_size)
301  // Since buffer_size = 8912 in declaration, no need in definition any more (even yields error message,
302  // since "overwrite").
303  {
304  ROS_DEBUG("Setting the private stream variable of the AsyncManager instance.");
305  stream_ = stream;
306  io_service_ = io_service;
307  in_.resize(buffer_size_);
308 
309  io_service_->post(boost::bind(&AsyncManager<StreamT>::read, this));
310  // This function is used to ask the io_service to execute the given handler, but without allowing the io_service
311  // to call the handler from inside this function. The function signature of the handler must be: void handler();
312  // The io_service guarantees that the handler (given as parameter) will only be called in a thread in which the
313  // run(), run_one(), poll() or poll_one() member functions is currently being invoked. So the fundamental
314  // difference is that dispatch will execute the work right away if it can and queue it otherwise while post queues the work no matter what.
315  async_background_thread_.reset(new boost::thread(boost::bind(&boost::asio::io_service::run, io_service_)));
316  // Note that io_service_ is already pointer, hence need dereferencing operator & (ampersand). If the value of the
317  // pointer for the current thread is changed using reset(), then the previous value is destroyed by calling the
318  // cleanup routine. Alternatively, the stored value can be reset to NULL and the prior value returned by calling
319  // the release() member function, allowing the application to take back responsibility for destroying the object.
320  uint16_t count = 0;
321  boost::thread(boost::bind(&AsyncManager::callAsyncWait, this, &count));
322 
323  ROS_DEBUG("Launching tryParsing() thread..");
324  boost::thread(boost::bind(&AsyncManager::tryParsing, this));
325  } // Calls std::terminate() on thread just created
void read()
Reads in via async_read_some and hands certain number of bytes (bytes_transferred) over to async_read...
uint16_t do_read_count_
Number of times the DoRead() method has been called (only counts initially)
boost::asio::deadline_timer timer_
Boost timer for throwing ROS_INFO message once timed out due to lack of incoming messages.
const uint16_t count_max_
Number of seconds before ROS_INFO message is thrown (if no incoming message)
const std::size_t buffer_size_
Size of in_ buffers.
CircularBuffer circular_buffer_
Circular buffer to avoid unsuccessful SBF/NMEA parsing due to incomplete messages.
boost::shared_ptr< boost::asio::io_service > io_service_
io_context object
std::vector< uint8_t > in_
Buffer for async_read_some() to read continuous SBF/NMEA stream.
boost::shared_ptr< boost::thread > async_background_thread_
New thread for receiving incoming messages.
boost::shared_ptr< StreamT > stream_
Stream, represents either serial or TCP/IP connection.
void callAsyncWait(uint16_t *count)
Handles the ROS_INFO throwing (if no incoming message)
bool allow_writing_
Determines when the asyncReadSomeHandler() method should write SBF/NMEA into the circular buffer...
bool try_parsing_
Determines when the tryParsing() method will attempt parsing SBF/NMEA.
void tryParsing()
Tries parsing SBF/NMEA whenever the boolean class variable "try_parsing" is true. ...
bool stopping_
Whether or not we want to sever the connection to the Rx.
Here is the call graph for this function:

◆ ~AsyncManager()

template<typename StreamT >
io_comm_rx::AsyncManager< StreamT >::~AsyncManager ( )
virtual

Definition at line 328 of file async_manager.hpp.

References io_comm_rx::AsyncManager< StreamT >::async_background_thread_.

329  {
330  async_background_thread_->join();
331  }
boost::shared_ptr< boost::thread > async_background_thread_
New thread for receiving incoming messages.

Member Function Documentation

◆ asyncReadSomeHandler()

template<typename StreamT >
void io_comm_rx::AsyncManager< StreamT >::asyncReadSomeHandler ( const boost::system::error_code &  error,
std::size_t  bytes_transferred 
)
protected

Handler for async_read_some (Boost library)..

Definition at line 348 of file async_manager.hpp.

References io_comm_rx::AsyncManager< StreamT >::allow_writing_, io_comm_rx::AsyncManager< StreamT >::buffer_size_, io_comm_rx::AsyncManager< StreamT >::circular_buffer_, io_comm_rx::AsyncManager< StreamT >::in_, io_comm_rx::AsyncManager< StreamT >::io_service_, io_comm_rx::AsyncManager< StreamT >::parse_mutex_, io_comm_rx::AsyncManager< StreamT >::parsing_condition_, io_comm_rx::AsyncManager< StreamT >::read_callback_, io_comm_rx::AsyncManager< StreamT >::stopping_, io_comm_rx::AsyncManager< StreamT >::try_parsing_, and CircularBuffer::write().

350  {
351  if (error)
352  {
353  ROS_ERROR("Rx ASIO input buffer read error: %s, %li", error.message().c_str(), bytes_transferred);
354  }
355  else if (bytes_transferred > 0)
356  {
357  if (read_callback_) //Will be false in InitializeSerial (first call) since read_callback_ not added yet..
358  {
359  boost::mutex::scoped_lock lock(parse_mutex_);
360  parsing_condition_.wait(lock, [this](){return allow_writing_;});
361  circular_buffer_.write(in_.data(), bytes_transferred);
362  allow_writing_ = false;
363  try_parsing_ = true;
364  lock.unlock();
365  parsing_condition_.notify_one();
366  std::vector<uint8_t> empty;
367  in_ = empty;
368  in_.resize(buffer_size_);
369  }
370  }
371 
372  if (!stopping_)
373  io_service_->post(boost::bind(&AsyncManager<StreamT>::read, this));
374  }
void read()
Reads in via async_read_some and hands certain number of bytes (bytes_transferred) over to async_read...
const std::size_t buffer_size_
Size of in_ buffers.
std::size_t write(const uint8_t *data, std::size_t bytes)
Returns number of bytes written.
CircularBuffer circular_buffer_
Circular buffer to avoid unsuccessful SBF/NMEA parsing due to incomplete messages.
boost::shared_ptr< boost::asio::io_service > io_service_
io_context object
std::vector< uint8_t > in_
Buffer for async_read_some() to read continuous SBF/NMEA stream.
boost::condition_variable parsing_condition_
Condition variable complementing "parse_mutex".
Callback read_callback_
Callback to be called once message arrives.
bool allow_writing_
Determines when the asyncReadSomeHandler() method should write SBF/NMEA into the circular buffer...
boost::mutex parse_mutex_
Mutex to control changes of class variable "try_parsing".
bool try_parsing_
Determines when the tryParsing() method will attempt parsing SBF/NMEA.
bool stopping_
Whether or not we want to sever the connection to the Rx.
Here is the call graph for this function:

◆ callAsyncWait()

template<typename StreamT >
void io_comm_rx::AsyncManager< StreamT >::callAsyncWait ( uint16_t *  count)
protected

Handles the ROS_INFO throwing (if no incoming message)

Definition at line 290 of file async_manager.hpp.

References io_comm_rx::AsyncManager< StreamT >::wait().

Referenced by io_comm_rx::AsyncManager< StreamT >::AsyncManager().

291  {
292  timer_.async_wait(boost::bind(&AsyncManager::wait, this, count));
293  }
boost::asio::deadline_timer timer_
Boost timer for throwing ROS_INFO message once timed out due to lack of incoming messages.
void wait(uint16_t *count)
Waits count seconds before throwing ROS_INFO message in case no message from the receiver arrived...
Here is the call graph for this function:
Here is the caller graph for this function:

◆ close()

template<typename StreamT >
void io_comm_rx::AsyncManager< StreamT >::close ( )
protected

Closes stream "stream_".

Definition at line 377 of file async_manager.hpp.

References io_comm_rx::AsyncManager< StreamT >::stopping_, and io_comm_rx::AsyncManager< StreamT >::stream_.

378  {
379  stopping_ = true;
380  boost::system::error_code error;
381  stream_->close(error);
382  if(error)
383  {
384  ROS_ERROR_STREAM("Error while closing the AsyncManager: " << error.message().c_str());
385  }
386  }
boost::shared_ptr< StreamT > stream_
Stream, represents either serial or TCP/IP connection.
bool stopping_
Whether or not we want to sever the connection to the Rx.

◆ isOpen()

template<typename StreamT >
bool io_comm_rx::AsyncManager< StreamT >::isOpen ( ) const
inlinevirtual

Determines whether or not the connection is open.

Implements io_comm_rx::Manager.

Definition at line 134 of file async_manager.hpp.

134 { return stream_->is_open(); }
boost::shared_ptr< StreamT > stream_
Stream, represents either serial or TCP/IP connection.

◆ read()

template<typename StreamT >
void io_comm_rx::AsyncManager< StreamT >::read ( )
protected

Reads in via async_read_some and hands certain number of bytes (bytes_transferred) over to async_read_some_handler.

Definition at line 334 of file async_manager.hpp.

References io_comm_rx::AsyncManager< StreamT >::do_read_count_, io_comm_rx::AsyncManager< StreamT >::in_, and io_comm_rx::AsyncManager< StreamT >::stream_.

335  {
336  stream_->async_read_some(
337  boost::asio::buffer(in_.data(),
338  in_.size()),
340  boost::asio::placeholders::error,
341  boost::asio::placeholders::bytes_transferred));
342  // The handler is async_read_some_handler, whose call is postponed to
343  // when async_read_some completes.
344  if (do_read_count_ < 5) ++do_read_count_;
345  }
uint16_t do_read_count_
Number of times the DoRead() method has been called (only counts initially)
void asyncReadSomeHandler(const boost::system::error_code &error, std::size_t bytes_transferred)
Handler for async_read_some (Boost library)..
std::vector< uint8_t > in_
Buffer for async_read_some() to read continuous SBF/NMEA stream.
boost::shared_ptr< StreamT > stream_
Stream, represents either serial or TCP/IP connection.

◆ send()

template<typename StreamT >
bool io_comm_rx::AsyncManager< StreamT >::send ( std::string  cmd,
std::size_t  size 
)
virtual

Sends commands via the I/O stream.

Parameters
cmdThe command to be sent
sizeThe size of the command

Implements io_comm_rx::Manager.

Definition at line 266 of file async_manager.hpp.

267  {
268  if(size == 0)
269  {
270  ROS_ERROR("Message size to be sent to the Rx would be 0");
271  return true;
272  }
273 
274  std::vector<uint8_t> vector_temp(cmd.begin(), cmd.end());
275  uint8_t *p = &vector_temp[0];
276 
277  io_service_->post(boost::bind(&AsyncManager<StreamT>::write, this, cmd, size));
278  return true;
279  }
boost::shared_ptr< boost::asio::io_service > io_service_
io_context object
void write(std::string cmd, std::size_t size)
Sends command "cmd" to the Rx.

◆ setCallback()

template<typename StreamT >
void io_comm_rx::AsyncManager< StreamT >::setCallback ( const Callback callback)
inlinevirtual

Sets the callback function.

Implements io_comm_rx::Manager.

Definition at line 123 of file async_manager.hpp.

References io_comm_rx::Manager::send(), and io_comm_rx::Manager::wait().

123 { read_callback_ = callback; }
Callback read_callback_
Callback to be called once message arrives.
Here is the call graph for this function:

◆ tryParsing()

template<typename StreamT >
void io_comm_rx::AsyncManager< StreamT >::tryParsing ( )
protected

Tries parsing SBF/NMEA whenever the boolean class variable "try_parsing" is true.

Definition at line 207 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::AsyncManager().

208  {
209  uint8_t * to_be_parsed;
210  to_be_parsed = new uint8_t[buffer_size_];
211  to_be_parsed_ = to_be_parsed;
212  bool timed_out = false;
213  std::size_t shift_bytes = 0;
214  std::size_t arg_for_read_callback = 0;
215 
216  while(!timed_out) // Loop will stop if condition variable timed out
217  {
218  boost::mutex::scoped_lock lock(parse_mutex_);
219  parsing_condition_.wait_for(lock, boost::chrono::seconds(10), [this](){return try_parsing_;});
220  bool timed_out = !try_parsing_;
221  if (timed_out) break;
222  try_parsing_ = false;
223  allow_writing_ = true;
224  std::size_t current_buffer_size = circular_buffer_.size();
225  arg_for_read_callback += current_buffer_size;
226  circular_buffer_.read(to_be_parsed + shift_bytes, current_buffer_size);
227 
228  lock.unlock();
229  parsing_condition_.notify_one();
230 
231  try
232  {
233  ROS_DEBUG("Calling read_callback_() method, with number of bytes to be parsed being %li",
234  arg_for_read_callback);
235  read_callback_(to_be_parsed_, arg_for_read_callback);
236  }
237  catch (std::size_t& parsing_failed_here)
238  {
239  to_be_parsed_ = to_be_parsed + parsing_failed_here;
240  ROS_DEBUG("Current buffer size is %li and parsing_failed_here is %li", current_buffer_size,
241  parsing_failed_here);
242  arg_for_read_callback = arg_for_read_callback - parsing_failed_here;
243  if (arg_for_read_callback < 0) // In case some parsing error was not caught, which should never happen..
244  {
245  delete [] to_be_parsed; // Freeing memory
246  to_be_parsed = new uint8_t[buffer_size_];
247  to_be_parsed_ = to_be_parsed;
248  shift_bytes = 0;
249  arg_for_read_callback = 0;
250  continue;
251  }
252  shift_bytes += current_buffer_size;
253  continue;
254  }
255  delete [] to_be_parsed; // Freeing memory
256  to_be_parsed = new uint8_t[buffer_size_];
257  to_be_parsed_ = to_be_parsed;
258  shift_bytes = 0;
259  arg_for_read_callback = 0;
260  }
261  ROS_INFO("TryParsing() method finished since it did not receive anything to parse for 10 seconds..");
262  }
const std::size_t buffer_size_
Size of in_ buffers.
CircularBuffer circular_buffer_
Circular buffer to avoid unsuccessful SBF/NMEA parsing due to incomplete messages.
uint8_t * to_be_parsed_
Memory location where read_callback_ will start reading unless part of SBF/NMEA had to be appended be...
boost::condition_variable parsing_condition_
Condition variable complementing "parse_mutex".
std::size_t size() const
Returns size_.
Callback read_callback_
Callback to be called once message arrives.
bool allow_writing_
Determines when the asyncReadSomeHandler() method should write SBF/NMEA into the circular buffer...
boost::mutex parse_mutex_
Mutex to control changes of class variable "try_parsing".
bool try_parsing_
Determines when the tryParsing() method will attempt parsing SBF/NMEA.
std::size_t read(uint8_t *data, std::size_t bytes)
Returns number of bytes read.
Here is the caller graph for this function:

◆ wait()

template<typename StreamT >
void io_comm_rx::AsyncManager< StreamT >::wait ( uint16_t *  count)
virtual

Waits count seconds before throwing ROS_INFO message in case no message from the receiver arrived.

Implements io_comm_rx::Manager.

Definition at line 389 of file async_manager.hpp.

References io_comm_rx::AsyncManager< StreamT >::async_background_thread_, io_comm_rx::AsyncManager< StreamT >::count_max_, io_comm_rx::AsyncManager< StreamT >::do_read_count_, and io_comm_rx::AsyncManager< StreamT >::timer_.

Referenced by io_comm_rx::AsyncManager< StreamT >::callAsyncWait().

390  {
391  if (*count < count_max_)
392  {
393  ++(*count);
394  timer_.expires_at(timer_.expires_at() + boost::posix_time::seconds(1));
395  if (!(*count == count_max_))
396  {
397  timer_.async_wait(boost::bind(&AsyncManager::wait, this, count));
398  }
399  }
400  if ((*count == count_max_) && (do_read_count_ < 3))
401  // Why 3? Even if there are no incoming messages, read() is called once.
402  // It will be called a second time in TCP/IP mode since (just example) "IP10<" is transmitted.
403  {
404  ROS_INFO("No incoming messages, driver stopped, ros::spin() will spin forever unless you hit Ctrl+C.");
405  async_background_thread_->interrupt();
406  }
407  }
uint16_t do_read_count_
Number of times the DoRead() method has been called (only counts initially)
boost::asio::deadline_timer timer_
Boost timer for throwing ROS_INFO message once timed out due to lack of incoming messages.
const uint16_t count_max_
Number of seconds before ROS_INFO message is thrown (if no incoming message)
boost::shared_ptr< boost::thread > async_background_thread_
New thread for receiving incoming messages.
void wait(uint16_t *count)
Waits count seconds before throwing ROS_INFO message in case no message from the receiver arrived...
Here is the caller graph for this function:

◆ write()

template<typename StreamT >
void io_comm_rx::AsyncManager< StreamT >::write ( std::string  cmd,
std::size_t  size 
)
protected

Sends command "cmd" to the Rx.

Definition at line 282 of file async_manager.hpp.

283  {
284  boost::asio::write(*stream_, boost::asio::buffer(cmd.data(), size));
285  // Prints the data that was sent
286  ROS_DEBUG("Sent the following %li bytes to the Rx: \n%s", size, cmd.c_str());
287  }
boost::shared_ptr< StreamT > stream_
Stream, represents either serial or TCP/IP connection.

Field Documentation

◆ allow_writing_

template<typename StreamT >
bool io_comm_rx::AsyncManager< StreamT >::allow_writing_
protected

Determines when the asyncReadSomeHandler() method should write SBF/NMEA into the circular buffer.

Definition at line 160 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::asyncReadSomeHandler().

◆ async_background_thread_

template<typename StreamT >
boost::shared_ptr<boost::thread> io_comm_rx::AsyncManager< StreamT >::async_background_thread_
protected

◆ buffer_size_

template<typename StreamT >
const std::size_t io_comm_rx::AsyncManager< StreamT >::buffer_size_
protected

◆ circular_buffer_

template<typename StreamT >
CircularBuffer io_comm_rx::AsyncManager< StreamT >::circular_buffer_
protected

Circular buffer to avoid unsuccessful SBF/NMEA parsing due to incomplete messages.

Definition at line 175 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::asyncReadSomeHandler().

◆ count_max_

template<typename StreamT >
const uint16_t io_comm_rx::AsyncManager< StreamT >::count_max_
protected

Number of seconds before ROS_INFO message is thrown (if no incoming message)

Definition at line 196 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::wait().

◆ do_read_count_

template<typename StreamT >
uint16_t io_comm_rx::AsyncManager< StreamT >::do_read_count_
protected

Number of times the DoRead() method has been called (only counts initially)

Definition at line 202 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::read(), and io_comm_rx::AsyncManager< StreamT >::wait().

◆ in_

template<typename StreamT >
std::vector<uint8_t> io_comm_rx::AsyncManager< StreamT >::in_
protected

Buffer for async_read_some() to read continuous SBF/NMEA stream.

Definition at line 172 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::AsyncManager(), io_comm_rx::AsyncManager< StreamT >::asyncReadSomeHandler(), and io_comm_rx::AsyncManager< StreamT >::read().

◆ io_service_

template<typename StreamT >
boost::shared_ptr<boost::asio::io_service> io_comm_rx::AsyncManager< StreamT >::io_service_
protected

◆ parse_mutex_

template<typename StreamT >
boost::mutex io_comm_rx::AsyncManager< StreamT >::parse_mutex_
protected

Mutex to control changes of class variable "try_parsing".

Definition at line 154 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::asyncReadSomeHandler().

◆ parsing_condition_

template<typename StreamT >
boost::condition_variable io_comm_rx::AsyncManager< StreamT >::parsing_condition_
protected

Condition variable complementing "parse_mutex".

Definition at line 163 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::asyncReadSomeHandler().

◆ read_callback_

template<typename StreamT >
Callback io_comm_rx::AsyncManager< StreamT >::read_callback_
protected

Callback to be called once message arrives.

Definition at line 184 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::asyncReadSomeHandler().

◆ stopping_

template<typename StreamT >
bool io_comm_rx::AsyncManager< StreamT >::stopping_
protected

Whether or not we want to sever the connection to the Rx.

Definition at line 187 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::asyncReadSomeHandler(), and io_comm_rx::AsyncManager< StreamT >::close().

◆ stream_

template<typename StreamT >
boost::shared_ptr<StreamT> io_comm_rx::AsyncManager< StreamT >::stream_
protected

Stream, represents either serial or TCP/IP connection.

Definition at line 166 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::AsyncManager(), io_comm_rx::AsyncManager< StreamT >::close(), and io_comm_rx::AsyncManager< StreamT >::read().

◆ timer_

template<typename StreamT >
boost::asio::deadline_timer io_comm_rx::AsyncManager< StreamT >::timer_
protected

Boost timer for throwing ROS_INFO message once timed out due to lack of incoming messages.

Definition at line 193 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::wait().

◆ to_be_parsed_

template<typename StreamT >
uint8_t* io_comm_rx::AsyncManager< StreamT >::to_be_parsed_
protected

Memory location where read_callback_ will start reading unless part of SBF/NMEA had to be appended before.

Definition at line 178 of file async_manager.hpp.

◆ try_parsing_

template<typename StreamT >
bool io_comm_rx::AsyncManager< StreamT >::try_parsing_
protected

Determines when the tryParsing() method will attempt parsing SBF/NMEA.

Definition at line 157 of file async_manager.hpp.

Referenced by io_comm_rx::AsyncManager< StreamT >::asyncReadSomeHandler().


The documentation for this class was generated from the following file: