1
0
mirror of https://github.com/stargieg/bacnet-stack synced 2025-10-19 23:25:23 +08:00
Commit Graph

196 Commits

Author SHA1 Message Date
Patrick Grimm
56034b7b11 fix Intrinsic_Reporting
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2019-04-14 14:13:35 +02:00
Patrick Grimm
1cc67a27ae use uci save path /var/state
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2019-04-10 14:51:22 +02:00
Patrick Grimm
187d5feb9e
Merge pull request #10 from raghavan97/bug-turnaround-computation
Fix computation of turnaround time
2018-09-12 14:28:46 +02:00
raghavan
f87ea02b04 Fix computation of turnaround time
The turnaround time is defined as 40 bit times (Tturnaround)
turnaround time in secs = Tturnaround / baud
turnaround time in microsec = (Tturnaround * 1000000)/baud
usleep takes microsec as a parameter
2018-08-25 11:32:24 +05:30
Patrick Grimm
309f03d22f fix cov handling Changed 2018-04-12 17:20:58 +02:00
Patrick Grimm
ba42aacd77 router: add option --interface 2018-03-31 02:34:35 +02:00
Patrick Grimm
2266310108 fix more cmpile err with musl 2018-03-29 22:15:29 +02:00
Patrick Grimm
1a26c373c6 fix cmpile err with musl 2018-03-29 19:36:43 +02:00
Patrick Grimm
d54c114c5e BUG ON OPTIMIZATION -Os is failing with bufferoverflow or race 2018-03-29 14:13:04 +02:00
Patrick Grimm
69b179e2eb router: remove libconfig 2018-03-29 01:56:47 +02:00
Patrick Grimm
bcb5cb44d3 fix COV 2018-03-26 19:22:36 +02:00
Patrick Grimm
fe5c287921 fix COV Handling. rename Change_Of_Value to Changed 2018-03-26 01:52:23 +02:00
Steve Karg
34c82d38f5 [r3167] Updated MS/TP FSM to not reply to Broadcast PFM. Thank you, Iqbal Hassan! 2018-03-25 16:53:02 +02:00
Steve Karg
201d7fa1c4 [r3166] Fixed Windows compile under MinGW. 2018-03-25 16:52:30 +02:00
Steve Karg
7ec01f55ac [r3165] Added arm-none-eabi GCC Makefile for ports/stm32f10x example 2018-03-25 16:51:40 +02:00
Steve Karg
fcded70c49 [r3164] esp32 support 2018-03-25 16:50:53 +02:00
Steve Karg
1172adba2c [r3163] Fixed comment. 2018-03-25 16:50:16 +02:00
Steve Karg
2faa1123e7 [r3162] Added WritePropertyMultiple demo application. 2018-03-25 16:48:16 +02:00
Steve Karg
2cc4670f09 [r3157] Merged revision(s) 3154 from branches/releases/bacnet-stack-0-8-0:
Fixed WriteProperty demo command line options when using more than one property value and a context tag.  Thank you James Gordon for reporting the problem.
........
2018-03-25 16:23:57 +02:00
Steve Karg
91abf20d1b [r3155] Add a Device object and application layer to router demo. 2018-03-25 16:15:13 +02:00
Steve Karg
9341650104 [r3152] Added some readme info about Wireshark, extcap, and DLTs. 2018-03-25 16:14:06 +02:00
Steve Karg
d5afb15e9b [r3151] Clean up compile for Atmel port example. 2018-03-25 16:13:30 +02:00
Steve Karg
e99cf2d714 [r3150] address_cache file was inadvertently disabled for command line demo tools. Fixed. Thank you, Martin Tremblay! Syncing with 0.8.x branch. 2018-03-25 16:12:59 +02:00
Steve Karg
de1c4b5baa [r3148] Added property enumerations from BACnet 2016 standard. Thank you, Mario Sousa! 2018-03-25 16:12:09 +02:00
Steve Karg
6fe2e16ad3 [r3147] added engineering units from 135-2012ag and 135-2012ar 2018-03-25 16:11:25 +02:00
Steve Karg
8e75ca0425 [r3143] Added some arduino_uno files that we missed during first import [WIP]. 2018-03-25 16:10:59 +02:00
Steve Karg
0f0fb2664d [r3138] Merged revision(s) 3136 from branches/releases/bacnet-stack-0-8-0:
Replace Receive_Packet_Flag conditional variable with a semaphore and update the related library functions accordingly.
Analysis of the problem determined that the issue lay in the transfer of APDU packets between the FSM and the APDU packet handler thread.
The mechanism previously used by the FSM to notify the APDU packet handler thread that a packet was available for processing used a pthread conditional variable which packet handler thread was supposed to wait on before being signalled by the FSM.
However the packet handler thread has other tasks to perform and sometimes was not waiting on the conditional variable which it was signalled.
Unlike other synchronisation mechanisms such as semaphores, if the waiting task (the consumer) is not blocked on the conditional variable when the producer signals, then that signal is lost and the consumer is never signalled again, leading to a continual sequence of timeouts on the conditional variable.
This in turn led to the packet handler thread never being notified of a packet waiting to be processed thus causing the interface hang.
The main problem is that a conditional variable is supposed to be used with a mutex to prevent this behaviour occurring, but this mutex was not present (and in fact had been removed from the code, most likely because it was causing other synchronisation issues)
Further inspection revealed that this code was copied from another file but modified to remove the mutex which is an essential part of using a conditional variable for synchronisation. This then prevents the producer task being blocked until the consumer task is waiting on the conditional variable, thus leading to a race condition which is causing the issues seen.
The fix is to replace the conditional variable with a semaphore as this provides the required mechanism in this case.
Thank you Ian Smith at Abelon Systems Ltd. for the patch!

........
2018-03-25 16:09:35 +02:00
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
Steve Karg
92d9ec7340 [r3135] Fixed Initialize-Routing-Table demo handling of ACK. 2018-03-25 15:58:10 +02:00
Steve Karg
d33bec7472 [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
Steve Karg
28a17e0b34 [r3130] Fixed VMAC for routed address match on compare. Thank you, Arne Nickel! 2018-03-25 15:56:00 +02:00
Patrick Grimm
d4767d3e61 add default if en0 2017-04-08 22:36:54 +02:00
Patrick Grimm
af359c7d88 copy ports/linux/bip6.c ports/bsd/bip6.c 2017-04-08 22:20:21 +02:00
Patrick Grimm
d0a963e7ee remove PRINT_ENABLED DEBUG_ENABLED -Wmacro-redefined 2017-04-08 22:17:10 +02:00
Patrick Grimm
388a9d45b2 uevent need bitstring_init_ascii() without PRINT_ENABLED 2017-04-08 22:10:18 +02:00
Patrick Grimm
bdb0404c0d make static TL_fetch_property 93aac61ff7 2017-04-06 23:38:23 +02:00
Patrick Grimm
93af3b2247 rename NOTIFICATION_CLASS_DESCR CurrentNotify to CurrentNC 2017-04-06 22:00:11 +02:00
Steve Karg
1e96b92b1a [r3128] Per 135-2016bl-2 and test BTL 9.20.1.8 Reading OPTIONAL Properties, if no optional properties are supported then an empty 'List of Results' shall be returned for the specified property. 2017-04-05 23:04:01 +02:00
Patrick Grimm
bcb9ba8a69 [3127] To process the last object in the object list 2017-04-05 23:00:45 +02:00
Patrick Grimm
ae96a1b852 [3126] NC added/corrected validation and also parse Priority as array 2017-04-05 22:53:46 +02:00
Steve Karg
e8332aa9d2 [r3125] Fixed warnings detected by splint 2017-04-05 22:37:10 +02:00
Steve Karg
15804701db [r3123] Fixed warnings found via splint. 2017-04-05 22:25:47 +02:00
Patrick Grimm
a070401d7f rej [r3120] Merge splint warning fixes. 2017-04-05 22:24:06 +02:00
Steve Karg
3d7f377b11 [r3121] Fixed warnings found via splint. 2017-04-05 22:14:38 +02:00
Steve Karg
76836baa88 [r3120] Merge splint warning fixes. 2017-04-05 22:14:38 +02:00
Steve Karg
93aac61ff7 [r3117] Changes to clean up compile warnings 2017-04-05 22:11:31 +02:00
Patrick Grimm
233ff85d6e revert 2783bf85b4 fix compiler warning make get_local_address_ioctl static 2017-04-05 21:48:06 +02:00
Steve Karg
c3eff7726d [r3116] Add makefile for BACnet/IPv6 unit test. 2017-04-05 00:21:01 +02:00
Steve Karg
447a18383d [r3109] Updated Atmega8 project to compile under IAR EWARM 6.40.3 2017-04-05 00:17:57 +02:00
Steve Karg
d046829710 [r3108] Added some text into EPICS demo that BTL wants to see in their testing tool. 2017-04-05 00:17:57 +02:00