Corrected DeviceCommunicationControl (DCC) for DISABLE_INITIATION state, which now allows I-Am in response to Who-Is. Did not add keep out for other initiated services like COV (to do).

This commit is contained in:
skarg
2010-12-18 17:30:58 +00:00
parent 5293f63da0
commit 350736f6bb
2 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -193,8 +193,8 @@ bool Device_Reinitialize(
if (characterstring_ansi_same(&rd_data->password, "Jesus")) {
switch (rd_data->state) {
case BACNET_REINIT_COLDSTART:
break;
case BACNET_REINIT_WARMSTART:
dcc_set_status_duration(COMMUNICATION_ENABLE, 0);
break;
case BACNET_REINIT_STARTBACKUP:
break;
+11 -2
View File
@@ -361,7 +361,7 @@ void apdu_retries_set(
* to manage the received request.
* Almost all requests and ACKs invoke this function.
* @ingroup MISCHNDLR
*
*
* @param src [in] The BACNET_ADDRESS of the message's source.
* @param apdu [in] The apdu portion of the request, to be processed.
* @param apdu_len [in] The total (remaining) length of the apdu.
@@ -396,7 +396,8 @@ void apdu_handler(
/* When network communications are completely disabled,
only DeviceCommunicationControl and ReinitializeDevice APDUs
shall be processed and no messages shall be initiated. */
if (dcc_communication_disabled() &&
if ((dcc_communication_disabled() ||
dcc_communication_initiation_disabled()) &&
((service_choice !=
SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL)
&& (service_choice !=
@@ -411,11 +412,19 @@ void apdu_handler(
service_request_len, src, &service_data);
break;
case PDU_TYPE_UNCONFIRMED_SERVICE_REQUEST:
/* When network communications are completely disabled,
only DeviceCommunicationControl and ReinitializeDevice APDUs
shall be processed and no messages shall be initiated. */
if (dcc_communication_disabled())
break;
service_choice = apdu[1];
service_request = &apdu[2];
service_request_len = apdu_len - 2;
/* When network communications have initiation disabled,
WhoIs will be processed and I-Am initiated as response. */
if (dcc_communication_initiation_disabled() &&
(service_choice != SERVICE_UNCONFIRMED_WHO_IS))
break;
if (service_choice < MAX_BACNET_UNCONFIRMED_SERVICE) {
if (Unconfirmed_Function[service_choice])
Unconfirmed_Function[service_choice] (service_request,