f5829ea483
Added interrupt disable protection, and enable interrupts early in the ISR.
skarg
2010-12-10 23:14:43 +00:00
794e2ea9d4
Changed timers on AVR to only disable the timer interrupt, not global interrupts.
skarg
2010-12-10 23:13:50 +00:00
68a2f83638
Changed object functions to use a local name and smaller structure so it wouldn't name collide with the one defined in device.h.
skarg
2010-12-10 23:12:13 +00:00
2f424e038d
Touched up some of the Doxygen tags.
tbrennan3
2010-12-03 07:25:34 +00:00
b768518a9d
Now using Who-Is-Remote() to get the address binding if targeting a routed Device. Eliminated empty braces for the Device object in its own list of objects.
tbrennan3
2010-12-03 06:54:02 +00:00
de4ead47c6
Improvements to bacepics for the routing case; can now specify a DNET on the command line. Not all there yet, however, for the routed case. Added null tests and dummy string defaults in Add_Routed_Device().
tbrennan3
2010-12-02 22:05:59 +00:00
31f440e070
Implemented separate Who-Is and Who-Has handlers for the routed case, where we loop through all the Devices looking for matches. Tested and improved the routing code. Gateway demo now sends I-Am as each Device is added. Added test for valid Network number when routing, and only send Reject message if this fails (and not if we just can't find a Device match). Test the hop_count and discard the packet if would reach 0 and a destination Network is called for.
tbrennan3
2010-12-02 20:33:43 +00:00
e850469da8
Added character string helper to test for printable. Added to WP checks.
skarg
2010-12-02 19:33:22 +00:00
f26997a367
Changed make to $(MAKE). Not sure if this is still needed, since MSYS has make.exe (in lieu of MinGW). Lots of demo makefiles still have make in them...
skarg
2010-11-30 18:04:27 +00:00
a39bf392bd
Fixed Makefile for MinGW build. Testing with MinGW 20101030 and MSYS. gcc (GCC) 4.5.0 (MinGW), GNU Make 3.81 (MSYS).
skarg
2010-11-30 17:50:24 +00:00
4ef8209fed
Added some text to the coding standard about variable names.
skarg
2010-11-30 06:32:42 +00:00
01d1d5bd77
Changed %zu back to %d since Borland C++ doesn't understand %zu.
skarg
2010-11-30 06:08:48 +00:00
dd92901aa1
I like Piotr's new make structure a lot. I've tweaked it a little here: made the most important defines conditional, so if they're set before the call to make, those external definitions will not be overriden, but defaults can be supplied here in the Makefile if they have not been defined. This is really handy for my use of the stack (and probably yours, too): I can take the distribution right out-of-the-box and yet tailor it to my needs by the way I invoke make.
tbrennan3
2010-11-29 15:37:13 +00:00
0e34c5ce5c
Moved ports back into root Makefile.
skarg
2010-11-29 04:18:53 +00:00
072640f887
Added in call to trend_log_timer so Trendlogs are updated and changed stop time on initial setup of logs to the year 2020 instead of 2009 so they would accumulate some more records.
petermcs
2010-11-26 13:16:55 +00:00
47ecaeabaa
To build the Routing demo define BAC_ROUTING in the top Makefile. The value is not important - the symbol has to be defined.
bacpack
2010-11-25 05:10:01 +00:00
6a523e4d23
First attempt to clean-up Makefiles. 1. Top (main) makefile defines build configuration variables and export them for sub-makes to use. BAC_ROUTING is defined here - is has been removed from config.h. 2. A new makefile has been added in demo subdirectory. It builds the demo applications. NOTE: the 'ports' target is not build.
bacpack
2010-11-25 04:17:58 +00:00
a595bdb4b5
Resolved more code where we didn't need to define separate BAC_ROUTING functionality, since the npdu_encode_pdu() will do the right thing if our source address is for the gateway (root device), because src->net and/or src->len will be 0. For the important Device_Object_Instance_Number(), will redirect to the Routed_Device_Object_Instance_Number() function if this is a routing build. This leaves only the Who-Is and Who-Has handlers to be dealt with.
tbrennan3
2010-11-24 22:04:02 +00:00
22c14fccad
Followed Steve's good recommendation, and made routed_get_my_address() be a variant of datalink_get_my_address() just when routing is in use. Haven't done anything about the sending functions yet. Renamed Lookup_Routed_Device_Address() as Routed_Device_Address_Lookup(), and replaced it in the routed npdu handler with a function that finds the "next" gateway or routed device, as per the destination address. (Less tied to the specifics of the gw_device.c implementation.) Fixed a few build warnings (eg, %zu for size_t arguments). Until we improve the makefile system, I've enabled BAC_ROUTING in config.h
tbrennan3
2010-11-24 20:44:32 +00:00
c69ffaa4a5
Default BAC_ROUTING to 0 if not currently defined to maintain non routing behaviour.
petermcs
2010-11-18 22:20:32 +00:00
dbb8997b4d
Added routing support for virtual network to more of the handlers and fixed up a couple of typos from the previous changes. Added ReadRange service handler so that trendlogs can be read.
petermcs
2010-11-18 21:29:11 +00:00
3bb228edf2
Added routing support for virtual network so that source addresses are transmitted when required and the correct object ID is used.
petermcs
2010-11-17 23:16:24 +00:00
a1eaffccff
Added Get_Routed_Device_Address function
petermcs
2010-11-17 23:14:07 +00:00
38d307d780
Added in the full set of objects. Fixed up snprintf to work with MSVC. Fixed virtual object address initialisation so network and address are initialised.
petermcs
2010-11-17 23:05:54 +00:00
3d80d1a272
Corrected Multi-State Input and Output object Present_Value and number of states handling after being reminded at the BACnet Plugfest that "The Present_Value property shall always have a value greater than zero."
skarg
2010-11-17 08:13:33 +00:00
6319e1a7d9
Good IDE tools can be sooo helpful.
tbrennan3
2010-11-16 13:12:23 +00:00
9413ec4da2
Small reediting.
bacpack
2010-11-13 20:31:37 +00:00
502cbcc2e6
1. In device.c, the Object_Table[] is now extern; it has to be defined by the user application (see demos); only the required BACnet objects have to be included. 2. Objects' .h files define macro to be used to initialize Object_Table[].
bacpack
2010-11-13 19:57:29 +00:00
80185c6a63
Changed lines marked with "dangerous cast" to use memcpy.
skarg
2010-11-06 01:27:11 +00:00
d50eb7fef7
In bvlc.c, IP address and port number are always in the network byte order (including FD_Table[] and BBMD_Table[]). The only left hton and ntoh functions are in debug_printf() and test functions.
bacpack
2010-11-05 19:30:20 +00:00
a639864cc8
In bip.c getter and setter functions of IP address and Port number expect and return values in the network byte order. All ntoh and hton were eliminated from bip.c. All other modules changed to be consistent. arm7 port left unchanged.
bacpack
2010-11-04 13:30:26 +00:00
437112cc52
Reverted the BIG_ENDIAN additions as they are not needed since bacint is converting integers in an endian neutral manner.
skarg
2010-10-31 19:13:10 +00:00
d6cee12acb
added ms-input.c and trendlog.c to project file
petermcs
2010-10-30 16:16:05 +00:00
73415f4a5d
Modified to store and use IP addresses and the IP port number in the network byte order.
bacpack
2010-10-29 17:29:01 +00:00
79b86d3a8c
Corrected for ENDIANNESS.
bacpack
2010-10-27 19:15:10 +00:00
76260a994d
Fix receive BVLL Forwarded-NPDU message: the received source address is in network data format and it has to be stored in the same format. Note: the encode_ and decode_ functions are broken; they ignore host's endianness.
bacpack
2010-10-27 14:50:52 +00:00
feb44efb87
Corrected missing REAL len decoding. Thank you, Julien!
skarg
2010-10-25 11:44:08 +00:00
0953c8ada6
Per the datasheet, "Beware that if doing a Read-Modify-Write on ADCSRA, a pending interrupt can be disabled." I don't know a good way to do this, but using ADIE seems to not be reliable.
skarg
2010-10-22 17:12:30 +00:00
3b49fb0271
Change global interrupt disable to timer specific interrupt disable for data protection. Added interrupt disabled around ADC API.
skarg
2010-10-22 00:11:25 +00:00
2cac9ba528
Corrected printing of array properties.
skarg
2010-10-21 20:14:07 +00:00
e77f12d261
Yes, these should be deleted now that the code is moved into the regular library area.
tbrennan3
2010-10-21 18:19:58 +00:00
57781b40cb
Changed Tturnaround time in MS/TP modules to be a minimum of 2ms, or use a dummy transmit of 4 bytes while the transceiver is disabled. 1ms delay will always give smaller than 1ms of delay due to silence timer tick.
skarg
2010-10-18 20:42:26 +00:00
a5f24fa19f
Tweaked the comments for better Doxygen output.
tbrennan3
2010-10-13 19:00:57 +00:00
48411b8dbf
Routing functionality complete, and working. (Have not done extensive testing, though.) For building, made it possible to include or exclude the routing functionality with simple changes in the main Makefile and enables in lib/Makefile and include/config.h The Device object (device.c and .h) was extended to support the virtually routed Devices, with most of the new functions in new file gw_device.c to replace their simpler cousins in device.c.
tbrennan3
2010-10-13 15:59:39 +00:00
f934f8add8
Changed bacapp data len function to just decode the len without regard to the storage ability of the internal data structures.
skarg
2010-10-13 02:29:55 +00:00
86dbaf409b
Added handling for bacapp decode value returning error codes.
skarg
2010-10-12 03:02:05 +00:00
e9249b5b5e
Added test for a decoding problem where the stack is unable to decode something, and retrofitted into WriteProperty for each of the demo objects by returning an Error, Out of Range.
skarg
2010-10-12 01:17:50 +00:00
9058fc7f3a
Finished up the Network Layer Message handling (I hope). Simplified the Router Table encoding (just based on DNETs).
tbrennan3
2010-10-08 02:50:14 +00:00
478d7aeb41
Working out the sending of Network Layer Messages; trying to refactor the actual sending routines to just one since the beginning, end, and error handling are the same for all types - just the payload is different. For many, need to know what our managed downstream BACnet Network list is, so added that argument.
tbrennan3
2010-10-07 21:00:46 +00:00
9efd3465cf
Adding more support for Network Layer Message handling.
tbrennan3
2010-10-07 20:56:09 +00:00
8d2560225d
Updated builds for ports/atmega168 (IAR) and for ports/bdk-atxx4-mstp (AVR Studio)
skarg
2010-10-07 15:56:35 +00:00
b54218939e
Added extra sub-state for MS/TP from Addendum 135-2008v. Tested with ports/bdk-atxx4-mstp/ code on the BACnet Development Kit. Clean compile on src/mstp.c, ports/at91sam7s and ports/atmega168, but untested. All other changes were not compiled or tested.
skarg
2010-10-07 15:52:45 +00:00
23eecbc100
Added more informative error message.
skarg
2010-10-06 18:49:52 +00:00
8165d5bb09
Corrected clock frequency to 18.432MHz to correct baud rate at 115200.
skarg
2010-10-04 23:26:25 +00:00
cf0f01c5a1
Adding a gateway project to demonstrate routing to a virtual network. The work is not complete yet; this is an interim checkin. Ultimately the device.c file will be merged with the regular one or the deltas will be separated into some other file.
tbrennan3
2010-09-29 21:04:00 +00:00
9f4b8e5f19
Adding a handler for routed NPDUs (ie, Network Layer Message handling). The work is not complete yet; this is an interim checkin.
tbrennan3
2010-09-29 20:52:51 +00:00
d39d4fded3
More function documentation. Defined a default Hop Count value, and used 15 instead of 255.
tbrennan3
2010-09-29 20:29:12 +00:00
e5f5dce995
Added some javadoc-type function comments. Reduced the default hop count from way-big 255 to 15.
tbrennan3
2010-09-28 21:05:38 +00:00
44b7e02721
Tweaked the debug building and printing a little - I hope this works OK for everyone. Let me know if not. Tamped down a few warnings. For the demo/server Makefile, made an either/or choice between executable size optimization (normal) or gdb debug info and no optimization.
tbrennan3
2010-09-27 20:27:29 +00:00
d5822ac53a
Add clear of MCU status registers at initialization.
skarg
2010-09-24 19:38:32 +00:00
6cb6200f39
Reverted seeprom timeout for now. Lowered APDU size in Makefile. Changed stack based text to static buffer.
skarg
2010-09-23 00:34:26 +00:00
80c27fd0b5
Added timeout to SEEPROM wait for transmit.
skarg
2010-09-22 18:33:18 +00:00
430f068305
Updated makefile for v2 hardware.
skarg
2010-09-22 18:32:53 +00:00
4f464820eb
Added baud rate set/view to serial terminal.
skarg
2010-09-22 18:31:24 +00:00
5e5f38cb06
My gcc complained about a conflict with the function of the same name as the array, Binary_Output_Out_Of_Service. This fix lets it build.
tbrennan3
2010-09-22 02:16:22 +00:00
b1c9870989
Refactoring some BDK code. Updating Skip Data state for AT91 port.
skarg
2010-09-22 01:13:42 +00:00
64c28c32ad
corrected MS/TP new Skip Data states
skarg
2010-09-22 01:12:14 +00:00
2fc159cea2
Changed ADC reading to be 10-bit.
skarg
2010-09-21 19:50:43 +00:00
be7efebaa1
Enhanced the ADC to be able to read all channels, and fixed bug in configuration of ADC.
skarg
2010-09-21 19:50:16 +00:00
9569f2c536
Fixed EOL and performed standard indentation.
skarg
2010-09-16 22:00:47 +00:00
092834b2d9
changed led initialization behavior to turn on for 500ms for board validation.
skarg
2010-09-16 21:57:10 +00:00
d7ad075c7a
UpdAdded new MS/TP skip data state. Added ring buffer for incoming PDU to fix WhoIs followed by ReadProperty situation.
skarg
2010-09-16 17:57:51 +00:00
6e739e06d5
Added new MS/TP skip data state. Added ring buffer for incoming PDU to fix WhoIs followed by ReadProperty situation.
skarg
2010-09-16 16:08:10 +00:00
c8f4aac1b7
Cleaning up some code to make it more robust.
skarg
2010-09-16 14:49:33 +00:00
7e7b83a6be
Added export for MS/TP Sole Master.
skarg
2010-09-13 18:44:42 +00:00
5524cab7cd
Corrected MS/TP capture statistics after converversion of FSM.
skarg
2010-09-13 14:08:28 +00:00
bb0c98a9c1
added MS/TP state skip data to MS/TP capture tool, and removed Lurking.
skarg
2010-09-12 16:08:31 +00:00
9e13bd0ebb
converted COV to use new error, reject, abort method.
skarg
2010-09-11 19:24:20 +00:00
914a063681
removed kludge by adding initializer
skarg
2010-09-11 19:23:08 +00:00
7832ba11db
Changed Object List in various ports to return Segementation Not Supported abort when it is too large to return in a single APDU.
skarg
2010-09-11 13:38:16 +00:00
a74e282f93
Updated some documentation about Environment Variables.
skarg
2010-09-10 18:27:58 +00:00
7928d7cb6c
Fixed compiler error (after adding a change for IAR compile).
skarg
2010-09-07 18:18:30 +00:00
332d776c32
Added watchdog module to makefile (after adding it to the project for IAR compile).
skarg
2010-09-07 18:00:15 +00:00