4 Generate a message using different MAVLink versions, put in a buffer and then read from it. 7 from __future__
import print_function
8 from builtins
import object
20 return self.buf.pop(0)
26 print(
"Creating MAVLink message...")
28 mav = mavlink.MAVLink(f)
31 mav.signing.secret_key = chr(42)*32
32 mav.signing.link_id = 0
33 mav.signing.timestamp = 0
34 mav.signing.sign_outgoing =
True 37 mav.param_set_send(7, 1,
"WP_RADIUS", 101, mavlink.MAV_PARAM_TYPE_REAL32)
41 m = mav.param_set_encode(7, 1,
"WP_RADIUS", 101, mavlink.MAV_PARAM_TYPE_REAL32)
51 print(
"Buffer containing the encoded message:")
54 print(
"Decoding message...")
59 print(
"Got a message with id %u and fields %s" % (m2.get_msgId(), m2.get_fieldnames()))
65 print(
"Testing mavlink1\n")
68 print(
"\nTesting mavlink2\n")
71 print(
"\nTesting mavlink2 with signing\n")
def test_protocol(mavlink, signing=False)