From 694d56ba1f3bb3aaf504dac69ac90ecee6d7b9d6 Mon Sep 17 00:00:00 2001 From: skarg Date: Fri, 28 Jan 2011 03:04:09 +0000 Subject: [PATCH] Fixed APDU handler again after discussion on BACNet-L showed the errors of my ways regarding the DeviceCommunicationControl limiting processing of APDUs. --- bacnet-stack/src/apdu.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bacnet-stack/src/apdu.c b/bacnet-stack/src/apdu.c index 3571b6be..f8901a45 100644 --- a/bacnet-stack/src/apdu.c +++ b/bacnet-stack/src/apdu.c @@ -360,14 +360,16 @@ void apdu_retries_set( /* When network communications are completely disabled, only DeviceCommunicationControl and ReinitializeDevice APDUs - shall be processed and no messages shall be initiated. */ + shall be processed and no messages shall be initiated. + When the initiation of communications is disabled, + all APDUs shall be processed and responses returned as + required... */ static bool apdu_confirmed_dcc_disabled( uint8_t service_choice) { bool status = false; - if (dcc_communication_disabled() || - dcc_communication_initiation_disabled()) { + if (dcc_communication_disabled()) { switch (service_choice) { case SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL: case SERVICE_CONFIRMED_REINITIALIZE_DEVICE: @@ -394,6 +396,8 @@ static bool apdu_unconfirmed_dcc_disabled( bool status = false; if (dcc_communication_disabled()) { + /* there are no Unconfirmed messages that + can be processed in this state */ status = true; } else if (dcc_communication_initiation_disabled()) { /* WhoIs will be processed and I-Am initiated as response. */