From cd2c001d66b22f881705834e5b8e9ebbf1e42c43 Mon Sep 17 00:00:00 2001 From: skarg Date: Tue, 29 Sep 2009 13:21:19 +0000 Subject: [PATCH] Corrected BLVC for BDT Ack. --- bacnet-stack/src/bvlc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bacnet-stack/src/bvlc.c b/bacnet-stack/src/bvlc.c index 70f2293a..652a8524 100644 --- a/bacnet-stack/src/bvlc.c +++ b/bacnet-stack/src/bvlc.c @@ -132,7 +132,7 @@ static int bvlc_encode_bip_address( if (pdu) { encode_unsigned32(&pdu[0], address->s_addr); - encode_unsigned16(&pdu[len], port); + encode_unsigned16(&pdu[4], port); len = 6; } @@ -583,6 +583,10 @@ static bool bvlc_register_foreign_device( (FD_Table[i].dest_port == ntohs(sin->sin_port))) { status = true; FD_Table[i].time_to_live = time_to_live; + /* Upon receipt of a BVLL Register-Foreign-Device message, + a BBMD shall start a timer with a value equal to the + Time-to-Live parameter supplied plus a fixed grace + period of 30 seconds. */ FD_Table[i].seconds_remaining = time_to_live + 30; break; }