diff --git a/src/avclan/cdchanger.cc b/src/avclan/cdchanger.cc index 76c47f5..d313f46 100644 --- a/src/avclan/cdchanger.cc +++ b/src/avclan/cdchanger.cc @@ -339,6 +339,7 @@ bool CDChanger::pending() { return cdtimer_pending(); } void CDChanger::resolvepending() { cdtimer_clear(); } void CDChanger::emit(Frame *out, uint16_t peripheral) { + out->owning_device = id; // so react() routes r_StateReport back here out->peripheral_addr = peripheral; generateStatus(out, false, Device::STATUS); out->reaction = r_StateReport; diff --git a/src/avclan/peripheral.hpp b/src/avclan/peripheral.hpp index c52aaf7..5d31abd 100644 --- a/src/avclan/peripheral.hpp +++ b/src/avclan/peripheral.hpp @@ -103,8 +103,11 @@ public: case PACK3(COMMUNICATION_V2, COMM_CTRL, to_underlying(Advertise_Function)): ((Devs::id == static_cast(b3) - ? std::get(devices_).enable(out), - 0 : 0), + ? [&] { + out->owning_device = Devs::id; + std::get(devices_).enable(out); + }() + : void()), ...); break; case PACK3(COMMUNICATION_V1, COMM_CTRL, to_underlying(Ping_Req)):