route can frames through session

This commit is contained in:
2026-05-23 08:56:59 +08:00
parent fe841fb0ba
commit 71345419d5

View File

@@ -23,15 +23,7 @@ import DNAServerModal from './DNAServerModal';
window.mavlinkSession = new MavlinkSession();
window.localNode = new dronecan.Node({name: "com.vimdrones.web_gui"});
localNode.on('sendFrame', (messageId, data, len) => {
const msg = new mavlink20.messages.can_frame(
mavlinkSession.targetSystem, // target_system
mavlinkSession.targetComponent, // target_component
localNode.bus,
len,
messageId,
data.toString('binary')
);
mavlinkSession.sendMavlinkMsg(msg);
mavlinkSession.sendCanFrame(localNode.bus, messageId, data, len);
});