Send_TimeSyncUTC() does not calculate the right length for datalink_send_pdu().
pdu_len is not added properly resulting in a malformed packet to be sent.
Was introduced with the fix of the following bug:
https://sourceforge.net/p/bacnet/bugs/5/
But, not fixed in:
https://sourceforge.net/p/bacnet/bugs/28/
s_ts.c line 115
...
** pdu_len =
npdu_encode_pdu(&Handler_Transmit_Buffer[0], &dest, &my_address,
&npdu_data);
/ encode the APDU portion of the packet /
** pdu_len =
timesync_utc_encode_apdu(&Handler_Transmit_Buffer[pdu_len], bdate, btime);
bytes_sent =
datalink_send_pdu(&dest, &npdu_data, &Handler_Transmit_Buffer[0],
pdu_len);
...
Thank you
Anonymous
See Send_TimeSync_Remote(), it calculates properly the pdu_length with len.
Also, to have a fonction Send_TimeSyncUTC_Remote() could be interesting, like we have Send_TimeSync_Remote().
Diff:
Thank you for reporting the bug.
Committed fix as r2969, and also fixed in branch releases.