Commit Graph

1809 Commits

Author SHA1 Message Date
petermcs 6cec4b3cdb Adding in missing extern "c" so it works when called from C++ 2010-12-11 15:09:35 +00:00
skarg 75249e0330 Added byte sized timer that can be used inside an 8-bit microcontroller ISR for up to 255mS of elapsed timing. 2010-12-10 23:16:02 +00:00
skarg f5829ea483 Added interrupt disable protection, and enable interrupts early in the ISR. 2010-12-10 23:14:43 +00:00
skarg 794e2ea9d4 Changed timers on AVR to only disable the timer interrupt, not global interrupts. 2010-12-10 23:13:50 +00:00
skarg 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. 2010-12-10 23:12:13 +00:00
tbrennan3 2f424e038d Touched up some of the Doxygen tags. 2010-12-03 07:25:34 +00:00
tbrennan3 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.
2010-12-03 06:54:02 +00:00
tbrennan3 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().
2010-12-02 22:05:59 +00:00
tbrennan3 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.
2010-12-02 20:33:43 +00:00
skarg e850469da8 Added character string helper to test for printable. Added to WP checks. 2010-12-02 19:33:22 +00:00
skarg 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... 2010-11-30 18:04:27 +00:00
skarg a39bf392bd Fixed Makefile for MinGW build. Testing with MinGW 20101030 and MSYS. gcc (GCC) 4.5.0 (MinGW), GNU Make 3.81 (MSYS). 2010-11-30 17:50:24 +00:00
skarg 4ef8209fed Added some text to the coding standard about variable names. 2010-11-30 06:32:42 +00:00
skarg 01d1d5bd77 Changed %zu back to %d since Borland C++ doesn't understand %zu. 2010-11-30 06:08:48 +00:00
tbrennan3 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.

Also, can somebody add a comment about what WEAK_FUNC is defined for?  I couldn't see any reference to it in the code.
If it's really special, it could be removed from the general case here and included by the external definition of BACNET_DEFINES
2010-11-29 15:37:13 +00:00
skarg 0e34c5ce5c Moved ports back into root Makefile. 2010-11-29 04:18:53 +00:00
skarg 8041006068 Corrected splint warning. 2010-11-28 21:04:53 +00:00
petermcs 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. 2010-11-26 13:16:55 +00:00
bacpack 47ecaeabaa To build the Routing demo define BAC_ROUTING in the top Makefile. The value is not important - the symbol has to be defined. 2010-11-25 05:10:01 +00:00
bacpack 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.
2010-11-25 04:17:58 +00:00
tbrennan3 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.
2010-11-24 22:04:02 +00:00
tbrennan3 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
2010-11-24 20:44:32 +00:00
bacpack db5dea31e7 Compiler fails - missing declaration of Get_Routed_Device_Address(). 2010-11-21 17:03:04 +00:00
petermcs c69ffaa4a5 Default BAC_ROUTING to 0 if not currently defined to maintain non routing behaviour. 2010-11-18 22:20:32 +00:00
petermcs 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.
2010-11-18 21:29:11 +00:00
petermcs 3bb228edf2 Added routing support for virtual network so that source addresses are transmitted when required and the correct object ID is used. 2010-11-17 23:16:24 +00:00
petermcs a1eaffccff Added Get_Routed_Device_Address function 2010-11-17 23:14:07 +00:00
petermcs 4a137eb8df Added Get_Routed_Device_Address prototype 2010-11-17 23:12:54 +00:00
petermcs b87f53c4b4 Only add in src field if it has a non zero address length 2010-11-17 23:11:32 +00:00
petermcs f0fc277650 Added gateway demo project 2010-11-17 23:09:29 +00:00
petermcs 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.
2010-11-17 23:05:54 +00:00
skarg 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." 2010-11-17 08:13:33 +00:00
tbrennan3 6319e1a7d9 Good IDE tools can be sooo helpful. 2010-11-16 13:12:23 +00:00
bacpack 9413ec4da2 Small reediting. 2010-11-13 20:31:37 +00:00
bacpack 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[].
2010-11-13 19:57:29 +00:00
skarg 80185c6a63 Changed lines marked with "dangerous cast" to use memcpy. 2010-11-06 01:27:11 +00:00
bacpack 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.
2010-11-05 19:30:20 +00:00
bacpack 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.
2010-11-04 13:30:26 +00:00
skarg 437112cc52 Reverted the BIG_ENDIAN additions as they are not needed since bacint is converting integers in an endian neutral manner. 2010-10-31 19:13:10 +00:00
petermcs d6cee12acb added ms-input.c and trendlog.c to project file 2010-10-30 16:16:05 +00:00
bacpack 73415f4a5d Modified to store and use IP addresses and the IP port number in the network byte order. 2010-10-29 17:29:01 +00:00
bacpack 79b86d3a8c Corrected for ENDIANNESS. 2010-10-27 19:15:10 +00:00
bacpack 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.
2010-10-27 14:50:52 +00:00
skarg feb44efb87 Corrected missing REAL len decoding. Thank you, Julien! 2010-10-25 11:44:08 +00:00
skarg 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. 2010-10-22 17:12:30 +00:00
skarg bfaec69757 2010-10-22 14:58:28 +00:00
skarg 3b49fb0271 Change global interrupt disable to timer specific interrupt disable for data protection. Added interrupt disabled around ADC API. 2010-10-22 00:11:25 +00:00
skarg 2cac9ba528 Corrected printing of array properties. 2010-10-21 20:14:07 +00:00
tbrennan3 e77f12d261 Yes, these should be deleted now that the code is moved into the regular library area. 2010-10-21 18:19:58 +00:00
skarg df5197b89c added comments 2010-10-19 13:22:32 +00:00