Ivy Interface¶
-
class
pprzlink.ivy.
IvyMessagesInterface
(agent_name=None, start_ivy=True, verbose=False, ivy_bus='')[source]¶ -
bind_raw
(callback, regex='(.*)')[source]¶ Bind callback to Ivy messages matching regex (without any extra parsing)
Parameters: - callback – function called on new message with agent, message, from as params
- regex – regular expression for matching message
-
static
parse_pprz_msg
(callback, ivy_msg)[source]¶ Parse an Ivy message into a PprzMessage. Basically parts/args in string are separated by space, but char array can also contain a space:
|f,o,o, ,b,a,r|
in old format or"foo bar"
in new formatParameters: - callback – function to call with ac_id and parsed PprzMessage as params
- ivy_msg – Ivy message string to parse into PprzMessage
-
send
(msg, ac_id=None)[source]¶ Send a message
Parameters: - msg – PprzMessage or simple string
- ac_id – Needed if sending a PprzMessage of telemetry msg_class
Returns: Number of clients the message sent to, None if msg was invalid
-
send_raw_datalink
(msg)[source]¶ Send a PprzMessage of datalink msg_class embedded in RAW_DATALINK message
Parameters: msg – PprzMessage Returns: Number of clients the message sent to, None if msg was invalid
-
subscribe
(callback, regex='(.*)')[source]¶ Subscribe to Ivy message matching regex and call callback with ac_id and PprzMessage TODO: possibility to directly specify PprzMessage instead of regex
Parameters: - callback – function called on new message with ac_id and PprzMessage as params
- regex – regular expression for matching message
-