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")) { if (characterstring_ansi_same(&rd_data->password, "Jesus")) {
switch (rd_data->state) { switch (rd_data->state) {
case BACNET_REINIT_COLDSTART: case BACNET_REINIT_COLDSTART:
break;
case BACNET_REINIT_WARMSTART: case BACNET_REINIT_WARMSTART:
dcc_set_status_duration(COMMUNICATION_ENABLE, 0);
break; break;
case BACNET_REINIT_STARTBACKUP: case BACNET_REINIT_STARTBACKUP:
break; break;
+10 -1
View File
@@ -396,7 +396,8 @@ void apdu_handler(
/* When network communications are completely disabled, /* When network communications are completely disabled,
only DeviceCommunicationControl and ReinitializeDevice APDUs only DeviceCommunicationControl and ReinitializeDevice APDUs
shall be processed and no messages shall be initiated. */ shall be processed and no messages shall be initiated. */
if (dcc_communication_disabled() && if ((dcc_communication_disabled() ||
dcc_communication_initiation_disabled()) &&
((service_choice != ((service_choice !=
SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL) SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL)
&& (service_choice != && (service_choice !=
@@ -411,11 +412,19 @@ void apdu_handler(
service_request_len, src, &service_data); service_request_len, src, &service_data);
break; break;
case PDU_TYPE_UNCONFIRMED_SERVICE_REQUEST: 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()) if (dcc_communication_disabled())
break; break;
service_choice = apdu[1]; service_choice = apdu[1];
service_request = &apdu[2]; service_request = &apdu[2];
service_request_len = apdu_len - 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 (service_choice < MAX_BACNET_UNCONFIRMED_SERVICE) {
if (Unconfirmed_Function[service_choice]) if (Unconfirmed_Function[service_choice])
Unconfirmed_Function[service_choice] (service_request, Unconfirmed_Function[service_choice] (service_request,