Added MS/TP automatic baudrate detection option into the core MS/TP state machine. (#900)

This commit is contained in:
Steve Karg
2025-02-03 15:10:31 -06:00
committed by GitHub
parent c5b129e9ab
commit 19ef7f74cd
12 changed files with 471 additions and 11 deletions
+5 -2
View File
@@ -102,6 +102,7 @@ int main(void)
MSTP_Port.ZeroConfigEnabled = true;
MSTP_Port.Zero_Config_Preferred_Station = 0;
MSTP_Port.SlaveNodeEnabled = false;
MSTP_Port.CheckAutoBaud = false;
/* user data */
MSTP_User_Data.RS485_Driver = &RS485_Driver;
MSTP_Port.UserData = &MSTP_User_Data;
@@ -113,8 +114,10 @@ int main(void)
/* FIXME: get the address from hardware DIP or from EEPROM */
dlmstp_set_mac_address(1);
}
/* FIXME: get the baud rate from hardware DIP or from EEPROM */
dlmstp_set_baud_rate(DLMSTP_BAUD_RATE_DEFAULT);
if (!MSTP_Port.CheckAutoBaud) {
/* FIXME: get the baud rate from hardware DIP or from EEPROM */
dlmstp_set_baud_rate(DLMSTP_BAUD_RATE_DEFAULT);
}
/* initialize application layer*/
bacnet_init();
for (;;) {