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:
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user