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

This is the central interface between this ROS driver and the mosaic receiver(s), managing I/O operations such as reading messages and sending commands.. More...

#include <async_manager.hpp>

Inheritance diagram for io_comm_mosaic::AsyncManager< StreamT >:
Inheritance graph
[legend]
Collaboration diagram for io_comm_mosaic::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_mosaic::Manager
virtual ~Manager ()
 

Protected Member Functions

void DoRead ()
 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 DoWrite (std::string cmd, std::size_t size)
 Sends all the data in the output buffer. More...
 
void DoClose ()
 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_mosaic::Manager
typedef boost::function< void(const uint8_t *, std::size_t &)> Callback
 

Detailed Description

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

This is the central interface between this ROS driver and the mosaic receiver(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 110 of file async_manager.hpp.

Constructor & Destructor Documentation

◆ AsyncManager()

template<typename StreamT >
io_comm_mosaic::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 284 of file async_manager.hpp.

References io_comm_mosaic::AsyncManager< StreamT >::async_background_thread_, io_comm_mosaic::AsyncManager< StreamT >::buffer_size_, io_comm_mosaic::AsyncManager< StreamT >::CallAsyncWait(), io_comm_mosaic::AsyncManager< StreamT >::in_, io_comm_mosaic::AsyncManager< StreamT >::io_service_, io_comm_mosaic::AsyncManager< StreamT >::stream_, and io_comm_mosaic::AsyncManager< StreamT >::TryParsing().

286  : timer_(*(io_service.get()), boost::posix_time::seconds(1)),
287  stopping_(false), try_parsing_(false), allow_writing_(true), do_read_count_(0), buffer_size_(buffer_size),
288  count_max_(6), circular_buffer_(buffer_size) // Since buffer_size = 8912 in declaration, no need in definition any more (even yields error message, since "overwrite").
289  {
290  ROS_DEBUG("Setting the private stream variable of the AsyncManager instance.");
291  stream_ = stream;
292  io_service_ = io_service;
293  in_.resize(buffer_size_);
294 
295  io_service_->post(boost::bind(&AsyncManager<StreamT>::DoRead, this));
296  // This function is used to ask the io_service to execute the given handler, but without allowing the io_service to call the handler from inside this function.
297  // The function signature of the handler must be: void handler();
298  // The io_service guarantees that the handler (given as parameter) will only be called in a thread in which the run(), run_one(), poll() or poll_
299  // one() member functions is currently being invoked.
300  // So the fundamental 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.
301  async_background_thread_.reset(new boost::thread(boost::bind(&boost::asio::io_service::run, io_service_))); // Note that io_service_ is already pointer.
302  // If the value of the pointer for the current thread is changed using reset(), then the previous value is destroyed by calling the cleanup routine.
303  // Alternatively, the stored value can be reset to NULL and the prior value returned by calling the release() member function,
304  // allowing the application to take back responsibility for destroying the object.
305  uint16_t count = 0;
306  boost::thread(boost::bind(&AsyncManager::CallAsyncWait, this, &count));
307 
308  ROS_DEBUG("Launching TryParsing() thread..");
309  boost::thread(boost::bind(&AsyncManager::TryParsing, this));
310  } // Calls std::terminate() on thread just created
void TryParsing()
Tries parsing SBF/NMEA whenever the boolean class variable "try_parsing" is true. ...
void DoRead()
Reads in via async_read_some and hands certain number of bytes (bytes_transferred) over to async_read...
bool stopping_
Whether or not we want to sever the connection to the Rx.
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.
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.
boost::asio::deadline_timer timer_
Boost timer for throwing ROS_INFO message once timed out due to lack of incoming messages.
const std::size_t buffer_size_
Size of in_ buffers.
boost::shared_ptr< boost::thread > async_background_thread_
New thread for receiving incoming messages.
void CallAsyncWait(uint16_t *count)
Handles the ROS_INFO throwing (if no incoming message)
uint16_t do_read_count_
Number of times the DoRead() method has been called (only counts initially)
CircularBuffer circular_buffer_
Circular Buffer to avoid unsuccessful SBF/NMEA parsing due to incomplete messages.
boost::shared_ptr< StreamT > stream_
Stream, represents either serial or TCP/IP connection.
const uint16_t count_max_
Number of seconds before ROS_INFO message is thrown (if no incoming message)
Here is the call graph for this function:

◆ ~AsyncManager()

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

Definition at line 313 of file async_manager.hpp.

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

314  {
315  async_background_thread_->join();
316  }
boost::shared_ptr< boost::thread > async_background_thread_
New thread for receiving incoming messages.

Member Function Documentation

◆ AsyncReadSomeHandler()

template<typename StreamT >
void io_comm_mosaic::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 332 of file async_manager.hpp.

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

334  {
335  if (error)
336  {
337  ROS_ERROR("mosaic ASIO input buffer read error: %s, %li", error.message().c_str(), bytes_transferred);
338  }
339  else if (bytes_transferred > 0)
340  {
341  if (read_callback_) //Will be false in InitializeSerial (first call) since read_callback_ not added yet..
342  {
343  boost::mutex::scoped_lock lock(parse_mutex_);
344  parsing_condition_.wait(lock, [this](){return allow_writing_;});
345  circular_buffer_.write(in_.data(), bytes_transferred);
346  allow_writing_ = false;
347  try_parsing_ = true;
348  lock.unlock();
349  parsing_condition_.notify_one();
350  std::vector<uint8_t> empty;
351  in_ = empty;
352  in_.resize(buffer_size_);
353  }
354  }
355 
356  if (!stopping_)
357  io_service_->post(boost::bind(&AsyncManager<StreamT>::DoRead, this));
358  }
void DoRead()
Reads in via async_read_some and hands certain number of bytes (bytes_transferred) over to async_read...
bool stopping_
Whether or not we want to sever the connection to the Rx.
std::size_t write(const uint8_t *data, std::size_t bytes)
Returns number of bytes written.
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::mutex parse_mutex_
Mutex to control changes of class variable "try_parsing".
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::condition_variable parsing_condition_
Condition variable complementing "parse_mutex".
bool try_parsing_
Determines when the TryParsing() method will attempt parsing SBF/NMEA.
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.
Here is the call graph for this function:

◆ CallAsyncWait()

template<typename StreamT >
void io_comm_mosaic::AsyncManager< StreamT >::CallAsyncWait ( uint16_t *  count)
protected

Handles the ROS_INFO throwing (if no incoming message)

Definition at line 278 of file async_manager.hpp.

References io_comm_mosaic::AsyncManager< StreamT >::Wait().

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

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

◆ DoClose()

template<typename StreamT >
void io_comm_mosaic::AsyncManager< StreamT >::DoClose ( )
protected

Closes Stream "stream_".

Definition at line 361 of file async_manager.hpp.

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

362  {
363  stopping_ = true;
364  boost::system::error_code error;
365  stream_->close(error);
366  if(error)
367  {
368  ROS_ERROR_STREAM("Error while closing the AsyncManager: " << error.message().c_str());
369  }
370  }
bool stopping_
Whether or not we want to sever the connection to the Rx.
boost::shared_ptr< StreamT > stream_
Stream, represents either serial or TCP/IP connection.

◆ DoRead()

template<typename StreamT >
void io_comm_mosaic::AsyncManager< StreamT >::DoRead ( )
protected

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

Definition at line 319 of file async_manager.hpp.

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

320  {
321  stream_->async_read_some(
322  boost::asio::buffer(in_.data(),
323  in_.size()),
325  boost::asio::placeholders::error,
326  boost::asio::placeholders::bytes_transferred));
327  // The handler is async_read_some_handler, whose call is postponed to when async_read_some completes.
328  if (do_read_count_ < 5) ++do_read_count_;
329  }
std::vector< uint8_t > in_
Buffer for async_read_some() to read continuous SBF/NMEA stream.
void AsyncReadSomeHandler(const boost::system::error_code &error, std::size_t bytes_transferred)
Handler for async_read_some (Boost library)..
uint16_t do_read_count_
Number of times the DoRead() method has been called (only counts initially)
boost::shared_ptr< StreamT > stream_
Stream, represents either serial or TCP/IP connection.

◆ DoWrite()

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

Sends all the data in the output buffer.

Definition at line 270 of file async_manager.hpp.

271  {
272  boost::asio::write(*stream_, boost::asio::buffer(cmd.data(), size));
273  // Prints the data that was sent
274  ROS_DEBUG("Sent the following %li bytes to mosaic: \n%s", size, cmd.c_str());
275  }
boost::shared_ptr< StreamT > stream_
Stream, represents either serial or TCP/IP connection.

◆ IsOpen()

template<typename StreamT >
bool io_comm_mosaic::AsyncManager< StreamT >::IsOpen ( ) const
inlinevirtual

Determines whether or not the connection is open.

Implements io_comm_mosaic::Manager.

Definition at line 132 of file async_manager.hpp.

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

◆ Send()

template<typename StreamT >
bool io_comm_mosaic::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_mosaic::Manager.

Definition at line 254 of file async_manager.hpp.

255  {
256  if(size == 0)
257  {
258  ROS_ERROR("Message size to be sent to mosaic would be 0");
259  return true;
260  }
261 
262  std::vector<uint8_t> vector_temp(cmd.begin(), cmd.end());
263  uint8_t *p = &vector_temp[0];
264 
265  io_service_->post(boost::bind(&AsyncManager<StreamT>::DoWrite, this, cmd, size));
266  return true;
267  }
void DoWrite(std::string cmd, std::size_t size)
Sends all the data in the output buffer.
boost::shared_ptr< boost::asio::io_service > io_service_
io_context object

◆ SetCallback()

template<typename StreamT >
void io_comm_mosaic::AsyncManager< StreamT >::SetCallback ( const Callback callback)
inlinevirtual

Sets the callback function.

Implements io_comm_mosaic::Manager.

Definition at line 121 of file async_manager.hpp.

References io_comm_mosaic::Manager::Send(), and io_comm_mosaic::Manager::Wait().

121 { 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_mosaic::AsyncManager< StreamT >::TryParsing ( )
protected

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

Definition at line 205 of file async_manager.hpp.

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

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

◆ Wait()

template<typename StreamT >
void io_comm_mosaic::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_mosaic::Manager.

Definition at line 373 of file async_manager.hpp.

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

Referenced by io_comm_mosaic::AsyncManager< StreamT >::CallAsyncWait().

374  {
375  if (*count < count_max_)
376  {
377  ++(*count);
378  timer_.expires_at(timer_.expires_at() + boost::posix_time::seconds(1));
379  if (!(*count == count_max_))
380  {
381  timer_.async_wait(boost::bind(&AsyncManager::Wait, this, count));
382  }
383  }
384  if ((*count == count_max_) && (do_read_count_ < 3)) // Why 3? Even if there are no incoming messages, doRead() is called once.
385  // It will be called a second time in TCP/IP mode since (just example) "IP10<" is transmitted.
386  {
387  ROS_INFO("No incoming messages, driver stopped, ros::spin() will spin forever unless you hit Ctrl+C.");
388  async_background_thread_->interrupt();
389  }
390  }
void Wait(uint16_t *count)
Waits count seconds before throwing ROS_INFO message in case no message from the receiver arrived...
boost::asio::deadline_timer timer_
Boost timer for throwing ROS_INFO message once timed out due to lack of incoming messages.
boost::shared_ptr< boost::thread > async_background_thread_
New thread for receiving incoming messages.
uint16_t do_read_count_
Number of times the DoRead() method has been called (only counts initially)
const uint16_t count_max_
Number of seconds before ROS_INFO message is thrown (if no incoming message)
Here is the caller graph for this function:

Field Documentation

◆ allow_writing_

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

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

Definition at line 158 of file async_manager.hpp.

Referenced by io_comm_mosaic::AsyncManager< StreamT >::AsyncReadSomeHandler().

◆ async_background_thread_

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

◆ buffer_size_

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

◆ circular_buffer_

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

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

Definition at line 173 of file async_manager.hpp.

Referenced by io_comm_mosaic::AsyncManager< StreamT >::AsyncReadSomeHandler().

◆ count_max_

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

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

Definition at line 194 of file async_manager.hpp.

Referenced by io_comm_mosaic::AsyncManager< StreamT >::Wait().

◆ do_read_count_

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

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

Definition at line 200 of file async_manager.hpp.

Referenced by io_comm_mosaic::AsyncManager< StreamT >::DoRead(), and io_comm_mosaic::AsyncManager< StreamT >::Wait().

◆ in_

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

◆ io_service_

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

◆ parse_mutex_

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

Mutex to control changes of class variable "try_parsing".

Definition at line 152 of file async_manager.hpp.

Referenced by io_comm_mosaic::AsyncManager< StreamT >::AsyncReadSomeHandler().

◆ parsing_condition_

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

Condition variable complementing "parse_mutex".

Definition at line 161 of file async_manager.hpp.

Referenced by io_comm_mosaic::AsyncManager< StreamT >::AsyncReadSomeHandler().

◆ read_callback_

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

Callback to be called once message arrives.

Definition at line 182 of file async_manager.hpp.

Referenced by io_comm_mosaic::AsyncManager< StreamT >::AsyncReadSomeHandler().

◆ stopping_

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

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

Definition at line 185 of file async_manager.hpp.

Referenced by io_comm_mosaic::AsyncManager< StreamT >::AsyncReadSomeHandler(), and io_comm_mosaic::AsyncManager< StreamT >::DoClose().

◆ stream_

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

◆ timer_

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

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

Definition at line 191 of file async_manager.hpp.

Referenced by io_comm_mosaic::AsyncManager< StreamT >::Wait().

◆ to_be_parsed_

template<typename StreamT >
uint8_t* io_comm_mosaic::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 176 of file async_manager.hpp.

◆ try_parsing_

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

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

Definition at line 155 of file async_manager.hpp.

Referenced by io_comm_mosaic::AsyncManager< StreamT >::AsyncReadSomeHandler().


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