add bip_get_interface and Device_Time_Of_Restart, fix Network_Port_Changes_Discard (#1038)

* added bip_get_interface

* basic/object/device get/set time of restart

* clear changes pending

* clang-format
This commit is contained in:
Ryan Mulder
2025-07-05 22:55:29 -04:00
committed by GitHub
parent 51b899fc36
commit 3b410f7a07
5 changed files with 34 additions and 5 deletions
+17
View File
@@ -1060,6 +1060,23 @@ bool Device_Serial_Number_Set(const char *str, size_t length)
return status;
}
void Device_Time_Of_Restart(BACNET_TIMESTAMP *time_of_restart)
{
bacapp_timestamp_copy(time_of_restart, &Time_Of_Device_Restart);
}
bool Device_Set_Time_Of_Restart(const BACNET_TIMESTAMP *time_of_restart)
{
bool status = false;
if (time_of_restart) {
bacapp_timestamp_copy(&Time_Of_Device_Restart, time_of_restart);
status = true;
}
return status;
}
uint8_t Device_Protocol_Version(void)
{
return BACNET_PROTOCOL_VERSION;
+3 -1
View File
@@ -1211,6 +1211,7 @@ void Network_Port_Changes_Pending_Discard(uint32_t object_instance)
if (index < BACNET_NETWORK_PORTS_MAX) {
if (Object_List[index].Discard_Changes) {
Object_List[index].Discard_Changes(object_instance);
Object_List[index].Changes_Pending = false;
}
}
}
@@ -4662,7 +4663,8 @@ void Network_Port_Changes_Discard(void)
for (i = 0; i < BACNET_NETWORK_PORTS_MAX; i++) {
if (Object_List[i].Changes_Pending) {
Network_Port_Changes_Pending_Discard(i);
Network_Port_Changes_Pending_Discard(
Object_List[i].Instance_Number);
Object_List[i].Changes_Pending = false;
}
}
+3
View File
@@ -35,6 +35,9 @@ bool bip_init(char *ifname);
BACNET_STACK_EXPORT
void bip_set_interface(const char *ifname);
BACNET_STACK_EXPORT
const char *bip_get_interface(void);
BACNET_STACK_EXPORT
void bip_cleanup(void);