mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-03 21:33:39 +08:00
Fix datalink sending for udp_link.py
This commit is contained in:
@@ -89,8 +89,12 @@ class IvyUdpLink():
|
|||||||
for msg_type in msg_fields:
|
for msg_type in msg_fields:
|
||||||
struct_string += self.data_types[msg_type][0]
|
struct_string += self.data_types[msg_type][0]
|
||||||
length += self.data_types[msg_type][1]
|
length += self.data_types[msg_type][1]
|
||||||
typed_args.append(args[idx])
|
if (msg_type == "float"):
|
||||||
msg = struct.pack(struct_string, stx, length, sender, msg_id, *args)
|
typed_args.append(float(args[idx]))
|
||||||
|
else:
|
||||||
|
typed_args.append(int(args[idx]))
|
||||||
|
idx += 1
|
||||||
|
msg = struct.pack(struct_string, stx, length, sender, msg_id, *typed_args)
|
||||||
(ck_a, ck_b) = self.calculate_checksum(msg)
|
(ck_a, ck_b) = self.calculate_checksum(msg)
|
||||||
msg = msg + struct.pack('=BB', ck_a, ck_b)
|
msg = msg + struct.pack('=BB', ck_a, ck_b)
|
||||||
return msg
|
return msg
|
||||||
|
|||||||
Reference in New Issue
Block a user