1
0
mirror of https://github.com/stargieg/bacnet-stack synced 2025-10-26 23:35:52 +08:00
bacnet-stack/ports
Steve Karg 17058b23b3 [r3137] Adds two new functions to the ring buffer implementation, one to walk the ring by getting a pointer to the next element in the ring, and the other to Pop (remove) a specified element from somewhere in the ring and then move any elements up towards the head to fill the gap left. With these new functions in place, the Linux MS/TP datalink MSTP_Get_Reply() has been updated to walk the ring buffer to try to find the matching reply. If it is found then it is processed in the same way as usual, and then removed from the ring.
When a packet is received which expects a reply a copy is stored in the PDU ring buffer so it can be matched with the reply. Unfortunately when the reply is received it is only checked against the first entry in the ring buffer. This can cause a failure if a second packet expecting a reply has been received while waiting for the first reply to arrive.
This is a known issue in the bacnet-stack open source stack, and there is a outstanding FIXME in the latest version of the source code:

        /* The ANSWER_DATA_REQUEST state is entered when a  */
        /* BACnet Data Expecting Reply, a Test_Request, or  */
        /* a proprietary frame that expects a reply is received. */
        /* FIXME: MSTP_Get_Reply waits for a matching reply, but
           if the next queued message doesn't match, then we
           sit here for Treply_delay doing nothing */

The fix for this is to check all the messages in the PDU queue to see if any of them match, and if one does then handle it in the normal way. Thank you to Ian Smith of Abelon Systems Ltd. for the patch!
2018-03-25 15:59:10 +02:00
..
arduino_uno [r3058] Changed Device_Object_List_Identifier() to use uint32_t for array_index since that is the size decoded in a ReadProperty request, and unsigned is not always 32-bit. \n Author: skarg@r3058 2016-11-01 03:32:21 +01:00
arm7 fork from http://sourceforge.net/projects/bacnet/ 2013-03-21 22:53:31 +01:00
at91sam7s [r3058] Changed Device_Object_List_Identifier() to use uint32_t for array_index since that is the size decoded in a ReadProperty request, and unsigned is not always 32-bit. \n Author: skarg@r3058 2016-11-01 03:32:21 +01:00
atmega8 [r3109] Updated Atmega8 project to compile under IAR EWARM 6.40.3 2017-04-05 00:17:57 +02:00
atmega168 [r3059] Fixed ports for Atmega8, Atmega168, and Xmega to compile. 2016-11-01 19:22:01 +01:00
bdk-atxx4-mstp [r3133] Fixed MS/TP ANSWER_DATA_REQUEST state in some of the ports to be compliant to the standard by emitting Reply-Postponed rather than nothing when the data request times out. 2018-03-25 15:57:20 +02:00
bsd add default if en0 2017-04-08 22:36:54 +02:00
dos fork from http://sourceforge.net/projects/bacnet/ 2013-03-21 22:53:31 +01:00
linux [r3137] Adds two new functions to the ring buffer implementation, one to walk the ring by getting a pointer to the next element in the ring, and the other to Pop (remove) a specified element from somewhere in the ring and then move any elements up towards the head to fill the gap left. With these new functions in place, the Linux MS/TP datalink MSTP_Get_Reply() has been updated to walk the ring buffer to try to find the matching reply. If it is found then it is processed in the same way as usual, and then removed from the ring. 2018-03-25 15:59:10 +02:00
lwip [r3098] Fixed [bug#40] - problems if pdu_len exceeds the size of a single pbuf block. Thank you, Jörg Hofmann! 2017-04-05 00:03:12 +02:00
pic18f97j60 [r3058] Changed Device_Object_List_Identifier() to use uint32_t for array_index since that is the size decoded in a ReadProperty request, and unsigned is not always 32-bit. \n Author: skarg@r3058 2016-11-01 03:32:21 +01:00
pic18f6720 [r3071] Adjusted device object local variables in PIC demo to build successfully within given stack frame. 2017-04-04 19:46:43 +02:00
rtos32 update to r3056 from https://sourceforge.net/p/bacnet/code/3056/tree/trunk/bacnet-stack/ add ipv6 and schedule support 2016-10-30 16:16:03 +01:00
rx62n [r3058] Changed Device_Object_List_Identifier() to use uint32_t for array_index since that is the size decoded in a ReadProperty request, and unsigned is not always 32-bit. \n Author: skarg@r3058 2016-11-01 03:32:21 +01:00
stm32f10x [r3075] Removed extra RS485 init from main in STM32 port example. Thank you, Sean Monroe! 2017-04-04 19:46:43 +02:00
win32 [r3103] Merged revision(s) 3102 from branches/releases/bacnet-stack-0-8-0: 2017-04-05 00:04:43 +02:00
xplained [r3133] Fixed MS/TP ANSWER_DATA_REQUEST state in some of the ports to be compliant to the standard by emitting Reply-Postponed rather than nothing when the data request times out. 2018-03-25 15:57:20 +02:00