Skip to content

Conversation

@MauroPfister
Copy link

Add option to set a dialect directly from a file anywhere on the system. The dialect file has to be generated beforehand from message definitions using mavgen.

This is useful in situations where different versions of the same dialect might be needed to talk to different devices (see #864).

Example:

from pymavlink import mavutil
import os

os.environ['MAVLINK20'] = "1"

mavutil.set_dialect_from_file("/home/user/my_dialects/v20/my_special_dialect.py")

I'm not sure if this is something that pymavlink intends to support or if there are better solutions to this problem. Happy to be educated.

@khancyr
Copy link
Contributor

khancyr commented Mar 28, 2024

probably using venv for each dialect type could work.

@MauroPfister
Copy link
Author

That only works if you don't need to switch dialect at runtime. Imagine a test application that can connect (at runtime) to various devices that might not use the same dialect. In this case using different vens won't be an option.

@MauroPfister MauroPfister force-pushed the set_dialect_from_file branch from 098105a to c26fcef Compare May 30, 2024 14:02
@MauroPfister
Copy link
Author

Any chance to get a review on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants