diff --git a/bacnet-stack/abort.mak b/bacnet-stack/abort.mak index f0733434..0665ffd4 100644 --- a/bacnet-stack/abort.mak +++ b/bacnet-stack/abort.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_ABORT -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ abort.c \ diff --git a/bacnet-stack/arf.mak b/bacnet-stack/arf.mak index ff1061bc..7e2978e5 100644 --- a/bacnet-stack/arf.mak +++ b/bacnet-stack/arf.mak @@ -7,6 +7,7 @@ INCLUDES = -I. -Idemo/object -Itest CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ arf.c \ diff --git a/bacnet-stack/awf.mak b/bacnet-stack/awf.mak index f04f55f5..556a21df 100644 --- a/bacnet-stack/awf.mak +++ b/bacnet-stack/awf.mak @@ -7,6 +7,7 @@ INCLUDES = -I. -Idemo/object -Itest CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ awf.c \ diff --git a/bacnet-stack/bacapp.mak b/bacnet-stack/bacapp.mak index 9b7b7118..f03ceafb 100644 --- a/bacnet-stack/bacapp.mak +++ b/bacnet-stack/bacapp.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_BACNET_APPLICATION_DATA -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bacapp.c \ datetime.c \ diff --git a/bacnet-stack/bacdcode.c b/bacnet-stack/bacdcode.c index 864d5635..be4acdfa 100644 --- a/bacnet-stack/bacdcode.c +++ b/bacnet-stack/bacdcode.c @@ -887,6 +887,58 @@ int decode_character_string(uint8_t * apdu, uint32_t len_value, return len; } +/* from clause 20.2.4 Encoding of an Unsigned Integer Value */ +/* and 20.2.1 General Rules for Encoding BACnet Tags */ +/* returns the number of apdu bytes consumed */ +int decode_unsigned(uint8_t * apdu, uint32_t len_value, uint32_t * value) +{ + uint16_t unsigned16_value = 0; + + if (value) { + switch (len_value) { + case 1: + *value = apdu[0]; + break; + case 2: + decode_unsigned16(&apdu[0], &unsigned16_value); + *value = unsigned16_value; + break; + case 3: + decode_unsigned24(&apdu[0], value); + break; + case 4: + decode_unsigned32(&apdu[0], value); + break; + default: + *value = 0; + break; + } + } + + return len_value; +} + +/* from clause 20.2.4 Encoding of an Unsigned Integer Value */ +/* and 20.2.1 General Rules for Encoding BACnet Tags */ +/* returns the number of apdu bytes consumed */ +int encode_bacnet_unsigned(uint8_t * apdu, uint32_t value) +{ + int len = 0; /* return value */ + + if (value < 0x100) { + apdu[0] = (uint8_t) value; + len = 1; + } else if (value < 0x10000) { + len = encode_unsigned16(&apdu[0], (uint16_t) value); + } else if (value < 0x1000000) { + len = encode_unsigned24(&apdu[0], value); + } else { + len = encode_unsigned32(&apdu[0], value); + } + + return len; +} + /* from clause 20.2.4 Encoding of an Unsigned Integer Value */ /* and 20.2.1 General Rules for Encoding BACnet Tags */ /* returns the number of apdu bytes consumed */ @@ -974,6 +1026,59 @@ int encode_context_enumerated(uint8_t * apdu, int tag_number, int value) return len; } +/* from clause 20.2.5 Encoding of a Signed Integer Value */ +/* and 20.2.1 General Rules for Encoding BACnet Tags */ +/* returns the number of apdu bytes consumed */ +int decode_signed(uint8_t * apdu, uint32_t len_value, int32_t * value) +{ + if (value) { + switch (len_value) { + case 1: + decode_signed8(&apdu[0], value); + break; + case 2: + decode_signed16(&apdu[0], value); + break; + case 3: + decode_signed24(&apdu[0], value); + break; + case 4: + decode_signed32(&apdu[0], value); + break; + default: + *value = 0; + break; + } + } + + return len_value; +} + +/* from clause 20.2.5 Encoding of a Signed Integer Value */ +/* and 20.2.1 General Rules for Encoding BACnet Tags */ +/* returns the number of apdu bytes consumed */ +int encode_bacnet_signed(uint8_t * apdu, int32_t value) +{ + int len = 0; /* return value */ + + /* don't encode the leading X'FF' or X'00' of the two's compliment. + That is, the first octet of any multi-octet encoded value shall + not be X'00' if the most significant bit (bit 7) of the second + octet is 0, and the first octet shall not be X'FF' if the most + significant bit of the second octet is 1. */ + if ((value >= -128) && (value < 128)) { + len = encode_signed8(&apdu[0], (int8_t) value); + } else if ((value >= -32768) && (value < 32768)) { + len = encode_signed16(&apdu[0], (int16_t) value); + } else if ((value > -8388608) && (value < 8388608)) { + len = encode_signed24(&apdu[0], value); + } else { + len = encode_signed32(&apdu[0], value); + } + + return len; +} + /* from clause 20.2.5 Encoding of a Signed Integer Value */ /* and 20.2.1 General Rules for Encoding BACnet Tags */ /* returns the number of apdu bytes consumed */ @@ -1394,6 +1499,22 @@ void testBACDCodeUnsigned(Test * pTest) return; } +void testBACnetUnsigned(Test * pTest) +{ + uint8_t apdu[32] = { 0 }; + uint32_t value = 0, test_value = 0; + int len = 0, test_len = 0; + + for (value = 0; ;value+=0xFF) { + len = encode_bacnet_unsigned(&apdu[0], value); + test_len = decode_unsigned(&apdu[0], len, &test_value); + ct_test(pTest, len == test_len); + ct_test(pTest, value == test_value); + if (value == 0xFFFFFFFF) + break; + } +} + void testBACDCodeSignedValue(Test * pTest, int32_t value) { uint8_t array[5] = { 0 }; @@ -1456,6 +1577,26 @@ void testBACDCodeSigned(Test * pTest) return; } +void testBACnetSigned(Test * pTest) +{ + uint8_t apdu[32] = { 0 }; + int32_t value = 0, test_value = 0; + int len = 0, test_len = 0; + + for (value = -2147483647; value < 0; value+=127) { + len = encode_bacnet_signed(&apdu[0], value); + test_len = decode_signed(&apdu[0], len, &test_value); + ct_test(pTest, len == test_len); + ct_test(pTest, value == test_value); + } + for (value = 2147483647; value > 0; value-=127) { + len = encode_bacnet_signed(&apdu[0], value); + test_len = decode_signed(&apdu[0], len, &test_value); + ct_test(pTest, len == test_len); + ct_test(pTest, value == test_value); + } +} + void testBACDCodeOctetString(Test * pTest) { uint8_t array[MAX_APDU] = { 0 }; @@ -1691,8 +1832,12 @@ int main(void) assert(rc); rc = ct_addTestFunction(pTest, testBACDCodeUnsigned); assert(rc); + rc = ct_addTestFunction(pTest, testBACnetUnsigned); + assert(rc); rc = ct_addTestFunction(pTest, testBACDCodeSigned); assert(rc); + rc = ct_addTestFunction(pTest, testBACnetSigned); + assert(rc); rc = ct_addTestFunction(pTest, testBACDCodeEnumerated); assert(rc); rc = ct_addTestFunction(pTest, testBACDCodeOctetString); diff --git a/bacnet-stack/bacdcode.h b/bacnet-stack/bacdcode.h index 07bc3302..d854b15d 100644 --- a/bacnet-stack/bacdcode.h +++ b/bacnet-stack/bacdcode.h @@ -189,13 +189,6 @@ extern "C" { BACNET_DATE * bdate); int decode_date(uint8_t * apdu, BACNET_DATE * bdate); -/* two octet unsigned16 */ - int encode_unsigned16(uint8_t * apdu, uint16_t value); - int decode_unsigned16(uint8_t * apdu, uint16_t * value); -/* four octet unsigned32 */ - int encode_unsigned32(uint8_t * apdu, uint32_t value); - int decode_unsigned32(uint8_t * apdu, uint32_t * value); - /* from clause 20.1.2.4 max-segments-accepted */ /* and clause 20.1.2.5 max-APDU-length-accepted */ /* returns the encoded octet */ diff --git a/bacnet-stack/bacdcode.mak b/bacnet-stack/bacdcode.mak index 1df23c78..5ce1b7c9 100644 --- a/bacnet-stack/bacdcode.mak +++ b/bacnet-stack/bacdcode.mak @@ -6,6 +6,7 @@ CFLAGS = -Wall -I. -Itest -g -DBIG_ENDIAN=0 -DTEST -DTEST_DECODE TARGET = bacdcode SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ test/ctest.c diff --git a/bacnet-stack/bacerror.mak b/bacnet-stack/bacerror.mak index 3966a9e0..8189399b 100644 --- a/bacnet-stack/bacerror.mak +++ b/bacnet-stack/bacerror.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_BACERROR -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ bacerror.c \ diff --git a/bacnet-stack/bacint.c b/bacnet-stack/bacint.c index 11369576..a4782a3f 100644 --- a/bacnet-stack/bacint.c +++ b/bacnet-stack/bacint.c @@ -279,111 +279,6 @@ int decode_signed32(uint8_t * apdu, int32_t * value) return 4; } -/* from clause 20.2.5 Encoding of a Signed Integer Value */ -/* and 20.2.1 General Rules for Encoding BACnet Tags */ -/* returns the number of apdu bytes consumed */ -int decode_signed(uint8_t * apdu, uint32_t len_value, int32_t * value) -{ - if (value) { - switch (len_value) { - case 1: - decode_signed8(&apdu[0], value); - break; - case 2: - decode_signed16(&apdu[0], value); - break; - case 3: - decode_signed24(&apdu[0], value); - break; - case 4: - decode_signed32(&apdu[0], value); - break; - default: - *value = 0; - break; - } - } - - return len_value; -} - -/* from clause 20.2.5 Encoding of a Signed Integer Value */ -/* and 20.2.1 General Rules for Encoding BACnet Tags */ -/* returns the number of apdu bytes consumed */ -int encode_bacnet_signed(uint8_t * apdu, int32_t value) -{ - int len = 0; /* return value */ - - /* don't encode the leading X'FF' or X'00' of the two's compliment. - That is, the first octet of any multi-octet encoded value shall - not be X'00' if the most significant bit (bit 7) of the second - octet is 0, and the first octet shall not be X'FF' if the most - significant bit of the second octet is 1. */ - if ((value >= -128) && (value < 128)) { - len = encode_signed8(&apdu[0], (int8_t) value); - } else if ((value >= -32768) && (value < 32768)) { - len = encode_signed16(&apdu[0], (int16_t) value); - } else if ((value > -8388608) && (value < 8388608)) { - len = encode_signed24(&apdu[0], value); - } else { - len = encode_signed32(&apdu[0], value); - } - - return len; -} - -/* from clause 20.2.4 Encoding of an Unsigned Integer Value */ -/* and 20.2.1 General Rules for Encoding BACnet Tags */ -/* returns the number of apdu bytes consumed */ -int encode_bacnet_unsigned(uint8_t * apdu, uint32_t value) -{ - int len = 0; /* return value */ - - if (value < 0x100) { - apdu[0] = (uint8_t) value; - len = 1; - } else if (value < 0x10000) { - len = encode_unsigned16(&apdu[0], (uint16_t) value); - } else if (value < 0x1000000) { - len = encode_unsigned24(&apdu[0], value); - } else { - len = encode_unsigned32(&apdu[0], value); - } - - return len; -} - -/* from clause 20.2.4 Encoding of an Unsigned Integer Value */ -/* and 20.2.1 General Rules for Encoding BACnet Tags */ -/* returns the number of apdu bytes consumed */ -int decode_unsigned(uint8_t * apdu, uint32_t len_value, uint32_t * value) -{ - uint16_t unsigned16_value = 0; - - if (value) { - switch (len_value) { - case 1: - *value = apdu[0]; - break; - case 2: - decode_unsigned16(&apdu[0], &unsigned16_value); - *value = unsigned16_value; - break; - case 3: - decode_unsigned24(&apdu[0], value); - break; - case 4: - decode_unsigned32(&apdu[0], value); - break; - default: - *value = 0; - break; - } - } - - return len_value; -} - /* end of decoding_encoding.c */ #ifdef TEST #include @@ -505,42 +400,6 @@ void testBACnetSigned32(Test * pTest) } } -void testBACnetSigned(Test * pTest) -{ - uint8_t apdu[32] = { 0 }; - int32_t value = 0, test_value = 0; - int len = 0, test_len = 0; - - for (value = -2147483647; value < 0; value+=127) { - len = encode_bacnet_signed(&apdu[0], value); - test_len = decode_signed(&apdu[0], len, &test_value); - ct_test(pTest, len == test_len); - ct_test(pTest, value == test_value); - } - for (value = 2147483647; value > 0; value-=127) { - len = encode_bacnet_signed(&apdu[0], value); - test_len = decode_signed(&apdu[0], len, &test_value); - ct_test(pTest, len == test_len); - ct_test(pTest, value == test_value); - } -} - -void testBACnetUnsigned(Test * pTest) -{ - uint8_t apdu[32] = { 0 }; - uint32_t value = 0, test_value = 0; - int len = 0, test_len = 0; - - for (value = 0; ;value+=0xFF) { - len = encode_bacnet_unsigned(&apdu[0], value); - test_len = decode_unsigned(&apdu[0], len, &test_value); - ct_test(pTest, len == test_len); - ct_test(pTest, value == test_value); - if (value == 0xFFFFFFFF) - break; - } -} - #ifdef TEST_BACINT int main(void) { @@ -563,10 +422,6 @@ int main(void) assert(rc); rc = ct_addTestFunction(pTest, testBACnetSigned32); assert(rc); - rc = ct_addTestFunction(pTest, testBACnetSigned); - assert(rc); - rc = ct_addTestFunction(pTest, testBACnetUnsigned); - assert(rc); /* configure output */ ct_setStream(pTest, stdout); ct_run(pTest); diff --git a/bacnet-stack/bacint.h b/bacnet-stack/bacint.h new file mode 100644 index 00000000..8f9a3778 --- /dev/null +++ b/bacnet-stack/bacint.h @@ -0,0 +1,67 @@ +/*####COPYRIGHTBEGIN#### + ------------------------------------------- + Copyright (C) 2004 Steve Karg + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + The Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA. + + As a special exception, if other files instantiate templates or + use macros or inline functions from this file, or you compile + this file and link it with other works to produce a work based + on this file, this file does not by itself cause the resulting + work to be covered by the GNU General Public License. However + the source code for this file must still be made available in + accordance with section (3) of the GNU General Public License. + + This exception does not invalidate any other reasons why a work + based on this file might be covered by the GNU General Public + License. + ------------------------------------------- +####COPYRIGHTEND####*/ +#ifndef BACINT_H +#define BACINT_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + /* unsigned value encoding and decoding */ + int encode_unsigned16(uint8_t * apdu, uint16_t value); + int decode_unsigned16(uint8_t * apdu, uint16_t * value); + int encode_unsigned24(uint8_t * apdu, uint32_t value); + int decode_unsigned24(uint8_t * apdu, uint32_t * value); + int encode_unsigned32(uint8_t * apdu, uint32_t value); + int decode_unsigned32(uint8_t * apdu, uint32_t * value); + + /* signed value encoding and decoding */ + int encode_signed8(uint8_t * apdu, int8_t value); + int decode_signed8(uint8_t * apdu, int32_t * value); + int encode_signed16(uint8_t * apdu, int16_t value); + int decode_signed16(uint8_t * apdu, int32_t * value); + int encode_signed24(uint8_t * apdu, int32_t value); + int decode_signed24(uint8_t * apdu, int32_t * value); + int encode_signed32(uint8_t * apdu, int32_t value); + int decode_signed32(uint8_t * apdu, int32_t * value); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/bacnet-stack/bip.c b/bacnet-stack/bip.c index a0740691..60f2293b 100644 --- a/bacnet-stack/bip.c +++ b/bacnet-stack/bip.c @@ -35,6 +35,7 @@ #include /* for standard integer types uint8_t etc. */ #include /* for the standard bool type. */ #include "bacdcode.h" +#include "bacint.h" #include "bip.h" #include "net.h" /* custom per port */ diff --git a/bacnet-stack/bvlc.c b/bacnet-stack/bvlc.c index c12e7bc2..1990d6cf 100644 --- a/bacnet-stack/bvlc.c +++ b/bacnet-stack/bvlc.c @@ -36,6 +36,7 @@ #include /* for the standard bool type. */ #include /* for the standard bool type. */ #include "bacdcode.h" +#include "bacint.h" #include "bip.h" #include "net.h" /* custom per port */ diff --git a/bacnet-stack/bvlc.mak b/bacnet-stack/bvlc.mak index a0c5240b..bb9f0d6e 100644 --- a/bacnet-stack/bvlc.mak +++ b/bacnet-stack/bvlc.mak @@ -9,6 +9,7 @@ INCLUDES = -Iports/linux -Itest -I. CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ bvlc.c \ diff --git a/bacnet-stack/cov.mak b/bacnet-stack/cov.mak index 2d5b9069..05ca0602 100644 --- a/bacnet-stack/cov.mak +++ b/bacnet-stack/cov.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -Idemo/object -DTEST -DTEST_COV -DBACDL_TEST=1 -DBIG_ENDIAN=0 -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ datetime.c \ bacapp.c \ diff --git a/bacnet-stack/dcc.mak b/bacnet-stack/dcc.mak index 9361edad..ec860f2c 100644 --- a/bacnet-stack/dcc.mak +++ b/bacnet-stack/dcc.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_DEVICE_COMMUNICATION_CONTROL -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ dcc.c \ diff --git a/bacnet-stack/demo/dcc/makefile.b32 b/bacnet-stack/demo/dcc/makefile.b32 index 21db35d1..34066f6a 100644 --- a/bacnet-stack/demo/dcc/makefile.b32 +++ b/bacnet-stack/demo/dcc/makefile.b32 @@ -30,6 +30,7 @@ SRCS = main.c \ ..\..\demo\handler\s_whois.c \ ..\..\demo\handler\s_dcc.c \ ..\..\bacdcode.c \ + ..\..\bacint.c \ ..\..\bacapp.c \ ..\..\bacstr.c \ ..\..\bactext.c \ diff --git a/bacnet-stack/demo/epics/makefile.b32 b/bacnet-stack/demo/epics/makefile.b32 index cee684da..321440b1 100644 --- a/bacnet-stack/demo/epics/makefile.b32 +++ b/bacnet-stack/demo/epics/makefile.b32 @@ -30,6 +30,7 @@ SRCS = main.c \ ..\..\demo\handler\h_rp.c \ ..\..\demo\handler\s_rp.c \ ..\..\demo\handler\s_whois.c \ + ..\..\bacint.c \ ..\..\bacdcode.c \ ..\..\bacapp.c \ ..\..\bacstr.c \ diff --git a/bacnet-stack/demo/object/ai.mak b/bacnet-stack/demo/object/ai.mak index 9866ae94..122df9a0 100755 --- a/bacnet-stack/demo/object/ai.mak +++ b/bacnet-stack/demo/object/ai.mak @@ -8,6 +8,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_ANALOG_INPUT -g # NOTE: this file is normally called by the unittest.sh from up directory SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ demo/object/ai.c \ diff --git a/bacnet-stack/demo/object/ao.mak b/bacnet-stack/demo/object/ao.mak index 31f8b0a4..151ed300 100755 --- a/bacnet-stack/demo/object/ao.mak +++ b/bacnet-stack/demo/object/ao.mak @@ -8,6 +8,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_ANALOG_OUTPUT -g # NOTE: this file is normally called by the unittest.sh from up directory SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ datetime.c \ bacapp.c \ diff --git a/bacnet-stack/demo/object/av.mak b/bacnet-stack/demo/object/av.mak index 42149754..172ad3aa 100644 --- a/bacnet-stack/demo/object/av.mak +++ b/bacnet-stack/demo/object/av.mak @@ -8,6 +8,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_ANALOG_VALUE -g # NOTE: this file is normally called by the unittest.sh from up directory SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ datetime.c \ bacapp.c \ diff --git a/bacnet-stack/demo/object/bi.mak b/bacnet-stack/demo/object/bi.mak index 82b5d5b2..1b555e1e 100644 --- a/bacnet-stack/demo/object/bi.mak +++ b/bacnet-stack/demo/object/bi.mak @@ -8,6 +8,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_BINARY_INPUT -g # NOTE: this file is normally called by the unittest.sh from up directory SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ demo/object/bi.c \ diff --git a/bacnet-stack/demo/object/bo.mak b/bacnet-stack/demo/object/bo.mak index 5a484b89..3c272587 100755 --- a/bacnet-stack/demo/object/bo.mak +++ b/bacnet-stack/demo/object/bo.mak @@ -8,6 +8,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_BINARY_OUTPUT -g # NOTE: this file is normally called by the unittest.sh from up directory SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ datetime.c \ bacapp.c \ diff --git a/bacnet-stack/demo/object/bv.mak b/bacnet-stack/demo/object/bv.mak index 5f3b161b..97355b1b 100644 --- a/bacnet-stack/demo/object/bv.mak +++ b/bacnet-stack/demo/object/bv.mak @@ -8,6 +8,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_BINARY_VALUE -g # NOTE: this file is normally called by the unittest.sh from up directory SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ datetime.c \ bacapp.c \ diff --git a/bacnet-stack/demo/object/device.mak b/bacnet-stack/demo/object/device.mak index 6554d595..4093e038 100644 --- a/bacnet-stack/demo/object/device.mak +++ b/bacnet-stack/demo/object/device.mak @@ -9,6 +9,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_DEVICE -g # NOTE: this file is normally called by the unittest.sh from up directory SRCS = bacdcode.c \ datetime.c \ + bacint.c \ bacstr.c \ bacapp.c \ bactext.c \ diff --git a/bacnet-stack/demo/object/lc.mak b/bacnet-stack/demo/object/lc.mak index ee8b26f7..b9173849 100644 --- a/bacnet-stack/demo/object/lc.mak +++ b/bacnet-stack/demo/object/lc.mak @@ -8,6 +8,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_LOAD_CONTROL -g # NOTE: this file is normally called by the unittest.sh from up directory SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bacapp.c \ bactext.c \ diff --git a/bacnet-stack/demo/object/lo.mak b/bacnet-stack/demo/object/lo.mak index 95b5122c..a31f2b49 100755 --- a/bacnet-stack/demo/object/lo.mak +++ b/bacnet-stack/demo/object/lo.mak @@ -8,6 +8,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_LIGHTING_OUTPUT -g # NOTE: this file is normally called by the unittest.sh from up directory SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ datetime.c \ bacapp.c \ diff --git a/bacnet-stack/demo/object/lsp.mak b/bacnet-stack/demo/object/lsp.mak index 607d0b4a..0d599a54 100755 --- a/bacnet-stack/demo/object/lsp.mak +++ b/bacnet-stack/demo/object/lsp.mak @@ -8,6 +8,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_LIFE_SAFETY_POINT -g # NOTE: this file is normally called by the unittest.sh from up directory SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ datetime.c \ bacapp.c \ diff --git a/bacnet-stack/demo/object/mso.mak b/bacnet-stack/demo/object/mso.mak index c918c647..11c7fd78 100644 --- a/bacnet-stack/demo/object/mso.mak +++ b/bacnet-stack/demo/object/mso.mak @@ -8,6 +8,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_MULTISTATE_OUTPUT -g # NOTE: this file is normally called by the unittest.sh from up directory SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ datetime.c \ bacapp.c \ diff --git a/bacnet-stack/demo/readfile/makefile.b32 b/bacnet-stack/demo/readfile/makefile.b32 index 0c5caad3..307b3025 100644 --- a/bacnet-stack/demo/readfile/makefile.b32 +++ b/bacnet-stack/demo/readfile/makefile.b32 @@ -27,6 +27,7 @@ SRCS = main.c \ ..\..\demo\handler\s_arfs.c \ ..\..\demo\handler\h_rp.c \ ..\..\bacdcode.c \ + ..\..\bacint.c \ ..\..\bacapp.c \ ..\..\bacstr.c \ ..\..\bactext.c \ diff --git a/bacnet-stack/demo/readprop/makefile.b32 b/bacnet-stack/demo/readprop/makefile.b32 index a59bacbc..240b734e 100644 --- a/bacnet-stack/demo/readprop/makefile.b32 +++ b/bacnet-stack/demo/readprop/makefile.b32 @@ -30,6 +30,7 @@ SRCS = main.c \ ..\..\demo\handler\s_rp.c \ ..\..\demo\handler\s_whois.c \ ..\..\bacdcode.c \ + ..\..\bacint.c \ ..\..\bacapp.c \ ..\..\bacstr.c \ ..\..\datetime.c \ diff --git a/bacnet-stack/demo/reinit/makefile.b32 b/bacnet-stack/demo/reinit/makefile.b32 index b59837f8..faf67ae0 100644 --- a/bacnet-stack/demo/reinit/makefile.b32 +++ b/bacnet-stack/demo/reinit/makefile.b32 @@ -30,6 +30,7 @@ SRCS = main.c \ ..\..\demo\handler\s_whois.c \ ..\..\demo\handler\s_rd.c \ ..\..\bacdcode.c \ + ..\..\bacint.c \ ..\..\bacapp.c \ ..\..\bacstr.c \ ..\..\bactext.c \ diff --git a/bacnet-stack/demo/server/makefile.b32 b/bacnet-stack/demo/server/makefile.b32 index 5d8c27de..bdad0794 100644 --- a/bacnet-stack/demo/server/makefile.b32 +++ b/bacnet-stack/demo/server/makefile.b32 @@ -42,6 +42,7 @@ SRCS = main.c \ ..\..\demo\handler\h_whohas.c \ ..\..\demo\handler\s_ihave.c \ ..\..\bacdcode.c \ + ..\..\bacint.c \ ..\..\bacapp.c \ ..\..\bacstr.c \ ..\..\bactext.c \ diff --git a/bacnet-stack/demo/timesync/makefile.b32 b/bacnet-stack/demo/timesync/makefile.b32 index 0cd45a10..c60d7b9d 100644 --- a/bacnet-stack/demo/timesync/makefile.b32 +++ b/bacnet-stack/demo/timesync/makefile.b32 @@ -46,6 +46,7 @@ SRCS = main.c \ $(BACNET_ROOT)\address.c \ $(BACNET_ROOT)\filename.c \ $(BACNET_ROOT)\bacdcode.c \ + $(BACNET_ROOT)\bacint.c \ $(BACNET_ROOT)\bacapp.c \ $(BACNET_ROOT)\bacstr.c \ $(BACNET_ROOT)\bactext.c \ diff --git a/bacnet-stack/demo/ucov/makefile.b32 b/bacnet-stack/demo/ucov/makefile.b32 index da5c3b94..dc5b2429 100644 --- a/bacnet-stack/demo/ucov/makefile.b32 +++ b/bacnet-stack/demo/ucov/makefile.b32 @@ -27,6 +27,7 @@ SRCS = main.c \ ..\..\demo\handler\h_iam.c \ ..\..\demo\handler\h_rp.c \ ..\..\bacdcode.c \ + ..\..\bacint.c \ ..\..\bacapp.c \ ..\..\bacstr.c \ ..\..\bactext.c \ diff --git a/bacnet-stack/demo/whohas/makefile.b32 b/bacnet-stack/demo/whohas/makefile.b32 index 22b263ed..e0ff8157 100644 --- a/bacnet-stack/demo/whohas/makefile.b32 +++ b/bacnet-stack/demo/whohas/makefile.b32 @@ -30,6 +30,7 @@ SRCS = main.c \ ..\..\demo\handler\s_ihave.c \ ..\..\demo\handler\s_whohas.c \ ..\..\bacdcode.c \ + ..\..\bacint.c \ ..\..\bacapp.c \ ..\..\bacstr.c \ ..\..\bactext.c \ diff --git a/bacnet-stack/demo/whois/makefile.b32 b/bacnet-stack/demo/whois/makefile.b32 index 03b9a3af..c10c7fd5 100644 --- a/bacnet-stack/demo/whois/makefile.b32 +++ b/bacnet-stack/demo/whois/makefile.b32 @@ -45,6 +45,7 @@ SRCS = main.c \ $(BACNET_ROOT)\address.c \ $(BACNET_ROOT)\filename.c \ $(BACNET_ROOT)\bacdcode.c \ + $(BACNET_ROOT)\bacint.c \ $(BACNET_ROOT)\bacapp.c \ $(BACNET_ROOT)\bacstr.c \ $(BACNET_ROOT)\bactext.c \ diff --git a/bacnet-stack/demo/writefile/makefile.b32 b/bacnet-stack/demo/writefile/makefile.b32 index 7578dce5..26fa7ca6 100644 --- a/bacnet-stack/demo/writefile/makefile.b32 +++ b/bacnet-stack/demo/writefile/makefile.b32 @@ -27,6 +27,7 @@ SRCS = main.c \ ..\..\demo\handler\s_whois.c \ ..\..\demo\handler\s_awfs.c \ ..\..\bacdcode.c \ + ..\..\bacint.c \ ..\..\bacapp.c \ ..\..\bacstr.c \ ..\..\bactext.c \ diff --git a/bacnet-stack/demo/writeprop/makefile.b32 b/bacnet-stack/demo/writeprop/makefile.b32 index 02270b36..4ef466db 100644 --- a/bacnet-stack/demo/writeprop/makefile.b32 +++ b/bacnet-stack/demo/writeprop/makefile.b32 @@ -29,6 +29,7 @@ SRCS = main.c \ ..\..\demo\handler\s_wp.c \ ..\..\demo\handler\s_whois.c \ ..\..\bacdcode.c \ + ..\..\bacint.c \ ..\..\bacapp.c \ ..\..\bacstr.c \ ..\..\bactext.c \ diff --git a/bacnet-stack/iam.mak b/bacnet-stack/iam.mak index 0c801114..1e91c8a0 100755 --- a/bacnet-stack/iam.mak +++ b/bacnet-stack/iam.mak @@ -7,6 +7,7 @@ INCLUDES = -I. -Idemo/object -Itest CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ npdu.c \ diff --git a/bacnet-stack/ihave.mak b/bacnet-stack/ihave.mak index c28b0d9e..1441ccf5 100644 --- a/bacnet-stack/ihave.mak +++ b/bacnet-stack/ihave.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_I_HAVE -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ ihave.c \ diff --git a/bacnet-stack/npdu.c b/bacnet-stack/npdu.c index 7573e950..4e3823f8 100644 --- a/bacnet-stack/npdu.c +++ b/bacnet-stack/npdu.c @@ -35,6 +35,7 @@ #include #include "bacdef.h" #include "bacdcode.h" +#include "bacint.h" #include "bacenum.h" #include "bits.h" #include "npdu.h" diff --git a/bacnet-stack/npdu.mak b/bacnet-stack/npdu.mak index 1d180691..c691e2ed 100644 --- a/bacnet-stack/npdu.mak +++ b/bacnet-stack/npdu.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_NPDU -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ npdu.c \ diff --git a/bacnet-stack/rd.mak b/bacnet-stack/rd.mak index fda796ed..dd4bd3ac 100644 --- a/bacnet-stack/rd.mak +++ b/bacnet-stack/rd.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_REINITIALIZE_DEVICE -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ rd.c \ diff --git a/bacnet-stack/reject.mak b/bacnet-stack/reject.mak index 67955166..5e4f1a1d 100644 --- a/bacnet-stack/reject.mak +++ b/bacnet-stack/reject.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_REJECT -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ reject.c \ diff --git a/bacnet-stack/rp.mak b/bacnet-stack/rp.mak index 5a336e46..3085c12c 100644 --- a/bacnet-stack/rp.mak +++ b/bacnet-stack/rp.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -DTEST -DTEST_READ_PROPERTY -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ rp.c \ diff --git a/bacnet-stack/rpm.mak b/bacnet-stack/rpm.mak index 79cf9e45..fcee24da 100644 --- a/bacnet-stack/rpm.mak +++ b/bacnet-stack/rpm.mak @@ -11,6 +11,7 @@ SRCS = bacdcode.c \ bacapp.c \ bactext.c \ indtext.c \ + bacint.c \ bacstr.c \ datetime.c \ rpm.c \ diff --git a/bacnet-stack/timesync.mak b/bacnet-stack/timesync.mak index 1d32eac5..8ba24e85 100644 --- a/bacnet-stack/timesync.mak +++ b/bacnet-stack/timesync.mak @@ -8,6 +8,7 @@ CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_TIMESYNC -g SRCS = bacapp.c \ bacdcode.c \ + bacint.c \ bacstr.c \ bactext.c \ bigend.c \ diff --git a/bacnet-stack/tsm.mak b/bacnet-stack/tsm.mak index 398fb1f4..5e0565ed 100644 --- a/bacnet-stack/tsm.mak +++ b/bacnet-stack/tsm.mak @@ -7,6 +7,7 @@ CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g SRCS = address.c \ bacdcode.c \ + bacint.c \ bacstr.c \ datetime.c \ bacapp.c \ diff --git a/bacnet-stack/whohas.mak b/bacnet-stack/whohas.mak index c3a97055..94fdc40a 100644 --- a/bacnet-stack/whohas.mak +++ b/bacnet-stack/whohas.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_WHOHAS -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ whohas.c \ diff --git a/bacnet-stack/whois.mak b/bacnet-stack/whois.mak index 69f5bd2d..1da22991 100644 --- a/bacnet-stack/whois.mak +++ b/bacnet-stack/whois.mak @@ -7,6 +7,7 @@ BASEDIR = . CFLAGS = -Wall -I. -Itest -DBIG_ENDIAN=0 -DTEST -DTEST_WHOIS -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ bigend.c \ whois.c \ diff --git a/bacnet-stack/wp.mak b/bacnet-stack/wp.mak index d24428ac..83d479a5 100644 --- a/bacnet-stack/wp.mak +++ b/bacnet-stack/wp.mak @@ -7,6 +7,7 @@ INCLUDES = -I. -Idemo/object -Itest CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g SRCS = bacdcode.c \ + bacint.c \ bacstr.c \ datetime.c \ bacapp.c \