Fix Bambu LAN printing with legacy network plugin #498

Closed
opened 2026-04-05 16:21:46 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @SoftFever on 3/3/2026

Description

BBLPrinterAgent was always calling modern DLL signatures, causing ABI
mismatches when the legacy network plugin is loaded:

  • send_message/send_message_to_printer called with 5 args (flag param)
    but legacy DLL expects 4 args, causing stack corruption
  • Print functions passed PrintParams (with nozzle_mapping, ams_mapping2,
    nozzles_info fields) but legacy DLL expects PrintParams_Legacy, shifting
    the password field offset and producing "access code is invalid" errors

Add legacy branching to all 7 affected methods in BBLPrinterAgent,
matching the pattern from the original NetworkAgent implementation.
Sync the legacy flag from NetworkAgent::use_legacy_network during
plugin initialization and improve LAN connection failure diagnostics.

Fixes #12514, #12537, #12472, #12563

Screenshots/Recordings/Graphs

Tests

*Originally created by @SoftFever on 3/3/2026* # Description BBLPrinterAgent was always calling modern DLL signatures, causing ABI mismatches when the legacy network plugin is loaded: - send_message/send_message_to_printer called with 5 args (flag param) but legacy DLL expects 4 args, causing stack corruption - Print functions passed PrintParams (with nozzle_mapping, ams_mapping2, nozzles_info fields) but legacy DLL expects PrintParams_Legacy, shifting the password field offset and producing "access code is invalid" errors Add legacy branching to all 7 affected methods in BBLPrinterAgent, matching the pattern from the original NetworkAgent implementation. Sync the legacy flag from NetworkAgent::use_legacy_network during plugin initialization and improve LAN connection failure diagnostics. Fixes #12514, #12537, #12472, #12563 # Screenshots/Recordings/Graphs <!-- > Please attach relevant screenshots to showcase the UI changes. > Please attach images that can help explain the changes. --> ## Tests <!-- > Please describe the tests that you have conducted to verify the changes made in this PR. -->
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#498