0
0
Fork 0
Codesys-MCP-SP21-plus/src
Karstein Phobic Nyvold Kvistad b3bf4a83d5 fix(download_to_device): port login() probe + loginWaitSeconds from connect
Same SP21+/SP22 login() drift as connect_to_device:
  - 'TryOnlineChange' is gone from OnlineChangeOption
  - login() now requires (OnlineChangeOption, bool) -- two positional
The fork hard-coded the old call shape; observed today on SP22 Patch 1
with the runtime up and the project compiled, every download_to_device
attempt failed with "login() takes exactly 2 arguments (0 given)".

Fix mirrors e862846 / eee8ce2:
  - Probe OnlineChangeOption members at runtime (priority order tuned
    for download: WithDownload / ForceDownload come first, since
    'download' implies a write).
  - Try (enum, False) / (enum, True) / (enum,) / bool / no-arg shapes.
  - Add LOGIN_WAIT_SECONDS post-login state-stabilisation poll for the
    credential dialog (default 60s, configurable 0-600).
  - Tool-side IPC timeout = waitSec + 120s headroom for the actual
    download work (download is heavier than connect, hence 120 vs 30).

The download itself is still done via the existing fall-through:
online_app.download() if exposed, else create_boot_application().
On SP22 the dir() shows source_download + create_boot_application (no
'download'), so the create_boot_application path is what runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 18:40:26 +02:00
..
scripts fix(download_to_device): port login() probe + loginWaitSeconds from connect 2026-04-25 18:40:26 +02:00
bin.ts Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
headless.ts Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
ipc.ts Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
launcher.ts Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
logger.ts Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
script-manager.ts Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
server.ts fix(download_to_device): port login() probe + loginWaitSeconds from connect 2026-04-25 18:40:26 +02:00
types.ts Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00