diff --git a/bacnet-stack/demo/dcc/main.c b/bacnet-stack/demo/dcc/main.c index cae07898..a108975c 100644 --- a/bacnet-stack/demo/dcc/main.c +++ b/bacnet-stack/demo/dcc/main.c @@ -217,7 +217,8 @@ static void Init_DataLink( if (bbmd_address) { struct in_addr addr; addr.s_addr = bbmd_address; - printf("DeviceCommunicationControl: Registering with BBMD at %s:%ld for %ld seconds\n", + printf + ("DeviceCommunicationControl: Registering with BBMD at %s:%ld for %ld seconds\n", inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds); bvlc_register_with_bbmd(bbmd_address, bbmd_port, bbmd_timetolive_seconds); diff --git a/bacnet-stack/demo/handler/h_cov.c b/bacnet-stack/demo/handler/h_cov.c index 502e12e0..c4806db7 100644 --- a/bacnet-stack/demo/handler/h_cov.c +++ b/bacnet-stack/demo/handler/h_cov.c @@ -236,7 +236,7 @@ static bool cov_list_subscribe( for (index = 0; index < MAX_COV_SUBCRIPTIONS; index++) { if (COV_Subscriptions[index].valid) { if ((COV_Subscriptions[index].monitoredObjectIdentifier.type == - cov_data->monitoredObjectIdentifier.type) && + cov_data->monitoredObjectIdentifier.type) && (COV_Subscriptions[index].monitoredObjectIdentifier.instance == cov_data->monitoredObjectIdentifier.instance) && (COV_Subscriptions[index].subscriberProcessIdentifier == diff --git a/bacnet-stack/demo/readfile/main.c b/bacnet-stack/demo/readfile/main.c index fa9b5970..fc7bd75b 100644 --- a/bacnet-stack/demo/readfile/main.c +++ b/bacnet-stack/demo/readfile/main.c @@ -272,7 +272,8 @@ static void Init_DataLink( if (bbmd_address) { struct in_addr addr; addr.s_addr = bbmd_address; - printf("AtomicReadFile: Registering with BBMD at %s:%ld for %ld seconds\n", + printf + ("AtomicReadFile: Registering with BBMD at %s:%ld for %ld seconds\n", inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds); bvlc_register_with_bbmd(bbmd_address, bbmd_port, bbmd_timetolive_seconds); diff --git a/bacnet-stack/demo/readprop/main.c b/bacnet-stack/demo/readprop/main.c index c39be295..3e22c659 100644 --- a/bacnet-stack/demo/readprop/main.c +++ b/bacnet-stack/demo/readprop/main.c @@ -208,7 +208,8 @@ static void Init_DataLink( if (bbmd_address) { struct in_addr addr; addr.s_addr = bbmd_address; - printf("ReadProperty: Registering with BBMD at %s:%ld for %ld seconds\n", + printf + ("ReadProperty: Registering with BBMD at %s:%ld for %ld seconds\n", inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds); bvlc_register_with_bbmd(bbmd_address, bbmd_port, bbmd_timetolive_seconds); @@ -231,10 +232,8 @@ int main(int argc, char *argv[]) { bool found = false; if (argc < 5) { - printf( - "Usage: %s device-instance object-type object-instance " - "property [index]\r\n", - filename_remove_path(argv[0])); + printf("Usage: %s device-instance object-type object-instance " + "property [index]\r\n", filename_remove_path(argv[0])); if ((argc > 1) && (strcmp(argv[1], "--help") == 0)) { printf("device-instance:\r\n" "BACnet Device Object Instance number that you are\r\n" @@ -267,8 +266,7 @@ int main(int argc, char *argv[]) { "%s 123 1 101 85\r\n" "If you want read the Priority-Array of Analog Output 101\r\n" "in Device 123, you could send the following command:\r\n" - "%s 123 1 101 87\r\n", - filename_remove_path(argv[0]), + "%s 123 1 101 87\r\n", filename_remove_path(argv[0]), filename_remove_path(argv[0])); } return 0; @@ -351,7 +349,7 @@ int main(int argc, char *argv[]) { fprintf(stderr, "\rError: TSM Timeout!\r\n"); tsm_free_invoke_id(invoke_id); Error_Detected = true; - /* try again or abort? */ + /* try again or abort? */ break; } } else { @@ -360,13 +358,14 @@ int main(int argc, char *argv[]) { if (elapsed_seconds > timeout_seconds) { printf("\rError: APDU Timeout!\r\n"); Error_Detected = true; - break; + break; } } /* keep track of time for next check */ last_seconds = current_seconds; } - if(Error_Detected) return 1; + if (Error_Detected) + return 1; return 0; } diff --git a/bacnet-stack/demo/reinit/main.c b/bacnet-stack/demo/reinit/main.c index 36821d01..ba1e6b18 100644 --- a/bacnet-stack/demo/reinit/main.c +++ b/bacnet-stack/demo/reinit/main.c @@ -212,7 +212,8 @@ static void Init_DataLink( if (bbmd_address) { struct in_addr addr; addr.s_addr = bbmd_address; - printf("ReinitDevice: Registering with BBMD at %s:%ld for %ld seconds\n", + printf + ("ReinitDevice: Registering with BBMD at %s:%ld for %ld seconds\n", inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds); bvlc_register_with_bbmd(bbmd_address, bbmd_port, bbmd_timetolive_seconds); diff --git a/bacnet-stack/demo/timesync/main.c b/bacnet-stack/demo/timesync/main.c index 7a0a8caa..e7b25f0b 100644 --- a/bacnet-stack/demo/timesync/main.c +++ b/bacnet-stack/demo/timesync/main.c @@ -181,7 +181,8 @@ static void Init_DataLink( if (bbmd_address) { struct in_addr addr; addr.s_addr = bbmd_address; - printf("TimeSync: Registering with BBMD at %s:%ld for %ld seconds\n", + printf + ("TimeSync: Registering with BBMD at %s:%ld for %ld seconds\n", inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds); bvlc_register_with_bbmd(bbmd_address, bbmd_port, bbmd_timetolive_seconds); diff --git a/bacnet-stack/demo/ucov/main.c b/bacnet-stack/demo/ucov/main.c index 0ca72995..f32d3cd4 100644 --- a/bacnet-stack/demo/ucov/main.c +++ b/bacnet-stack/demo/ucov/main.c @@ -142,7 +142,8 @@ static void Init_DataLink( if (bbmd_address) { struct in_addr addr; addr.s_addr = bbmd_address; - printf("UnconfirmedCOV: Registering with BBMD at %s:%ld for %ld seconds\n", + printf + ("UnconfirmedCOV: Registering with BBMD at %s:%ld for %ld seconds\n", inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds); bvlc_register_with_bbmd(bbmd_address, bbmd_port, bbmd_timetolive_seconds); @@ -211,8 +212,8 @@ int main(int argc, char *argv[]) { filename_remove_path(argv[0]), filename_remove_path(argv[0])); return 0; } - /* decode the command line parameters */ cov_data. - subscriberProcessIdentifier = strtol(argv[1], NULL, 0); + /* decode the command line parameters */ + cov_data.subscriberProcessIdentifier = strtol(argv[1], NULL, 0); cov_data.initiatingDeviceIdentifier = strtol(argv[2], NULL, 0); cov_data.monitoredObjectIdentifier.type = strtol(argv[3], NULL, 0); cov_data.monitoredObjectIdentifier.instance = strtol(argv[4], NULL, 0); diff --git a/bacnet-stack/demo/whois/main.c b/bacnet-stack/demo/whois/main.c index 2365b8b8..8a2d8314 100644 --- a/bacnet-stack/demo/whois/main.c +++ b/bacnet-stack/demo/whois/main.c @@ -238,15 +238,13 @@ int main(int argc, char *argv[]) { time_t timeout_seconds = 0; if (argc < 2) { - printf - ("Usage: %s device-instance | " + printf("Usage: %s device-instance | " "device-instance-min device-instance-max\r\n", filename_remove_path(argv[0])); return 0; } if ((argc > 1) && (strcmp(argv[1], "--help") == 0)) { - printf( - "Send BACnet WhoIs service request to a device or\r\n" + printf("Send BACnet WhoIs service request to a device or\r\n" "multiple devices, and wait for responses. Displays\r\n" "any devices found and their network information.\r\n" "\r\ndevice-instance:\r\n" @@ -254,17 +252,12 @@ int main(int argc, char *argv[]) { "send a Who-Is service request. The value should be in\r\n" "the range of 0 to 4194303. A range of values can also be\r\n" "specified by using a minimum value and a maximum value.\r\n" - "\r\nExample:\r\n" - "To send a WhoIs request to Device 123\r\n" - "use the following command:\r\n" - "%s 123\r\n" + "\r\nExample:\r\n" "To send a WhoIs request to Device 123\r\n" + "use the following command:\r\n" "%s 123\r\n" "To send a WhoIs request to Devices from 1000 to 9000:\r\n" - "%s 1000 9000\r\n" - "To send a WhoIs request to all devices\r\n" - "use the following command:\r\n" - "%s -1\r\n", - filename_remove_path(argv[0]), - filename_remove_path(argv[0]), + "%s 1000 9000\r\n" "To send a WhoIs request to all devices\r\n" + "use the following command:\r\n" "%s -1\r\n", + filename_remove_path(argv[0]), filename_remove_path(argv[0]), filename_remove_path(argv[0])); return 0; } diff --git a/bacnet-stack/demo/writefile/main.c b/bacnet-stack/demo/writefile/main.c index a2703602..54c835b0 100644 --- a/bacnet-stack/demo/writefile/main.c +++ b/bacnet-stack/demo/writefile/main.c @@ -226,7 +226,8 @@ static void Init_DataLink( if (bbmd_address) { struct in_addr addr; addr.s_addr = bbmd_address; - printf("AtomicWriteFile: Registering with BBMD at %s:%ld for %ld seconds\n", + printf + ("AtomicWriteFile: Registering with BBMD at %s:%ld for %ld seconds\n", inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds); bvlc_register_with_bbmd(bbmd_address, bbmd_port, bbmd_timetolive_seconds); diff --git a/bacnet-stack/demo/writeprop/main.c b/bacnet-stack/demo/writeprop/main.c index 217e650a..e503d66c 100644 --- a/bacnet-stack/demo/writeprop/main.c +++ b/bacnet-stack/demo/writeprop/main.c @@ -223,7 +223,8 @@ static void Init_DataLink( if (bbmd_address) { struct in_addr addr; addr.s_addr = bbmd_address; - printf("WriteProperty: Registering with BBMD at %s:%ld for %ld seconds\n", + printf + ("WriteProperty: Registering with BBMD at %s:%ld for %ld seconds\n", inet_ntoa(addr), bbmd_port, bbmd_timetolive_seconds); bvlc_register_with_bbmd(bbmd_address, bbmd_port, bbmd_timetolive_seconds); @@ -304,15 +305,13 @@ int main(int argc, char *argv[]) { "accepting REAL, BOOLEAN, NULL, etc. Perhaps it would be simpler for\r\n" "the demo to use this kind of table - but I also wanted to be able\r\n" "to do negative testing by passing the wrong tag and have the server\r\n" - "return a reject message.\r\n" - "\r\nExample:\r\n" + "return a reject message.\r\n" "\r\nExample:\r\n" "If you want send a value of 100 to the Present-Value in\r\n" "Analog Output 0 of Device 123 at priority 16,\r\n" "send the following command:\r\n" "%s 123 1 0 85 16 -1 4 100\r\n" "To send a relinquish command to the same object:\r\n" - "%s 123 1 0 85 16 -1 0 0\r\n", - filename_remove_path(argv[0]), + "%s 123 1 0 85 16 -1 0 0\r\n", filename_remove_path(argv[0]), filename_remove_path(argv[0])); } return 0; @@ -392,7 +391,7 @@ int main(int argc, char *argv[]) { } } if (args_remaining > 0) { - fprintf(stderr, "Error: Exceeded %d tag-value pairs.\r\n", + fprintf(stderr, "Error: Exceeded %d tag-value pairs.\r\n", MAX_PROPERTY_VALUES); return 1; } @@ -448,7 +447,7 @@ int main(int argc, char *argv[]) { fprintf(stderr, "\rError: TSM Timeout!\r\n"); tsm_free_invoke_id(invoke_id); Error_Detected = true; - /* try again or abort? */ + /* try again or abort? */ break; } } else { @@ -463,6 +462,7 @@ int main(int argc, char *argv[]) { /* keep track of time for next check */ last_seconds = current_seconds; } - if(Error_Detected) return 1; + if (Error_Detected) + return 1; return 0; } diff --git a/bacnet-stack/include/bacenum.h b/bacnet-stack/include/bacenum.h index 869a129d..fcb5067d 100644 --- a/bacnet-stack/include/bacenum.h +++ b/bacnet-stack/include/bacenum.h @@ -375,12 +375,12 @@ typedef enum { /* enumerations 324-325 are used in Addendum i to ANSI/ASHRAE 135-2004 */ PROP_BINARY_ACTIVE_VALUE = 324, PROP_BINARY_INACTIVE_VALUE = 325 - /* The special property identifiers all, optional, and required */ - /* are reserved for use in the ReadPropertyConditional and */ - /* ReadPropertyMultiple services or services not defined in this standard. */ - /* Enumerated values 0-511 are reserved for definition by ASHRAE. */ - /* Enumerated values 512-4194303 may be used by others subject to the */ - /* procedures and constraints described in Clause 23. */ + /* The special property identifiers all, optional, and required */ + /* are reserved for use in the ReadPropertyConditional and */ + /* ReadPropertyMultiple services or services not defined in this standard. */ + /* Enumerated values 0-511 are reserved for definition by ASHRAE. */ + /* Enumerated values 512-4194303 may be used by others subject to the */ + /* procedures and constraints described in Clause 23. */ } BACNET_PROPERTY_ID; /* do the MAX as define rather than enumeration for devices and compilers that want to use smaller datatype for enum */ @@ -897,13 +897,13 @@ typedef enum { OBJECT_ACCESS_USER = 35, OBJECT_ACCESS_ZONE = 36, OBJECT_AUTHENTICATION_FACTOR_INPUT = 37, - + /* Enumerated values 0-127 are reserved for definition by ASHRAE. */ /* Enumerated values 128-1023 may be used by others subject to */ /* the procedures and constraints described in Clause 23. */ - + /* used for bit string loop */ - MAX_ASHRAE_OBJECT_TYPE = 38, + MAX_ASHRAE_OBJECT_TYPE = 38, MAX_BACNET_OBJECT_TYPE = 1023 } BACNET_OBJECT_TYPE; @@ -1328,7 +1328,7 @@ typedef enum { ERROR_CODE_ABORT_BUFFER_OVERFLOW = 51, ERROR_CODE_ABORT_INVALID_APDU_IN_THIS_STATE = 52, ERROR_CODE_ABORT_PREEMPTED_BY_HIGHER_PRIORITY_TASK = 53, - ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED = 54, + ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED = 54, ERROR_CODE_ABORT_PROPRIETARY = 55, ERROR_CODE_ABORT_OTHER = 56, ERROR_CODE_INVALID_TAG = 57, diff --git a/bacnet-stack/include/debug.h b/bacnet-stack/include/debug.h index 19d86b30..3e3ef714 100644 --- a/bacnet-stack/include/debug.h +++ b/bacnet-stack/include/debug.h @@ -1,48 +1,54 @@ -/*####COPYRIGHTBEGIN#### - ------------------------------------------- - Copyright (C) 2008 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 DEBUG_H -#define DEBUG_H - -#include -#include -#include -#include "bacdef.h" - -#if DEBUG_ENABLED -void debug_printf(const char * format, ...); -#else -static void debug_printf(const char * format, ...) {} -#endif - -#endif +/*####COPYRIGHTBEGIN#### + ------------------------------------------- + Copyright (C) 2008 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 DEBUG_H +#define DEBUG_H + +#include +#include +#include +#include "bacdef.h" + +#if DEBUG_ENABLED +void debug_printf( + const char *format, + ...); +#else +static void debug_printf( + const char *format, + ...) +{ +} +#endif + +#endif diff --git a/bacnet-stack/src/bactext.c b/bacnet-stack/src/bactext.c index c378b234..b4a7a32e 100644 --- a/bacnet-stack/src/bactext.c +++ b/bacnet-stack/src/bactext.c @@ -638,137 +638,272 @@ INDTEXT_DATA bacnet_property_names[] = { , {PROP_VALUE_CHANGE_TIME, "value-change-time"} , - {PROP_ALIGN_INTERVALS,"align-intervals"}, - {PROP_GROUP_MEMBER_NAMES,"group-member-names"}, - {PROP_INTERVAL_OFFSET,"interval-offset"}, - {PROP_LAST_RESTART_REASON,"last-restart-reason"}, - {PROP_LOGGING_TYPE,"logging-type"}, - {PROP_MEMBER_STATUS_FLAGS,"member-status-flags"}, - {PROP_NOTIFICATION_PERIOD,"notification-period"}, - {PROP_REQUESTED_UPDATE_INTERVAL,"requested-update-interval"}, - {PROP_RESTART_NOTIFICATION_RECIPIENTS,"restart-notification-recipients"}, - {PROP_TIME_OF_DEVICE_RESTART,"time-of-device-restart"}, - {PROP_TIME_SYNCHRONIZATION_INTERVAL,"time-synchronization-interval"}, - {PROP_TRIGGER,"trigger"}, - {PROP_UTC_TIME_SYNCHRONIZATION_RECIPIENTS,"utc-time-synchronization-recipients"}, - {PROP_NODE_SUBTYPE,"node-subtype"}, - {PROP_NODE_TYPE,"node-type"}, - {PROP_STRUCTURED_OBJECT_LIST,"structured-object-list"}, - {PROP_SUBORDINATE_ANNOTATIONS,"subordinate-annotations"}, - {PROP_SUBORDINATE_LIST,"subordinate-list"}, - {PROP_ACTUAL_SHED_LEVEL,"actual-shed-level"}, - {PROP_DUTY_WINDOW,"duty-window"}, - {PROP_EXPECTED_SHED_LEVEL,"expected-shed-level"}, - {PROP_FULL_DUTY_BASELINE,"full-duty-baseline"}, - {PROP_BLINK_PRIORITY_THRESHOLD,"blink-priority-threshold"}, - {PROP_BLINK_TIME,"blink-time"}, - {PROP_REQUESTED_SHED_LEVEL,"requested-shed-level"}, - {PROP_SHED_DURATION,"shed-duration"}, - {PROP_SHED_LEVEL_DESCRIPTIONS,"shed-level-descriptions"}, - {PROP_SHED_LEVELS,"shed-levels"}, - {PROP_STATE_DESCRIPTION,"state-description"}, - {PROP_FADE_TIME,"fade-time"}, - {PROP_LIGHTING_COMMAND,"lighting-command"}, - {PROP_LIGHTING_COMMAND_PRIORITY,"lighting-command-priority"}, - {PROP_DOOR_ALARM_STATE,"door-alarm-state"}, - {PROP_DOOR_EXTENDED_PULSE_TIME,"door-extended-pulse-time"}, - {PROP_DOOR_MEMBERS,"door-members"}, - {PROP_DOOR_OPEN_TOO_LONG_TIME,"door-open-too-long-time"}, - {PROP_DOOR_PULSE_TIME,"door-pulse-time"}, - {PROP_DOOR_STATUS,"door-status"}, - {PROP_DOOR_UNLOCK_DELAY_TIME,"door-unlock-delay-time"}, - {PROP_LOCK_STATUS,"lock-status"}, - {PROP_MASKED_ALARM_VALUES,"masked-alarm-values"}, - {PROP_SECURED_STATUS,"secured-status"}, - {PROP_OFF_DELAY,"off-delay"}, - {PROP_ON_DELAY,"on-delay"}, - {PROP_POWER,"power"}, - {PROP_POWER_ON_VALUE,"power-on-value"}, - {PROP_PROGRESS_VALUE,"progress-value"}, - {PROP_RAMP_RATE,"ramp-rate"}, - {PROP_STEP_INCREMENT,"step-increment"}, - {PROP_SYSTEM_FAILURE_VALUE,"system-failure-value"}, - {PROP_ABSENTEE_LIMIT,"absentee-limit"}, - {PROP_ACCESS_ALARM_EVENTS,"access-alarm-events"}, - {PROP_ACCESS_DOORS,"access-doors"}, - {PROP_ACCESS_EVENT,"access-event"}, - {PROP_ACCESS_EVENT_AUTHENTICATION_FACTOR,"access-event-authentication-factor"}, - {PROP_ACCESS_EVENT_CREDENTIAL,"access-event-credential"}, - {PROP_ACCESS_EVENT_TIME,"access-event-time"}, - {PROP_ACCESS_RULES,"access-rules"}, - {PROP_ACCESS_RULES_ENABLE,"access-rules-enable"}, - {PROP_ACCESS_TRANSACTION_EVENTS,"access-transaction-events"}, - {PROP_ACCOMPANIED,"accompanied"}, - {PROP_ACTIVATION_TIME,"activation-time"}, - {PROP_ACTIVE_AUTHENTICATION_POLICY,"active-authentication-policy"}, - {PROP_ASSIGNED_ACCESS_RIGHTS,"assigned-access-rights"}, - {PROP_AUTHENTICATION_FACTOR_INPUT_LIST,"authentication-factor-input-list"}, - {PROP_AUTHENTICATION_FACTORS,"authentication-factors"}, - {PROP_AUTHENTICATION_POLICY_LIST,"authentication-policy-list"}, - {PROP_AUTHENTICATION_POLICY_NAMES,"authentication-policy-names"}, - {PROP_AUTHORIZATION_MODE,"authorization-mode"}, - {PROP_BELONGS_TO,"belongs-to"}, - {PROP_CREDENTIAL_DISABLE,"credential-disable"}, - {PROP_CREDENTIAL_STATUS,"credential-status"}, - {PROP_CREDENTIALS,"credentials"}, - {PROP_CREDENTIALS_IN_ZONE,"credentials-in-zone"}, - {PROP_DAYS_REMAINING,"days-remaining"}, - {PROP_ENTRY_POINTS,"entry-points"}, - {PROP_EXIT_POINTS,"exit-points"}, - {PROP_EXPIRY_TIME,"expiry-time"}, - {PROP_EXTENDED_TIME_ENABLE,"extended-time-enable"}, - {PROP_FAILED_ATTEMPT_EVENTS,"failed-attempt-events"}, - {PROP_FAILED_ATTEMPTS,"failed-attempts"}, - {PROP_FAILED_ATTEMPTS_TIME,"failed-attempts-time"}, - {PROP_FORMAT_CLASS_SUPPORTED,"format-class-supported"}, - {PROP_FORMAT_TYPE,"format-type"}, - {PROP_LAST_ACCESS_EVENT,"last-access-event"}, - {PROP_LAST_ACCESS_POINT,"last-access-point"}, - {PROP_LAST_CREDENTIAL_ADDED,"last-credential-added"}, - {PROP_LAST_CREDENTIAL_ADDED_TIME,"last-credential-added-time"}, - {PROP_LAST_CREDENTIAL_REMOVED,"last-credential-removed"}, - {PROP_LAST_CREDENTIAL_REMOVED_TIME,"last-credential-removed-time"}, - {PROP_LAST_USE_TIME,"last-use-time"}, - {PROP_LOCKDOWN,"lockdown"}, - {PROP_LOCKDOWN_RELINQUISH_TIME,"lockdown-relinquish-time"}, - {PROP_MASTER_EXEMPTION,"master-exemption"}, - {PROP_MAX_FAILED_ATTEMPTS,"max-failed-attempts"}, - {PROP_MEMBERS,"members"}, - {PROP_MASTER_POINT,"muster-point"}, - {PROP_NUMBER_OF_AUTHENTICATION_POLICIES,"number-of-authentication-policies"}, - {PROP_OCCUPANCY_COUNT,"occupancy-count"}, - {PROP_OCCUPANCY_COUNT_ENABLE,"occupancy-count-enable"}, - {PROP_OCCUPANCY_COUNT_EXEMPTION,"occupancy-count-exemption"}, - {PROP_OCCUPANCY_LOWER_THRESHOLD,"occupancy-lower-threshold"}, - {PROP_OCCUPANCY_LOWER_THRESHOLD_ENFORCED,"occupancy-lower-threshold-enforced"}, - {PROP_OCCUPANCY_STATE,"occupancy-state"}, - {PROP_OCCUPANCY_UPPER_LIMIT,"occupancy-upper-limit"}, - {PROP_OCCUPANCY_UPPER_LIMIT_ENFORCED,"occupancy-upper-limit-enforced"}, - {PROP_PASSBACK_EXEMPTION,"passback-exemption"}, - {PROP_PASSBACK_MODE,"passback-mode"}, - {PROP_PASSBACK_TIMEOUT,"passback-timeout"}, - {PROP_POSITIVE_ACCESS_RULES,"positive-access-rules"}, - {PROP_READ_STATUS,"read-status"}, - {PROP_REASON_FOR_DISABLE,"reason-for-disable"}, - {PROP_THREAT_AUTHORITY,"threat-authority"}, - {PROP_THREAT_LEVEL,"threat-level"}, - {PROP_TRACE_FLAG,"trace-flag"}, - {PROP_TRANSACTION_NOTIFICATION_CLASS,"transaction-notification-class"}, - {PROP_USER_EXTERNAL_IDENTIFIER,"user-external-identifier"}, - {PROP_CHARACTER_SET,"character-set"}, - {PROP_STRICT_CHARACTER_MODE,"strict-character-mode"}, - {PROP_BACKUP_AND_RESTORE_STATE,"backup-and-restore-state"}, - {PROP_BACKUP_PREPARATION_TIME,"backup-preparation-time"}, - {PROP_RESTORE_PREPARATION_TIME,"restore-preparation-time"}, - {PROP_USER_INFORMATION_REFERENCE,"user-information-reference"}, - {PROP_USER_NAME,"user-name"}, - {PROP_USER_TYPE,"user-type"}, - {PROP_USES_REMAINING,"uses-remaining"}, - {PROP_VENDOR_FORMAT_IDENTIFIER,"vendor-format-identifier"}, - {PROP_ZONE_FROM,"zone-from"}, - {PROP_ZONE_TO,"zone-to"}, - {PROP_BINARY_ACTIVE_VALUE,"binary-active-value"}, - {PROP_BINARY_INACTIVE_VALUE,"binary-inactive-value"}, + {PROP_ALIGN_INTERVALS, "align-intervals"} + , + {PROP_GROUP_MEMBER_NAMES, "group-member-names"} + , + {PROP_INTERVAL_OFFSET, "interval-offset"} + , + {PROP_LAST_RESTART_REASON, "last-restart-reason"} + , + {PROP_LOGGING_TYPE, "logging-type"} + , + {PROP_MEMBER_STATUS_FLAGS, "member-status-flags"} + , + {PROP_NOTIFICATION_PERIOD, "notification-period"} + , + {PROP_REQUESTED_UPDATE_INTERVAL, "requested-update-interval"} + , + {PROP_RESTART_NOTIFICATION_RECIPIENTS, "restart-notification-recipients"} + , + {PROP_TIME_OF_DEVICE_RESTART, "time-of-device-restart"} + , + {PROP_TIME_SYNCHRONIZATION_INTERVAL, "time-synchronization-interval"} + , + {PROP_TRIGGER, "trigger"} + , + {PROP_UTC_TIME_SYNCHRONIZATION_RECIPIENTS, + "utc-time-synchronization-recipients"} + , + {PROP_NODE_SUBTYPE, "node-subtype"} + , + {PROP_NODE_TYPE, "node-type"} + , + {PROP_STRUCTURED_OBJECT_LIST, "structured-object-list"} + , + {PROP_SUBORDINATE_ANNOTATIONS, "subordinate-annotations"} + , + {PROP_SUBORDINATE_LIST, "subordinate-list"} + , + {PROP_ACTUAL_SHED_LEVEL, "actual-shed-level"} + , + {PROP_DUTY_WINDOW, "duty-window"} + , + {PROP_EXPECTED_SHED_LEVEL, "expected-shed-level"} + , + {PROP_FULL_DUTY_BASELINE, "full-duty-baseline"} + , + {PROP_BLINK_PRIORITY_THRESHOLD, "blink-priority-threshold"} + , + {PROP_BLINK_TIME, "blink-time"} + , + {PROP_REQUESTED_SHED_LEVEL, "requested-shed-level"} + , + {PROP_SHED_DURATION, "shed-duration"} + , + {PROP_SHED_LEVEL_DESCRIPTIONS, "shed-level-descriptions"} + , + {PROP_SHED_LEVELS, "shed-levels"} + , + {PROP_STATE_DESCRIPTION, "state-description"} + , + {PROP_FADE_TIME, "fade-time"} + , + {PROP_LIGHTING_COMMAND, "lighting-command"} + , + {PROP_LIGHTING_COMMAND_PRIORITY, "lighting-command-priority"} + , + {PROP_DOOR_ALARM_STATE, "door-alarm-state"} + , + {PROP_DOOR_EXTENDED_PULSE_TIME, "door-extended-pulse-time"} + , + {PROP_DOOR_MEMBERS, "door-members"} + , + {PROP_DOOR_OPEN_TOO_LONG_TIME, "door-open-too-long-time"} + , + {PROP_DOOR_PULSE_TIME, "door-pulse-time"} + , + {PROP_DOOR_STATUS, "door-status"} + , + {PROP_DOOR_UNLOCK_DELAY_TIME, "door-unlock-delay-time"} + , + {PROP_LOCK_STATUS, "lock-status"} + , + {PROP_MASKED_ALARM_VALUES, "masked-alarm-values"} + , + {PROP_SECURED_STATUS, "secured-status"} + , + {PROP_OFF_DELAY, "off-delay"} + , + {PROP_ON_DELAY, "on-delay"} + , + {PROP_POWER, "power"} + , + {PROP_POWER_ON_VALUE, "power-on-value"} + , + {PROP_PROGRESS_VALUE, "progress-value"} + , + {PROP_RAMP_RATE, "ramp-rate"} + , + {PROP_STEP_INCREMENT, "step-increment"} + , + {PROP_SYSTEM_FAILURE_VALUE, "system-failure-value"} + , + {PROP_ABSENTEE_LIMIT, "absentee-limit"} + , + {PROP_ACCESS_ALARM_EVENTS, "access-alarm-events"} + , + {PROP_ACCESS_DOORS, "access-doors"} + , + {PROP_ACCESS_EVENT, "access-event"} + , + {PROP_ACCESS_EVENT_AUTHENTICATION_FACTOR, + "access-event-authentication-factor"} + , + {PROP_ACCESS_EVENT_CREDENTIAL, "access-event-credential"} + , + {PROP_ACCESS_EVENT_TIME, "access-event-time"} + , + {PROP_ACCESS_RULES, "access-rules"} + , + {PROP_ACCESS_RULES_ENABLE, "access-rules-enable"} + , + {PROP_ACCESS_TRANSACTION_EVENTS, "access-transaction-events"} + , + {PROP_ACCOMPANIED, "accompanied"} + , + {PROP_ACTIVATION_TIME, "activation-time"} + , + {PROP_ACTIVE_AUTHENTICATION_POLICY, "active-authentication-policy"} + , + {PROP_ASSIGNED_ACCESS_RIGHTS, "assigned-access-rights"} + , + {PROP_AUTHENTICATION_FACTOR_INPUT_LIST, "authentication-factor-input-list"} + , + {PROP_AUTHENTICATION_FACTORS, "authentication-factors"} + , + {PROP_AUTHENTICATION_POLICY_LIST, "authentication-policy-list"} + , + {PROP_AUTHENTICATION_POLICY_NAMES, "authentication-policy-names"} + , + {PROP_AUTHORIZATION_MODE, "authorization-mode"} + , + {PROP_BELONGS_TO, "belongs-to"} + , + {PROP_CREDENTIAL_DISABLE, "credential-disable"} + , + {PROP_CREDENTIAL_STATUS, "credential-status"} + , + {PROP_CREDENTIALS, "credentials"} + , + {PROP_CREDENTIALS_IN_ZONE, "credentials-in-zone"} + , + {PROP_DAYS_REMAINING, "days-remaining"} + , + {PROP_ENTRY_POINTS, "entry-points"} + , + {PROP_EXIT_POINTS, "exit-points"} + , + {PROP_EXPIRY_TIME, "expiry-time"} + , + {PROP_EXTENDED_TIME_ENABLE, "extended-time-enable"} + , + {PROP_FAILED_ATTEMPT_EVENTS, "failed-attempt-events"} + , + {PROP_FAILED_ATTEMPTS, "failed-attempts"} + , + {PROP_FAILED_ATTEMPTS_TIME, "failed-attempts-time"} + , + {PROP_FORMAT_CLASS_SUPPORTED, "format-class-supported"} + , + {PROP_FORMAT_TYPE, "format-type"} + , + {PROP_LAST_ACCESS_EVENT, "last-access-event"} + , + {PROP_LAST_ACCESS_POINT, "last-access-point"} + , + {PROP_LAST_CREDENTIAL_ADDED, "last-credential-added"} + , + {PROP_LAST_CREDENTIAL_ADDED_TIME, "last-credential-added-time"} + , + {PROP_LAST_CREDENTIAL_REMOVED, "last-credential-removed"} + , + {PROP_LAST_CREDENTIAL_REMOVED_TIME, "last-credential-removed-time"} + , + {PROP_LAST_USE_TIME, "last-use-time"} + , + {PROP_LOCKDOWN, "lockdown"} + , + {PROP_LOCKDOWN_RELINQUISH_TIME, "lockdown-relinquish-time"} + , + {PROP_MASTER_EXEMPTION, "master-exemption"} + , + {PROP_MAX_FAILED_ATTEMPTS, "max-failed-attempts"} + , + {PROP_MEMBERS, "members"} + , + {PROP_MASTER_POINT, "muster-point"} + , + {PROP_NUMBER_OF_AUTHENTICATION_POLICIES, + "number-of-authentication-policies"} + , + {PROP_OCCUPANCY_COUNT, "occupancy-count"} + , + {PROP_OCCUPANCY_COUNT_ENABLE, "occupancy-count-enable"} + , + {PROP_OCCUPANCY_COUNT_EXEMPTION, "occupancy-count-exemption"} + , + {PROP_OCCUPANCY_LOWER_THRESHOLD, "occupancy-lower-threshold"} + , + {PROP_OCCUPANCY_LOWER_THRESHOLD_ENFORCED, + "occupancy-lower-threshold-enforced"} + , + {PROP_OCCUPANCY_STATE, "occupancy-state"} + , + {PROP_OCCUPANCY_UPPER_LIMIT, "occupancy-upper-limit"} + , + {PROP_OCCUPANCY_UPPER_LIMIT_ENFORCED, "occupancy-upper-limit-enforced"} + , + {PROP_PASSBACK_EXEMPTION, "passback-exemption"} + , + {PROP_PASSBACK_MODE, "passback-mode"} + , + {PROP_PASSBACK_TIMEOUT, "passback-timeout"} + , + {PROP_POSITIVE_ACCESS_RULES, "positive-access-rules"} + , + {PROP_READ_STATUS, "read-status"} + , + {PROP_REASON_FOR_DISABLE, "reason-for-disable"} + , + {PROP_THREAT_AUTHORITY, "threat-authority"} + , + {PROP_THREAT_LEVEL, "threat-level"} + , + {PROP_TRACE_FLAG, "trace-flag"} + , + {PROP_TRANSACTION_NOTIFICATION_CLASS, "transaction-notification-class"} + , + {PROP_USER_EXTERNAL_IDENTIFIER, "user-external-identifier"} + , + {PROP_CHARACTER_SET, "character-set"} + , + {PROP_STRICT_CHARACTER_MODE, "strict-character-mode"} + , + {PROP_BACKUP_AND_RESTORE_STATE, "backup-and-restore-state"} + , + {PROP_BACKUP_PREPARATION_TIME, "backup-preparation-time"} + , + {PROP_RESTORE_PREPARATION_TIME, "restore-preparation-time"} + , + {PROP_USER_INFORMATION_REFERENCE, "user-information-reference"} + , + {PROP_USER_NAME, "user-name"} + , + {PROP_USER_TYPE, "user-type"} + , + {PROP_USES_REMAINING, "uses-remaining"} + , + {PROP_VENDOR_FORMAT_IDENTIFIER, "vendor-format-identifier"} + , + {PROP_ZONE_FROM, "zone-from"} + , + {PROP_ZONE_TO, "zone-to"} + , + {PROP_BINARY_ACTIVE_VALUE, "binary-active-value"} + , + {PROP_BINARY_INACTIVE_VALUE, "binary-inactive-value"} + , {0, NULL} /* Enumerated values 0-511 are reserved for definition by ASHRAE. Enumerated values 512-4194303 may be used by others subject to the @@ -1384,39 +1519,79 @@ INDTEXT_DATA bacnet_error_code_names[] = { , {ERROR_CODE_NOT_COV_PROPERTY, "not-cov-property"} , - {ERROR_CODE_ABORT_BUFFER_OVERFLOW, "abort-buffer-overflow"}, - {ERROR_CODE_ABORT_INVALID_APDU_IN_THIS_STATE, "abort-invalid-apdu-in-this-state"}, - {ERROR_CODE_ABORT_PREEMPTED_BY_HIGHER_PRIORITY_TASK, "abort-preempted-by-higher-priority-task"}, - {ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED, "abort-segmentation-not-supported"}, - {ERROR_CODE_ABORT_PROPRIETARY, "abort-proprietary"}, - {ERROR_CODE_ABORT_OTHER, "abort-other"}, - {ERROR_CODE_INVALID_TAG, "invalid-tag"}, - {ERROR_CODE_NETWORK_DOWN, "network-down"}, - {ERROR_CODE_REJECT_BUFFER_OVERFLOW, "reject-buffer-overflow"}, - {ERROR_CODE_REJECT_INCONSISTENT_PARAMETERS, "reject-inconsistent-parameters"}, - {ERROR_CODE_REJECT_INVALID_PARAMETER_DATA_TYPE, "reject-invalid-parameter-data-type"}, - {ERROR_CODE_REJECT_INVALID_TAG, "reject-invalid-tag"}, - {ERROR_CODE_REJECT_MISSING_REQUIRED_PARAMETER, "reject-missing-required-parameter"}, - {ERROR_CODE_REJECT_PARAMETER_OUT_OF_RANGE, "reject-parameter-out-of-range"}, - {ERROR_CODE_REJECT_TOO_MANY_ARGUMENTS, "reject-too-many-arguments"}, - {ERROR_CODE_REJECT_UNDEFINED_ENUMERATION, "reject-undefined-enumeration"}, - {ERROR_CODE_REJECT_UNRECOGNIZED_SERVICE, "reject-unrecognized-service"}, - {ERROR_CODE_REJECT_PROPRIETARY, "reject-proprietary"}, - {ERROR_CODE_REJECT_OTHER, "reject-other"}, - {ERROR_CODE_UNKNOWN_DEVICE, "unknown-device"}, - {ERROR_CODE_UNKNOWN_ROUTE, "unknown-route"}, - {ERROR_CODE_VALUE_NOT_INITIALIZED, "value-not-initialized"}, - {ERROR_CODE_INVALID_EVENT_STATE, "invalid-event-state"}, - {ERROR_CODE_NO_ALARM_CONFIGURED, "no-alarm-configured"}, - {ERROR_CODE_LOG_BUFFER_FULL, "log-buffer-full"}, - {ERROR_CODE_LOGGED_VALUE_PURGED, "logged-value-purged"}, - {ERROR_CODE_NO_PROPERTY_SPECIFIED, "no-property-specified"}, - {ERROR_CODE_NOT_CONFIGURED_FOR_TRIGGERED_LOGGING, "not-configured-for-triggered-logging"}, - {ERROR_CODE_UNKNOWN_SUBSCRIPTION, "unknown-subscription"}, - {ERROR_CODE_PARAMETER_OUT_OF_RANGE, "parameter-out-of-range"}, - {ERROR_CODE_UNKNOWN_FILE_SIZE, "unknown-file-size"}, - {ERROR_CODE_BUSY, "busy"}, - {ERROR_CODE_COMMUNICATION_DISABLED, "communication-disabled"}, + {ERROR_CODE_ABORT_BUFFER_OVERFLOW, "abort-buffer-overflow"} + , + {ERROR_CODE_ABORT_INVALID_APDU_IN_THIS_STATE, + "abort-invalid-apdu-in-this-state"} + , + {ERROR_CODE_ABORT_PREEMPTED_BY_HIGHER_PRIORITY_TASK, + "abort-preempted-by-higher-priority-task"} + , + {ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED, + "abort-segmentation-not-supported"} + , + {ERROR_CODE_ABORT_PROPRIETARY, "abort-proprietary"} + , + {ERROR_CODE_ABORT_OTHER, "abort-other"} + , + {ERROR_CODE_INVALID_TAG, "invalid-tag"} + , + {ERROR_CODE_NETWORK_DOWN, "network-down"} + , + {ERROR_CODE_REJECT_BUFFER_OVERFLOW, "reject-buffer-overflow"} + , + {ERROR_CODE_REJECT_INCONSISTENT_PARAMETERS, + "reject-inconsistent-parameters"} + , + {ERROR_CODE_REJECT_INVALID_PARAMETER_DATA_TYPE, + "reject-invalid-parameter-data-type"} + , + {ERROR_CODE_REJECT_INVALID_TAG, "reject-invalid-tag"} + , + {ERROR_CODE_REJECT_MISSING_REQUIRED_PARAMETER, + "reject-missing-required-parameter"} + , + {ERROR_CODE_REJECT_PARAMETER_OUT_OF_RANGE, "reject-parameter-out-of-range"} + , + {ERROR_CODE_REJECT_TOO_MANY_ARGUMENTS, "reject-too-many-arguments"} + , + {ERROR_CODE_REJECT_UNDEFINED_ENUMERATION, "reject-undefined-enumeration"} + , + {ERROR_CODE_REJECT_UNRECOGNIZED_SERVICE, "reject-unrecognized-service"} + , + {ERROR_CODE_REJECT_PROPRIETARY, "reject-proprietary"} + , + {ERROR_CODE_REJECT_OTHER, "reject-other"} + , + {ERROR_CODE_UNKNOWN_DEVICE, "unknown-device"} + , + {ERROR_CODE_UNKNOWN_ROUTE, "unknown-route"} + , + {ERROR_CODE_VALUE_NOT_INITIALIZED, "value-not-initialized"} + , + {ERROR_CODE_INVALID_EVENT_STATE, "invalid-event-state"} + , + {ERROR_CODE_NO_ALARM_CONFIGURED, "no-alarm-configured"} + , + {ERROR_CODE_LOG_BUFFER_FULL, "log-buffer-full"} + , + {ERROR_CODE_LOGGED_VALUE_PURGED, "logged-value-purged"} + , + {ERROR_CODE_NO_PROPERTY_SPECIFIED, "no-property-specified"} + , + {ERROR_CODE_NOT_CONFIGURED_FOR_TRIGGERED_LOGGING, + "not-configured-for-triggered-logging"} + , + {ERROR_CODE_UNKNOWN_SUBSCRIPTION, "unknown-subscription"} + , + {ERROR_CODE_PARAMETER_OUT_OF_RANGE, "parameter-out-of-range"} + , + {ERROR_CODE_UNKNOWN_FILE_SIZE, "unknown-file-size"} + , + {ERROR_CODE_BUSY, "busy"} + , + {ERROR_CODE_COMMUNICATION_DISABLED, "communication-disabled"} + , {0, NULL} }; diff --git a/bacnet-stack/src/bvlc.c b/bacnet-stack/src/bvlc.c index 8696df75..1c0f3adc 100644 --- a/bacnet-stack/src/bvlc.c +++ b/bacnet-stack/src/bvlc.c @@ -571,7 +571,7 @@ static bool bvlc_create_bdt( } static bool bvlc_register_foreign_device( - struct sockaddr_in * sin, /* source address in network order */ + struct sockaddr_in *sin, /* source address in network order */ uint16_t time_to_live) { /* time in seconds */ unsigned i = 0; @@ -687,8 +687,7 @@ static void bvlc_bdt_forward_npdu( } bytes_sent = bvlc_send_mpdu(&bip_dest, mtu, mtu_len); debug_printf("BVLC: BDT Sent Forwarded-NPDU to %s:%04X\n", - inet_ntoa(bip_dest.sin_addr), - ntohs(bip_dest.sin_port)); + inet_ntoa(bip_dest.sin_addr), ntohs(bip_dest.sin_port)); } } @@ -706,8 +705,7 @@ static void bvlc_forward_npdu( uint16_t mtu_len = 0; struct sockaddr_in bip_dest = { 0 }; - mtu_len = bvlc_encode_forwarded_npdu(&mtu[0], - sin, npdu, npdu_length); + mtu_len = bvlc_encode_forwarded_npdu(&mtu[0], sin, npdu, npdu_length); bip_dest.sin_addr.s_addr = htonl(bip_get_broadcast_addr()); bip_dest.sin_port = htons(bip_get_port()); bvlc_send_mpdu(&bip_dest, mtu, mtu_len); @@ -738,13 +736,12 @@ static void bvlc_fdt_forward_npdu( } /* don't send to src ip address and same port */ if ((bip_dest.sin_addr.s_addr == sin->sin_addr.s_addr) && - (bip_dest.sin_port == sin->sin_port)) { + (bip_dest.sin_port == sin->sin_port)) { continue; } bytes_sent = bvlc_send_mpdu(&bip_dest, mtu, mtu_len); debug_printf("BVLC: FDT Sent Forwarded-NPDU to %s:%04X\n", - inet_ntoa(bip_dest.sin_addr), - ntohs(bip_dest.sin_port)); + inet_ntoa(bip_dest.sin_addr), ntohs(bip_dest.sin_port)); } } @@ -823,12 +820,10 @@ static bool bvlc_bdt_member_mask_is_unicast( if (BBMD_Table[i].valid) { /* find the source address in the table */ if ((BBMD_Table[i].dest_address.s_addr == - htonl(sin->sin_addr.s_addr)) && - (BBMD_Table[i].dest_port == - htons(sin->sin_port))) { + htonl(sin->sin_addr.s_addr)) && + (BBMD_Table[i].dest_port == htons(sin->sin_port))) { /* unicast mask? */ - if (BBMD_Table[i].broadcast_mask.s_addr == - 0xFFFFFFFFL) { + if (BBMD_Table[i].broadcast_mask.s_addr == 0xFFFFFFFFL) { unicast = true; break; } @@ -918,9 +913,9 @@ uint16_t bvlc_receive( /* FIXME: clients may need this result */ (void) decode_unsigned16(&npdu[4], &result_code); BVLC_Result_Code = result_code; - debug_printf("BVLC: Result Code=%d\n",BVLC_Result_Code); + debug_printf("BVLC: Result Code=%d\n", BVLC_Result_Code); /* not an NPDU */ - npdu_len = 0; + npdu_len = 0; break; case BVLC_WRITE_BROADCAST_DISTRIBUTION_TABLE: debug_printf("BVLC: Received Write-BDT.\n"); @@ -962,7 +957,7 @@ uint16_t bvlc_receive( debug_printf("BVLC: Received Read-BDT-Ack.\n"); /* FIXME: complete the code for client side read */ /* not an NPDU */ - npdu_len = 0; + npdu_len = 0; break; case BVLC_FORWARDED_NPDU: /* Upon receipt of a BVLL Forwarded-NPDU message, a BBMD shall @@ -998,8 +993,7 @@ uint16_t bvlc_receive( dest.sin_port = htons(original_sin.sin_port); bvlc_fdt_forward_npdu(&dest, &npdu[4 + 6], npdu_len); debug_printf("BVLC: Received Forwarded-NPDU from %s:%04X.\n", - inet_ntoa(dest.sin_addr), - ntohs(dest.sin_port)); + inet_ntoa(dest.sin_addr), ntohs(dest.sin_port)); bvlc_internet_to_bacnet_address(src, &dest); if (npdu_len < max_npdu) { /* shift the buffer to return a valid PDU */ @@ -1025,7 +1019,7 @@ uint16_t bvlc_receive( (void) decode_unsigned16(&npdu[4], &time_to_live); if (bvlc_register_foreign_device(&sin, time_to_live)) { bvlc_send_result(&sin, BVLC_RESULT_SUCCESSFUL_COMPLETION); - debug_printf("BVLC: Registered a Foreign Device.\n"); + debug_printf("BVLC: Registered a Foreign Device.\n"); } else { bvlc_send_result(&sin, BVLC_RESULT_REGISTER_FOREIGN_DEVICE_NAK); @@ -1076,9 +1070,9 @@ uint16_t bvlc_receive( npdu_len = 0; break; case BVLC_DISTRIBUTE_BROADCAST_TO_NETWORK: - debug_printf("BVLC: Received Distribute-Broadcast-to-Network from %s:%04X.\n", - inet_ntoa(sin.sin_addr), - ntohs(sin.sin_port)); + debug_printf + ("BVLC: Received Distribute-Broadcast-to-Network from %s:%04X.\n", + inet_ntoa(sin.sin_addr), ntohs(sin.sin_port)); /* Upon receipt of a BVLL Distribute-Broadcast-To-Network message from a foreign device, the receiving BBMD shall transmit a BVLL Forwarded-NPDU message on its local IP subnet using the diff --git a/bacnet-stack/src/debug.c b/bacnet-stack/src/debug.c index 22c5b936..e442a82d 100644 --- a/bacnet-stack/src/debug.c +++ b/bacnet-stack/src/debug.c @@ -1,51 +1,53 @@ -/*####COPYRIGHTBEGIN#### - ------------------------------------------- - Copyright (C) 2008 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####*/ - -#include /* for standard integer types uint8_t etc. */ -#include /* for the standard bool type. */ -#include /* Standard I/O */ -#include /* Standard Library */ -#include - -void debug_printf(const char * format, ...) -{ - va_list ap; - - va_start(ap, format); - vfprintf(stdout, format, ap); - va_end(ap); - fflush(stdout); - - return; -} +/*####COPYRIGHTBEGIN#### + ------------------------------------------- + Copyright (C) 2008 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####*/ + +#include /* for standard integer types uint8_t etc. */ +#include /* for the standard bool type. */ +#include /* Standard I/O */ +#include /* Standard Library */ +#include + +void debug_printf( + const char *format, + ...) +{ + va_list ap; + + va_start(ap, format); + vfprintf(stdout, format, ap); + va_end(ap); + fflush(stdout); + + return; +} diff --git a/bacnet-stack/src/npdu.c b/bacnet-stack/src/npdu.c index ad5c67a0..7b48a5e4 100644 --- a/bacnet-stack/src/npdu.c +++ b/bacnet-stack/src/npdu.c @@ -396,7 +396,7 @@ void npdu_handler( if (dest.net) { debug_printf("NPDU: DNET=%d. Discarded!\n", dest.net); } else { - debug_printf("NPDU: BACnet Protocol Version=%d. Discarded!\n", + debug_printf("NPDU: BACnet Protocol Version=%d. Discarded!\n", npdu_data.protocol_version); } }