Skip to content

Commit 13ea8e5

Browse files
tridgeclaude
andcommitted
mavlink: use the 'all' dialect everywhere instead of ardupilotmega
binlog.cpp included the ardupilotmega dialect header while the rest of the proxy (mavlink_msgs.h) already used the 'all' dialect. Switch binlog.cpp and the pytest harness over to 'all' so a single dialect is used throughout: the include in binlog.cpp, the MAVLINK_DIALECT env var in the test modules, and the pymavlink dialect imports in test_binlog_capture.py. MAV_AUTOPILOT_ARDUPILOTMEGA references are left as-is: that's an autopilot-type enum constant present in the 'all' dialect, not a dialect selection. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 66ae1d2 commit 13ea8e5

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

binlog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "mavlink.h"
77
#include "util.h"
88

9-
#include "libraries/mavlink2/generated/ardupilotmega/mavlink.h"
9+
#include "libraries/mavlink2/generated/all/mavlink.h"
1010

1111
#include <algorithm>
1212
#include <dirent.h>

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
TEST_PORT_USER_BIDI, TEST_PORT_ENGINEER_BIDI,
2424
KEYDB_PY, SUPPORTPROXY_BIN)
2525

26-
os.environ['MAVLINK_DIALECT'] = 'ardupilotmega'
26+
os.environ['MAVLINK_DIALECT'] = 'all'
2727
os.environ['MAVLINK20'] = '1' # Ensure MAVLink2 is used
2828

2929

tests/test_binlog_capture.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
We launch the real supportproxy binary against a fresh keys.tdb that
44
has KEY_FLAG_BINLOG (and optionally KEY_FLAG_TLOG) set on a test
55
entry, drive synthetic REMOTE_LOG_DATA_BLOCK packets through the
6-
user-side UDP port via pymavlink (using the ardupilotmega dialect),
6+
user-side UDP port via pymavlink (using the all dialect),
77
and assert:
88
99
* a sessionN.bin file appears at the expected sparse-file path,
@@ -47,7 +47,7 @@
4747
PORT_USER_PAIR = 17900 + _W * 4
4848
PORT_ENG_PAIR = 17901 + _W * 4
4949

50-
os.environ.setdefault('MAVLINK_DIALECT', 'ardupilotmega')
50+
os.environ.setdefault('MAVLINK_DIALECT', 'all')
5151
os.environ.setdefault('MAVLINK20', '1')
5252

5353

@@ -130,7 +130,7 @@ def _wait_for(predicate, timeout=5.0):
130130
def _send_data_block(sock, dest, seqno, payload, sysid=1):
131131
"""Build + send a REMOTE_LOG_DATA_BLOCK from a fake vehicle.
132132
payload is padded/truncated to 200 bytes."""
133-
from pymavlink.dialects.v20 import ardupilotmega as mav
133+
from pymavlink.dialects.v20 import all as mav
134134
mav_obj = mav.MAVLink(file=None, srcSystem=sysid, srcComponent=1)
135135
data = (payload + b'\x00' * 200)[:200]
136136
msg = mav.MAVLink_remote_log_data_block_message(
@@ -145,7 +145,7 @@ def _send_system_time(sock, dest, time_boot_ms, sysid=1,
145145
"""Send a SYSTEM_TIME from a fake autopilot. Default compid is
146146
MAV_COMP_ID_AUTOPILOT1 (= 1) — change it to simulate a camera or
147147
companion computer for filter tests."""
148-
from pymavlink.dialects.v20 import ardupilotmega as mav
148+
from pymavlink.dialects.v20 import all as mav
149149
if compid is None:
150150
compid = mav.MAV_COMP_ID_AUTOPILOT1
151151
mav_obj = mav.MAVLink(file=None, srcSystem=sysid, srcComponent=compid)
@@ -158,7 +158,7 @@ def _send_system_time(sock, dest, time_boot_ms, sysid=1,
158158
def _recv_block_statuses(sock, timeout=2.0):
159159
"""Drain incoming UDP packets, decode REMOTE_LOG_BLOCK_STATUS,
160160
return list of (seqno, status) seen within `timeout`."""
161-
from pymavlink.dialects.v20 import ardupilotmega as mav
161+
from pymavlink.dialects.v20 import all as mav
162162
mav_obj = mav.MAVLink(file=None)
163163
sock.settimeout(0.1)
164164
out = []
@@ -328,7 +328,7 @@ def test_proxy_sends_remote_log_start_when_idle(self, proxy_workdir):
328328
# has a chance to fire. A single quiet HEARTBEAT would
329329
# only trigger one tick before main_loop's idle-timeout
330330
# kicks in.
331-
from pymavlink.dialects.v20 import ardupilotmega as mav
331+
from pymavlink.dialects.v20 import all as mav
332332
hb_mav = mav.MAVLink(file=None, srcSystem=1, srcComponent=1)
333333
hb_msg = mav.MAVLink_heartbeat_message(
334334
type=0, autopilot=0, base_mode=0, custom_mode=0,
@@ -346,7 +346,7 @@ def test_proxy_sends_remote_log_start_when_idle(self, proxy_workdir):
346346
collected.append(data)
347347
except socket.timeout:
348348
pass
349-
from pymavlink.dialects.v20 import ardupilotmega as mav2
349+
from pymavlink.dialects.v20 import all as mav2
350350
decoder = mav2.MAVLink(file=None)
351351
start_seqnos = []
352352
for blob in collected:
@@ -613,7 +613,7 @@ def test_reboot_via_system_time_rotates(self, proxy_workdir):
613613
def test_reboot_ignored_from_camera_compid(self, proxy_workdir):
614614
"""A SYSTEM_TIME backward jump from a non-autopilot component
615615
(e.g. a camera) must NOT trigger rotation."""
616-
from pymavlink.dialects.v20 import ardupilotmega as mav
616+
from pymavlink.dialects.v20 import all as mav
617617
_setup_db(proxy_workdir, PORT_USER, PORT_ENG, 'bintest', 'bp',
618618
'binlog')
619619
proc = _start_proxy(proxy_workdir, PORT_ENG)
@@ -694,7 +694,7 @@ def test_keepalive_start_after_first_block(self, proxy_workdir):
694694
"""After streaming begins, the proxy keeps sending START at
695695
~5 s cadence so a post-reboot vehicle resumes. Pre-fix the
696696
START emit stopped after the first DATA_BLOCK."""
697-
from pymavlink.dialects.v20 import ardupilotmega as mav
697+
from pymavlink.dialects.v20 import all as mav
698698
_setup_db(proxy_workdir, PORT_USER, PORT_ENG, 'bintest', 'bp',
699699
'binlog')
700700
proc = _start_proxy(proxy_workdir, PORT_ENG)

tests/test_connections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
MULTIPLE_CONNECTIONS_TEST_DURATION)
1919

2020
# Set up environment for pymavlink
21-
os.environ['MAVLINK_DIALECT'] = 'ardupilotmega'
21+
os.environ['MAVLINK_DIALECT'] = 'all'
2222
os.environ['MAVLINK20'] = '1' # Ensure MAVLink2 is used
2323

2424

tests/test_kill_drop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
PORT_USER = 17600 + _W * 4
3939
PORT_ENG = 17601 + _W * 4
4040

41-
os.environ.setdefault('MAVLINK_DIALECT', 'ardupilotmega')
41+
os.environ.setdefault('MAVLINK_DIALECT', 'all')
4242
os.environ.setdefault('MAVLINK20', '1')
4343

4444

tests/test_tlog_capture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
PORT_USER = 17500 + _W * 4
3939
PORT_ENG = 17501 + _W * 4
4040

41-
os.environ.setdefault('MAVLINK_DIALECT', 'ardupilotmega')
41+
os.environ.setdefault('MAVLINK_DIALECT', 'all')
4242
os.environ.setdefault('MAVLINK20', '1')
4343

4444

0 commit comments

Comments
 (0)