Pass bind_detect's Result to Python by Reference

pybind11 copies a reference argument to an override, so a Python
printer agent that filled in detect wrote to a throwaway object and the
host always saw an empty detectResult. Pass it as a pointer so Python
edits the caller's struct.
This commit is contained in:
Hanif Koh
2026-09-22 14:55:18 +08:00
parent fd9c1218a4
commit 57b3a040e2
2 changed files with 10 additions and 3 deletions
@@ -69,7 +69,8 @@ public:
int bind_detect(std::string dev_ip, std::string sec_link, detectResult& detect) override
{
ORCA_PY_AGENT_OVERRIDE(int, bind_detect, dev_ip, sec_link, detect);
// Passed as a pointer: pybind11 copies a reference argument, so the plugin's writes would be lost.
ORCA_PY_AGENT_OVERRIDE(int, bind_detect, dev_ip, sec_link, &detect);
}
std::string get_user_selected_machine() override