Add network port callbacks for pending changes activate and discard. (#836)

This commit is contained in:
Steve Karg
2024-10-29 14:28:21 -05:00
committed by GitHub
parent 089caf7e4b
commit 1444715c5a
4 changed files with 200 additions and 2 deletions
+16
View File
@@ -666,6 +666,7 @@ bool Device_Reinitialize(BACNET_REINITIALIZE_DEVICE_DATA *rd_data)
{
bool status = false;
bool password_success = false;
unsigned i;
/* From 16.4.1.1.2 Password
This optional parameter shall be a CharacterString of up to
@@ -690,8 +691,19 @@ bool Device_Reinitialize(BACNET_REINITIALIZE_DEVICE_DATA *rd_data)
if (password_success) {
switch (rd_data->state) {
case BACNET_REINIT_COLDSTART:
dcc_set_status_duration(COMMUNICATION_ENABLE, 0);
/* note: you probably want to restart *after* the
simple ack has been sent from the return handler
so just set a flag from here */
Reinitialize_State = rd_data->state;
status = true;
break;
case BACNET_REINIT_WARMSTART:
dcc_set_status_duration(COMMUNICATION_ENABLE, 0);
for (i = 0; i < Network_Port_Count(); i++) {
Network_Port_Changes_Pending_Activate(
Network_Port_Index_To_Instance(i));
}
/* note: you probably want to restart *after* the
simple ack has been sent from the return handler
so just set a flag from here */
@@ -714,6 +726,10 @@ bool Device_Reinitialize(BACNET_REINITIALIZE_DEVICE_DATA *rd_data)
break;
case BACNET_REINIT_ACTIVATE_CHANGES:
/* note: activate changes *after* the simple ack is sent */
for (i = 0; i < Network_Port_Count(); i++) {
Network_Port_Changes_Pending_Activate(
Network_Port_Index_To_Instance(i));
}
Reinitialize_State = rd_data->state;
status = true;
break;