Skip to content

Commit

Permalink
adding more values to cuas Element
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed Jan 3, 2025
1 parent e08fbe1 commit f0b99cb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions djicot/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ def dji_to_cot_xml( # NOQA pylint: disable=too-many-locals,too-many-branches,to

cuas = ET.Element("__cuas")
cuas.set("cot_host_id", cot_host_id)
cuas.set("uas_type", uas_type)
cuas.set("uas_type_8", parsed_data.get("device_type_8"))
cuas.set("uas_sn", uas_sn)
cuas.set("freq", parsed_data.get("freq", 0.0))
cuas.set("rssi", parsed_data.get("rssi", 0))
cuas.set("speed_e", parsed_data.get("speed_e", 0.0))
cuas.set("speed_n", parsed_data.get("speed_n", 0.0))
cuas.set("speed_u", parsed_data.get("speed_u", 0.0))

cot_uid = f"DJI.{uas_sn}.uas"
callsign = f"DJI-{uas_sn}"
Expand All @@ -170,8 +178,8 @@ def dji_to_cot_xml( # NOQA pylint: disable=too-many-locals,too-many-branches,to
remarks_fields.append(f"Serial Number: {uas_sn}")
remarks_fields.append(f"Type: {uas_type}")
remarks_fields.append(f"Freq: {parsed_data.get('freq', 0.0)}")
remarks_fields.append(f"RSSI: {parsed_data.get('RSSI', 0)}")
remarks_fields.append(f"Speed: {parsed_data.get('speed_E', 0.0)}")
remarks_fields.append(f"RSSI: {parsed_data.get('rssi', 0)}")
remarks_fields.append(f"Speed: {parsed_data.get('speed_e', 0.0)}")
remarks_fields.append(f"{cot_host_id}")
_remarks = " ".join(list(filter(None, remarks_fields)))
remarks.text = _remarks
Expand Down

0 comments on commit f0b99cb

Please sign in to comment.