Bugfix/bacnet real endian simplify (#89)

* Remove dependence on endian define

* Make use of existing big_endian function if BACNET_BIG_ENDIAN is not defined

* Add efficient endian macro option if available

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2020-05-24 09:36:21 -05:00
committed by GitHub
parent 764e0e8448
commit cbfa74e48d
25 changed files with 354 additions and 257 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ A-2: MS/TP works correctly as of the 0.2.6 release. I spent a several days corre
Q-3: Does the stack have some specific requirements regarding the hardware (e.g. non-volatile memory, 32-bit CPU, ...)?
A-3: Not really. The specific stuff is in the ports/ directory, and that is expected to be modified by the end user if necessary. Big Endian and Little Endian used to be automatic, but that took up too much code space, so there is a BIG_ENDIAN define in the makefile. Most of the variables are defined using the ANSI C-99 uint8_t, uint16_t, uint32_t, int8_t, int16_t, int32_t from stdint.h, along with bool from stdbool.h. Most of the APDU size returns are int.
A-3: Not really. The specific stuff is in the ports/ directory, and that is expected to be modified by the end user if necessary. Most of the variables are defined using the ANSI C-99 uint8_t, uint16_t, uint32_t, int8_t, int16_t, int32_t from stdint.h, along with bool from stdbool.h. Most of the APDU size returns are int.
Q-4: Does the stack have some specific requirements regarding OS? What OS features are used (threads, timers, semaphors, events, mutexes...)?
+13 -14
View File
@@ -1,7 +1,7 @@
BACnet Stack - SourceForge.net
Build for Visual C++ 6.0
When building the BACnet stack using Visual C++ compiler,
When building the BACnet stack using Visual C++ compiler,
there are some settings that are important.
Q. Are there some global configuration options for this BACnet stack?
@@ -9,7 +9,6 @@ Q. Are there some global configuration options for this BACnet stack?
A. The BACnet stack uses some preprocessor defines to configure
a number of subtle personalities.
PRINT_ENABLED=1 - enables printing to stdio
BIG_ENDIAN=0 - chooses the BACnet encoding and decoding order
BACDL_BIP=1 - chooses BACnet/IP for the datalink layer
BACDL_ETHERNET=0 - chooses BACnet Ethernet for the datalink layer
BACDL_ARCNET=0 - chooses BACnet ARCNET for the datalink layer
@@ -17,13 +16,13 @@ BACDL_MSTP=0 - chooses BACnet MS/TP for the datalink layer
USE_INADDR=1 - uses INADDR_BROADCAST for broadcast rather than CLASSx
TSM_ENABLED=1 - enables the Transaction State Machine for clients
BIP_DEBUG=1 - enables print statements for debugging
In Visual C++, add a Preprocessor Definition by:
In Visual C++, add a Preprocessor Definition by:
1. Select "Project" menu
2. Select "Settings..."
3. Select the "C/C++" tab (3rd Tab)
4. Select the Category: General
5. You can see the "Preprocessor Definitions:" box
6. Type OPTION_NAME=1 or OPTION_NAME=0 in that edit box
6. Type OPTION_NAME=1 or OPTION_NAME=0 in that edit box
using a comma to separate multiple options.
7. Press OK
8. Compile the entire project again...
@@ -39,8 +38,8 @@ unix2dos bacnet.dsp
Q. error LNK2001: unresolved external symbol _WinMain@16
A. The demo ports/win32/main.c was designed as a Win32 Console
Application. If you want to change it to a Windows GUI application,
A. The demo ports/win32/main.c was designed as a Win32 Console
Application. If you want to change it to a Windows GUI application,
you will have to add all the Windows GUI code, including WinMain().
I recommend that you use a framework, such as WxWidgets/WxWindows,
but this has not been done yet.
@@ -65,7 +64,7 @@ c:\code\bacnet-stack\demo\handler\,c:\code\bacnet-stack\demo\object\
Q. error C2065: 'MAX_MPDU' : undeclared identifier
A. The BACnet stack uses a preprocessor define to configure
its datalink layer. In Visual C++, add a Preprocessor Definition by:
its datalink layer. In Visual C++, add a Preprocessor Definition by:
1. Select "Project" menu
2. Select "Settings..."
3. Select the "C/C++" tab (3rd Tab)
@@ -78,7 +77,7 @@ its datalink layer. In Visual C++, add a Preprocessor Definition by:
Q. error LNK2001: unresolved external symbol _bacapp_print
A. The BACnet stack uses a preprocessor define to configure
printing to stdio. In Visual C++, add a Preprocessor Definition by:
printing to stdio. In Visual C++, add a Preprocessor Definition by:
1. Select "Project" menu
2. Select "Settings..."
3. Select the "C/C++" tab (3rd Tab)
@@ -101,8 +100,8 @@ A. Visual C++ needs to have the Winsock library to be happy:
Q. error C2061: in file tsm.c
A. The BACnet stack uses a preprocessor define to configure
client functionality in the Transaction State Machine (TSM).
In Visual C++, add a Preprocessor Definition by:
client functionality in the Transaction State Machine (TSM).
In Visual C++, add a Preprocessor Definition by:
1. Select "Project" menu
2. Select "Settings..."
3. Select the "C/C++" tab (3rd Tab)
@@ -130,10 +129,10 @@ with MS/TP datalink enabled (BACDL_MSTP instead of BACDL_BIP):
4. Select the Category: Code Generation
5. Select the Multithreaded from the "Use runtime library" box options
Q. error LNK2019: Verweis auf nicht aufgelöstes externes Symbol
"_GetAdaptersInfo@8" in Funktion "_getIpMaskForIpAddress".
A. There is the Iphlpapi.lib library missing from the VC++ project
(for the GetAdaptersInfo error) that you need to add:
Q. error LNK2019: Verweis auf nicht aufgelöstes externes Symbol
"_GetAdaptersInfo@8" in Funktion "_getIpMaskForIpAddress".
A. There is the Iphlpapi.lib library missing from the VC++ project
(for the GetAdaptersInfo error) that you need to add:
http://msdn2.microsoft.com/en-us/library/aa916102.aspx
Note that Iphlpapi.lib/.h is not included with Visual C++ 6.0;
you would need to download the platform SDK to get it.