Skip to content

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Sep 25, 2025

allow for tags on either bus

@ARACE-DEV
Copy link

I confirm now the script works on CAN2 as well.

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd merge this if it was an example, but I do want to know what happens in the single-bus case.

local function check_batterytag()
local payload, nodeid = batterytag_handle:check_message()
local function check_batterytag(bus)
local payload, nodeid = batterytag_handles[bus]:check_message()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens here if there is only 1 bus?

batterytag_handle:subscribe()
local batterytag_handles = {
DroneCAN_Handle(0, BATTERYTAG_SIGNATURE, BATTERYTAG_ID),
DroneCAN_Handle(1, BATTERYTAG_SIGNATURE, BATTERYTAG_ID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this holds us until someone uses a three-interface device :-)

@tridge
Copy link
Contributor Author

tridge commented Sep 27, 2025

I'd merge this if it was an example, but I do want to know what happens in the single-bus case.

I tested it on a single bus (both first and 2nd bus) in SITL

@peterbarker
Copy link
Contributor

I'd merge this if it was an example, but I do want to know what happens in the single-bus case.

I tested it on a single bus (both first and 2nd bus) in SITL

OK, that's weird. I was expecting the response to be, "yes, we will git a method-on-nil exception there". shrug.

@peterbarker peterbarker merged commit a3041bd into ArduPilot:master Sep 29, 2025
107 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants