sbp.client.handler module¶
The sbp.client.handler
module contains classes related to
SBP message handling.
-
class
sbp.client.handler.
Handler
(source)[source]¶ Bases:
object
The
Handler
class provides an interface for connecting handlers to a driver providing SBP messages. Also provides queued and filtered iterators for synchronous, blocking use in other threads.- source : Iterable of tuple(SBP message, {‘time’:’ISO 8601 str’})
- Stream of SBP messages
-
add_callback
(callback, msg_type=None)[source]¶ Add per message type or global callback.
- callback : fn
- Callback function
- msg_type : int | iterable
- Message type to register callback against. Default None means global callback. Iterable type adds the callback to all the message types.
-
filter
(msg_type=None, maxsize=0)[source]¶ Get a filtered iterator of messages for synchronous, blocking use in another thread.
-
remove_callback
(callback, msg_type=None)[source]¶ Remove per message type of global callback.
- callback : fn
- Callback function
- msg_type : int | iterable
- Message type to remove callback from. Default None means global callback. Iterable type removes the callback from all the message types.
-
wait
(msg_type, timeout=1.0)[source]¶ Wait for a SBP message.
- msg_type : int
- SBP message type.
- timeout : float
- Waiting period
-
wait_callback
(callback, msg_type=None, timeout=1.0)[source]¶ Wait for a SBP message with a callback.
- callback : fn
- Callback function
- msg_type : int | iterable
- Message type to register callback against. Default None means global callback. Iterable type adds the callback to all the message types.
- timeout : float
- Waiting period