Added MS/TP datalink option to BACnet basic server example. (#1077)

This commit is contained in:
Steve Karg
2025-08-25 11:02:43 -05:00
committed by GitHub
parent a3cd49eb37
commit ad5a43042c
10 changed files with 207 additions and 10 deletions
+25 -2
View File
@@ -1094,6 +1094,24 @@ void dlmstp_silence_reset(void *arg)
}
}
/**
* @brief set the MS/TP datalink interface
* @param ifname - interface name to set
*/
void dlmstp_set_interface(const char *ifname)
{
MSTP_Port = (struct mstp_port_struct_t *)ifname;
}
/**
* @brief get the MS/TP datalink intferface name
* @return interface name
*/
const char *dlmstp_get_interface(void)
{
return (const char *)MSTP_Port;
}
/**
* @brief Initialize this MS/TP datalink
* @param ifname user data structure
@@ -1101,8 +1119,12 @@ void dlmstp_silence_reset(void *arg)
*/
bool dlmstp_init(char *ifname)
{
bool status = false;
struct dlmstp_user_data_t *user;
MSTP_Port = (struct mstp_port_struct_t *)ifname;
if (ifname) {
MSTP_Port = (struct mstp_port_struct_t *)ifname;
}
if (MSTP_Port) {
MSTP_Port->SilenceTimer = dlmstp_silence_milliseconds;
MSTP_Port->SilenceTimerReset = dlmstp_silence_reset;
@@ -1119,7 +1141,8 @@ bool dlmstp_init(char *ifname)
MSTP_Init(MSTP_Port);
user->Initialized = true;
}
status = true;
}
return true;
return status;
}
+4
View File
@@ -120,6 +120,10 @@ extern "C" {
BACNET_STACK_EXPORT
bool dlmstp_init(char *ifname);
BACNET_STACK_EXPORT
void dlmstp_set_interface(const char *ifname);
BACNET_STACK_EXPORT
const char *dlmstp_get_interface(void);
BACNET_STACK_EXPORT
void dlmstp_reset(void);
BACNET_STACK_EXPORT
void dlmstp_cleanup(void);