diff --git a/src/openlcb/DccAccyConsumer.hxx b/src/openlcb/DccAccyConsumer.hxx index cf5d0809e..5bc716829 100644 --- a/src/openlcb/DccAccyConsumer.hxx +++ b/src/openlcb/DccAccyConsumer.hxx @@ -74,21 +74,31 @@ protected: void handle_identify_global(const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done) OVERRIDE { + AutoNotify an(done); if (event->dst_node && event->dst_node != node_) { - return done->notify(); + return; + } + if (registry_entry.event == + TractionDefs::ACTIVATE_BASIC_DCC_ACCESSORY_EVENT_BASE) + { + event->event_write_helper<1>()->WriteAsync(node_, + Defs::MTI_CONSUMER_IDENTIFIED_RANGE, WriteHelper::global(), + eventid_to_buffer(EncodeRange( + TractionDefs::ACTIVATE_BASIC_DCC_ACCESSORY_EVENT_BASE, + 4095)), + done->new_child()); + } + if (registry_entry.event == + TractionDefs::INACTIVATE_BASIC_DCC_ACCESSORY_EVENT_BASE) + { + event->event_write_helper<2>()->WriteAsync(node_, + Defs::MTI_CONSUMER_IDENTIFIED_RANGE, WriteHelper::global(), + eventid_to_buffer(EncodeRange( + TractionDefs::INACTIVATE_BASIC_DCC_ACCESSORY_EVENT_BASE, + 4095)), + done->new_child()); } - event->event_write_helper<1>()->WriteAsync(node_, - Defs::MTI_CONSUMER_IDENTIFIED_RANGE, WriteHelper::global(), - eventid_to_buffer(EncodeRange( - TractionDefs::ACTIVATE_BASIC_DCC_ACCESSORY_EVENT_BASE, 4095)), - done->new_child()); - event->event_write_helper<2>()->WriteAsync(node_, - Defs::MTI_CONSUMER_IDENTIFIED_RANGE, WriteHelper::global(), - eventid_to_buffer(EncodeRange( - TractionDefs::INACTIVATE_BASIC_DCC_ACCESSORY_EVENT_BASE, 4095)), - done->new_child()); - done->notify(); } void handle_event_report(const EventRegistryEntry ®istry_entry,