Class CallbackHandlers
Defined in File callback.hpp
Class Documentation
-
class CallbackHandlers
Callback handlers for incoming u-blox messages.
Public Functions
-
inline explicit CallbackHandlers(int debug)
-
template<typename T>
inline void insert(typename CallbackHandler_<T>::Callback callback)
-
template<typename T>
inline void insert(typename CallbackHandler_<T>::Callback callback, unsigned int message_id)
-
inline void set_nmea_callback(std::function<void(const std::string&)> callback)
Add a callback handler for nmea messages.
- Parameters:
callback – the callback handler for the message
-
inline void handle(ublox::Reader &reader)
Calls the callback handler for the message in the reader.
- Parameters:
reader – a reader containing a u-blox message
-
inline void handle_nmea(ublox::Reader &reader)
Calls the callback handler for the nmea messages in the reader.
- Parameters:
reader – a reader containing an nmea message
-
template<typename T>
inline bool read(T &message, const std::chrono::milliseconds &timeout) Read a u-blox message of the given type.
- Parameters:
message – the received u-blox message
timeout – the amount of time to wait for the desired message
-
inline size_t readCallback(unsigned char *data, std::size_t size)
Processes u-blox messages in the given buffer & clears the read messages from the buffer.
- Parameters:
data – the buffer of u-blox messages to process
size – the size of the buffer
- Returns:
the number of bytes consumed
-
inline explicit CallbackHandlers(int debug)