From f19f2c29d9b4a70dc451890168a813145b1b52df Mon Sep 17 00:00:00 2001 From: skarg Date: Tue, 23 Aug 2011 20:11:42 +0000 Subject: [PATCH] Converted all the BACnet-array-index variables from int32 to uint32 as they were intended. --- bacnet-stack/demo/epics/main.c | 2 +- bacnet-stack/demo/handler/h_rpm_a.c | 2 +- bacnet-stack/demo/handler/s_rp.c | 4 ++-- bacnet-stack/demo/handler/s_wp.c | 8 +++++--- bacnet-stack/include/bacapp.h | 6 +++--- bacnet-stack/include/bacdef.h | 2 +- bacnet-stack/include/client.h | 6 +++--- bacnet-stack/include/handlers.h | 12 ------------ bacnet-stack/include/rp.h | 12 ++++++------ bacnet-stack/include/rpm.h | 26 +++++++++++++------------- bacnet-stack/include/wp.h | 18 +++++++++--------- bacnet-stack/ports/atmega168/ai.c | 2 +- bacnet-stack/ports/atmega168/av.c | 2 +- bacnet-stack/ports/atmega168/av.h | 2 +- bacnet-stack/ports/atmega168/bv.c | 2 +- bacnet-stack/ports/atmega168/bv.h | 2 +- bacnet-stack/ports/atmega168/device.c | 2 +- bacnet-stack/ports/atmega8/ai.c | 2 +- bacnet-stack/ports/atmega8/av.c | 2 +- bacnet-stack/ports/atmega8/bv.c | 2 +- bacnet-stack/ports/atmega8/device.c | 2 +- bacnet-stack/ports/pic18f6720/ai.c | 2 +- bacnet-stack/ports/pic18f6720/av.c | 10 +++++----- bacnet-stack/ports/pic18f6720/bi.c | 2 +- bacnet-stack/ports/pic18f6720/bv.c | 8 ++++---- bacnet-stack/ports/pic18f6720/device.c | 2 +- bacnet-stack/src/rpm.c | 9 ++++----- 27 files changed, 70 insertions(+), 81 deletions(-) diff --git a/bacnet-stack/demo/epics/main.c b/bacnet-stack/demo/epics/main.c index 05f7bfcb..17b0b9d9 100644 --- a/bacnet-stack/demo/epics/main.c +++ b/bacnet-stack/demo/epics/main.c @@ -667,7 +667,7 @@ static uint8_t Read_Properties( if ((pPropList != NULL) && (pPropList[Property_List_Index] != -1)) { int prop = pPropList[Property_List_Index]; - int32_t array_index; + uint32_t array_index; IsLongArray = false; if (Using_Walked_List) { if (Walked_List_Length == 0) { diff --git a/bacnet-stack/demo/handler/h_rpm_a.c b/bacnet-stack/demo/handler/h_rpm_a.c index eec7a769..0669c966 100644 --- a/bacnet-stack/demo/handler/h_rpm_a.c +++ b/bacnet-stack/demo/handler/h_rpm_a.c @@ -228,7 +228,7 @@ void rpm_ack_print_data( (unsigned) listOfProperties->propertyIdentifier); } #endif - if (listOfProperties->propertyArrayIndex != (int32_t) BACNET_ARRAY_ALL) { + if (listOfProperties->propertyArrayIndex != BACNET_ARRAY_ALL) { #if PRINT_ENABLED fprintf(stdout, "[%d]", listOfProperties->propertyArrayIndex); #endif diff --git a/bacnet-stack/demo/handler/s_rp.c b/bacnet-stack/demo/handler/s_rp.c index 240f16d3..6cd0dba6 100644 --- a/bacnet-stack/demo/handler/s_rp.c +++ b/bacnet-stack/demo/handler/s_rp.c @@ -55,7 +55,7 @@ * @param array_index [in] Optional: if the Property is an array, * - 0 for the array size * - 1 to n for individual array members - * - -1 for the full array to be read. + * - BACNET_ARRAY_ALL (~0) for the full array to be read. * @return invoke id of outgoing message, or 0 if device is not bound or no tsm available */ uint8_t Send_Read_Property_Request( @@ -63,7 +63,7 @@ uint8_t Send_Read_Property_Request( BACNET_OBJECT_TYPE object_type, uint32_t object_instance, BACNET_PROPERTY_ID object_property, - int32_t array_index) + uint32_t array_index) { BACNET_ADDRESS dest; BACNET_ADDRESS my_address; diff --git a/bacnet-stack/demo/handler/s_wp.c b/bacnet-stack/demo/handler/s_wp.c index d6e46192..d65d4b57 100644 --- a/bacnet-stack/demo/handler/s_wp.c +++ b/bacnet-stack/demo/handler/s_wp.c @@ -54,7 +54,7 @@ uint8_t Send_Write_Property_Request_Data( uint8_t * application_data, int application_data_len, uint8_t priority, - int32_t array_index) + uint32_t array_index) { BACNET_ADDRESS dest; BACNET_ADDRESS my_address; @@ -136,7 +136,9 @@ uint8_t Send_Write_Property_Request_Data( * @param object_value [in] The value to be written to the property. * @param priority [in] Write priority of 1 (highest) to 16 (lowest) * @param array_index [in] Optional: if the Property is an array, - * the index from 1 to n for the individual array member to be written. + * - 0 for the array size + * - 1 to n for individual array members + * - BACNET_ARRAY_ALL (~0) for the array value to be ignored (not sent) * @return invoke id of outgoing message, or 0 on failure. */ uint8_t Send_Write_Property_Request( @@ -146,7 +148,7 @@ uint8_t Send_Write_Property_Request( BACNET_PROPERTY_ID object_property, BACNET_APPLICATION_DATA_VALUE * object_value, uint8_t priority, - int32_t array_index) + uint32_t array_index) { uint8_t application_data[MAX_APDU] = { 0 }; int apdu_len = 0, len = 0; diff --git a/bacnet-stack/include/bacapp.h b/bacnet-stack/include/bacapp.h index 32de710e..ca119128 100644 --- a/bacnet-stack/include/bacapp.h +++ b/bacnet-stack/include/bacapp.h @@ -98,7 +98,7 @@ typedef struct BACnet_Access_Error { struct BACnet_Property_Reference; typedef struct BACnet_Property_Reference { BACNET_PROPERTY_ID propertyIdentifier; - int32_t propertyArrayIndex; /* optional */ + uint32_t propertyArrayIndex; /* optional */ /* either value or error, but not both. Use NULL value to indicate error */ BACNET_APPLICATION_DATA_VALUE *value; @@ -110,7 +110,7 @@ typedef struct BACnet_Property_Reference { struct BACnet_Property_Value; typedef struct BACnet_Property_Value { BACNET_PROPERTY_ID propertyIdentifier; - int32_t propertyArrayIndex; + uint32_t propertyArrayIndex; BACNET_APPLICATION_DATA_VALUE value; uint8_t priority; /* simple linked list */ @@ -123,7 +123,7 @@ typedef struct BACnet_Object_Property_Value { BACNET_OBJECT_TYPE object_type; uint32_t object_instance; BACNET_PROPERTY_ID object_property; - int32_t array_index; + uint32_t array_index; BACNET_APPLICATION_DATA_VALUE *value; } BACNET_OBJECT_PROPERTY_VALUE; diff --git a/bacnet-stack/include/bacdef.h b/bacnet-stack/include/bacdef.h index 8e40fb06..4bfc45c4 100644 --- a/bacnet-stack/include/bacdef.h +++ b/bacnet-stack/include/bacdef.h @@ -56,7 +56,7 @@ /* large BACnet Object Type */ #define BACNET_MAX_OBJECT (0x3FF) /* Array index 0=size of array, n=array element n, MAX=all array elements */ -#define BACNET_ARRAY_ALL (~(unsigned int)0) +#define BACNET_ARRAY_ALL (~0UL) /* Priority Array for commandable objects */ #define BACNET_NO_PRIORITY 0 #define BACNET_MIN_PRIORITY 1 diff --git a/bacnet-stack/include/client.h b/bacnet-stack/include/client.h index 0a55c533..7f30c13a 100644 --- a/bacnet-stack/include/client.h +++ b/bacnet-stack/include/client.h @@ -119,7 +119,7 @@ extern "C" { BACNET_OBJECT_TYPE object_type, uint32_t object_instance, BACNET_PROPERTY_ID object_property, - int32_t array_index); + uint32_t array_index); uint8_t Send_Read_Property_Multiple_Request( uint8_t * pdu, size_t max_pdu, @@ -134,7 +134,7 @@ extern "C" { BACNET_PROPERTY_ID object_property, BACNET_APPLICATION_DATA_VALUE * object_value, uint8_t priority, - int32_t array_index); + uint32_t array_index); uint8_t Send_Write_Property_Request_Data( uint32_t device_id, BACNET_OBJECT_TYPE object_type, @@ -143,7 +143,7 @@ extern "C" { uint8_t * application_data, int application_data_len, uint8_t priority, - int32_t array_index); + uint32_t array_index); /* returns the invoke ID for confirmed request, or 0 if failed */ uint8_t Send_Reinitialize_Device_Request( diff --git a/bacnet-stack/include/handlers.h b/bacnet-stack/include/handlers.h index 5189d744..f921083e 100644 --- a/bacnet-stack/include/handlers.h +++ b/bacnet-stack/include/handlers.h @@ -209,18 +209,6 @@ extern "C" { void rpm_ack_print_data( BACNET_READ_ACCESS_DATA * rpm_data); - /* Encodes the property APDU and returns the length, - or sets the error, and returns -1 */ - /* resides in h_rp.c */ - int Encode_Property_APDU( - uint8_t * apdu, - BACNET_OBJECT_TYPE object_type, - uint32_t object_instance, - BACNET_PROPERTY_ID property, - int32_t array_index, - BACNET_ERROR_CLASS * error_class, - BACNET_ERROR_CODE * error_code); - void handler_cov_subscribe( uint8_t * service_request, uint16_t service_len, diff --git a/bacnet-stack/include/rp.h b/bacnet-stack/include/rp.h index dc8cf5f4..9ff0eb9c 100644 --- a/bacnet-stack/include/rp.h +++ b/bacnet-stack/include/rp.h @@ -43,7 +43,7 @@ typedef struct BACnet_Read_Property_Data { BACNET_OBJECT_TYPE object_type; uint32_t object_instance; BACNET_PROPERTY_ID object_property; - int32_t array_index; + uint32_t array_index; uint8_t *application_data; int application_data_len; BACNET_ERROR_CLASS error_class; @@ -55,7 +55,7 @@ struct BACnet_Read_Access_Data; /** Reads one property for this object type of a given instance. * A function template; @see device.c for assignment to object types. - * @ingroup ObjHelpers + * @ingroup ObjHelpers * * @param rp_data [in] Pointer to the BACnet_Read_Property_Data structure, * which is packed with the information from the RP request. @@ -132,14 +132,14 @@ extern "C" { } #endif /* __cplusplus */ /** @defgroup DataShare Data Sharing BIBBs - * These BIBBs prescribe the BACnet capabilities required to interoperably - * perform the data sharing functions enumerated in 22.2.1.1 for the BACnet + * These BIBBs prescribe the BACnet capabilities required to interoperably + * perform the data sharing functions enumerated in 22.2.1.1 for the BACnet * devices defined therein. *//** @defgroup DSRP Data Sharing -Read Property Service (DS-RP) * @ingroup DataShare * 15.5 ReadProperty Service
- * The ReadProperty service is used by a client BACnet-user to request the - * value of one property of one BACnet Object. This service allows read access + * The ReadProperty service is used by a client BACnet-user to request the + * value of one property of one BACnet Object. This service allows read access * to any property of any object, whether a BACnet-defined object or not. */ #endif diff --git a/bacnet-stack/include/rpm.h b/bacnet-stack/include/rpm.h index ba1c24a6..5ab2bd5f 100644 --- a/bacnet-stack/include/rpm.h +++ b/bacnet-stack/include/rpm.h @@ -41,7 +41,7 @@ #include "bacapp.h" /* - * Bundle together commonly used data items for convenience when calling + * Bundle together commonly used data items for convenience when calling * rpm helper functions. */ @@ -49,7 +49,7 @@ typedef struct BACnet_RPM_Data { BACNET_OBJECT_TYPE object_type; uint32_t object_instance; BACNET_PROPERTY_ID object_property; - int32_t array_index; + uint32_t array_index; BACNET_ERROR_CLASS error_class; BACNET_ERROR_CODE error_code; } BACNET_RPM_DATA; @@ -66,7 +66,7 @@ typedef struct BACnet_Read_Access_Data { /** Fetches the lists of properties (array of BACNET_PROPERTY_ID's) for this * object type, grouped by Required, Optional, and Proprietary. * A function template; @see device.c for assignment to object types. - * @ingroup ObjHelpers + * @ingroup ObjHelpers * * @param pRequired [out] Pointer reference for the list of Required properties. * @param pOptional [out] Pointer reference for the list of Optional properties. @@ -118,7 +118,7 @@ extern "C" { int rpm_encode_apdu_object_property( uint8_t * apdu, BACNET_PROPERTY_ID object_property, - int32_t array_index); + uint32_t array_index); int rpm_encode_apdu_object_end( uint8_t * apdu); @@ -158,7 +158,7 @@ extern "C" { int rpm_ack_encode_apdu_object_property( uint8_t * apdu, BACNET_PROPERTY_ID object_property, - int32_t array_index); + uint32_t array_index); int rpm_ack_encode_apdu_object_property_value( uint8_t * apdu, @@ -186,7 +186,7 @@ extern "C" { uint8_t * apdu, unsigned apdu_len, BACNET_PROPERTY_ID * object_property, - int32_t * array_index); + uint32_t * array_index); #ifdef TEST #include "ctest.h" int rpm_decode_apdu( @@ -215,13 +215,13 @@ extern "C" { /** @defgroup DSRPM Data Sharing -Read Property Multiple Service (DS-RPM) * @ingroup DataShare * 15.7 ReadPropertyMultiple Service
- * The ReadPropertyMultiple service is used by a client BACnet-user to request - * the values of one or more specified properties of one or more BACnet Objects. - * This service allows read access to any property of any object, whether a - * BACnet-defined object or not. The user may read a single property of a single - * object, a list of properties of a single object, or any number of properties - * of any number of objects. - * A 'Read Access Specification' with the property identifier ALL can be used to + * The ReadPropertyMultiple service is used by a client BACnet-user to request + * the values of one or more specified properties of one or more BACnet Objects. + * This service allows read access to any property of any object, whether a + * BACnet-defined object or not. The user may read a single property of a single + * object, a list of properties of a single object, or any number of properties + * of any number of objects. + * A 'Read Access Specification' with the property identifier ALL can be used to * learn the implemented properties of an object along with their values. */ #endif diff --git a/bacnet-stack/include/wp.h b/bacnet-stack/include/wp.h index 2179468e..9fdcdd2c 100644 --- a/bacnet-stack/include/wp.h +++ b/bacnet-stack/include/wp.h @@ -47,7 +47,7 @@ typedef struct BACnet_Write_Property_Data { BACNET_OBJECT_TYPE object_type; uint32_t object_instance; BACNET_PROPERTY_ID object_property; - int32_t array_index; /* use BACNET_ARRAY_ALL when not setting */ + uint32_t array_index; /* use BACNET_ARRAY_ALL when not setting */ uint8_t application_data[MAX_APDU]; int application_data_len; uint8_t priority; /* use BACNET_NO_PRIORITY if no priority */ @@ -58,7 +58,7 @@ typedef struct BACnet_Write_Property_Data { /** Attempts to write a new value to one property for this object type * of a given instance. * A function template; @see device.c for assignment to object types. - * @ingroup ObjHelpers + * @ingroup ObjHelpers * * @param wp_data [in] Pointer to the BACnet_Write_Property_Data structure, * which is packed with the information from the WP request. @@ -105,12 +105,12 @@ extern "C" { /** @defgroup DSWP Data Sharing - Write Property Service (DS-WP) * @ingroup DataShare * 15.9 WriteProperty Service
- * The WriteProperty service is used by a client BACnet-user to modify the - * value of a single specified property of a BACnet object. This service - * potentially allows write access to any property of any object, whether a - * BACnet-defined object or not. Some implementors may wish to restrict write - * access to certain properties of certain objects. In such cases, an attempt - * to modify a restricted property shall result in the return of an error of - * 'Error Class' PROPERTY and 'Error Code' WRITE_ACCESS_DENIED. + * The WriteProperty service is used by a client BACnet-user to modify the + * value of a single specified property of a BACnet object. This service + * potentially allows write access to any property of any object, whether a + * BACnet-defined object or not. Some implementors may wish to restrict write + * access to certain properties of certain objects. In such cases, an attempt + * to modify a restricted property shall result in the return of an error of + * 'Error Class' PROPERTY and 'Error Code' WRITE_ACCESS_DENIED. */ #endif diff --git a/bacnet-stack/ports/atmega168/ai.c b/bacnet-stack/ports/atmega168/ai.c index 3eea933d..c11b7ccb 100644 --- a/bacnet-stack/ports/atmega168/ai.c +++ b/bacnet-stack/ports/atmega168/ai.c @@ -94,7 +94,7 @@ int Analog_Input_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { diff --git a/bacnet-stack/ports/atmega168/av.c b/bacnet-stack/ports/atmega168/av.c index 184b760d..ef0a97c0 100644 --- a/bacnet-stack/ports/atmega168/av.c +++ b/bacnet-stack/ports/atmega168/av.c @@ -96,7 +96,7 @@ int Analog_Value_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { diff --git a/bacnet-stack/ports/atmega168/av.h b/bacnet-stack/ports/atmega168/av.h index 1a31b523..40f84fe8 100644 --- a/bacnet-stack/ports/atmega168/av.h +++ b/bacnet-stack/ports/atmega168/av.h @@ -55,7 +55,7 @@ extern "C" { uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code); diff --git a/bacnet-stack/ports/atmega168/bv.c b/bacnet-stack/ports/atmega168/bv.c index 67b8abf7..48510722 100644 --- a/bacnet-stack/ports/atmega168/bv.c +++ b/bacnet-stack/ports/atmega168/bv.c @@ -109,7 +109,7 @@ int Binary_Value_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { diff --git a/bacnet-stack/ports/atmega168/bv.h b/bacnet-stack/ports/atmega168/bv.h index 784acaff..731f3e48 100644 --- a/bacnet-stack/ports/atmega168/bv.h +++ b/bacnet-stack/ports/atmega168/bv.h @@ -60,7 +60,7 @@ extern "C" { uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code); diff --git a/bacnet-stack/ports/atmega168/device.c b/bacnet-stack/ports/atmega168/device.c index d7eede8b..700a4d3c 100644 --- a/bacnet-stack/ports/atmega168/device.c +++ b/bacnet-stack/ports/atmega168/device.c @@ -166,7 +166,7 @@ int Device_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { diff --git a/bacnet-stack/ports/atmega8/ai.c b/bacnet-stack/ports/atmega8/ai.c index 76cbd213..848482ef 100644 --- a/bacnet-stack/ports/atmega8/ai.c +++ b/bacnet-stack/ports/atmega8/ai.c @@ -94,7 +94,7 @@ int Analog_Input_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { diff --git a/bacnet-stack/ports/atmega8/av.c b/bacnet-stack/ports/atmega8/av.c index 184b760d..ef0a97c0 100644 --- a/bacnet-stack/ports/atmega8/av.c +++ b/bacnet-stack/ports/atmega8/av.c @@ -96,7 +96,7 @@ int Analog_Value_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { diff --git a/bacnet-stack/ports/atmega8/bv.c b/bacnet-stack/ports/atmega8/bv.c index 67b8abf7..48510722 100644 --- a/bacnet-stack/ports/atmega8/bv.c +++ b/bacnet-stack/ports/atmega8/bv.c @@ -109,7 +109,7 @@ int Binary_Value_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { diff --git a/bacnet-stack/ports/atmega8/device.c b/bacnet-stack/ports/atmega8/device.c index c2ce41f8..78151422 100644 --- a/bacnet-stack/ports/atmega8/device.c +++ b/bacnet-stack/ports/atmega8/device.c @@ -172,7 +172,7 @@ int Device_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { diff --git a/bacnet-stack/ports/pic18f6720/ai.c b/bacnet-stack/ports/pic18f6720/ai.c index 64383cdf..62960c7e 100644 --- a/bacnet-stack/ports/pic18f6720/ai.c +++ b/bacnet-stack/ports/pic18f6720/ai.c @@ -103,7 +103,7 @@ int Analog_Input_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { diff --git a/bacnet-stack/ports/pic18f6720/av.c b/bacnet-stack/ports/pic18f6720/av.c index b9f3b96d..302c884b 100644 --- a/bacnet-stack/ports/pic18f6720/av.c +++ b/bacnet-stack/ports/pic18f6720/av.c @@ -151,7 +151,7 @@ int Analog_Value_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { @@ -331,8 +331,8 @@ bool Analog_Value_Write_Property( Present_Value[object_index] = level; /* Note: you could set the physical output here if we are the highest priority. - However, if Out of Service is TRUE, then don't set the - physical output. This comment may apply to the + However, if Out of Service is TRUE, then don't set the + physical output. This comment may apply to the main loop (i.e. check out of service before changing output) */ status = true; } else if (priority == 6) { @@ -357,8 +357,8 @@ bool Analog_Value_Write_Property( /* Note: you could set the physical output here to the next highest priority, or to the relinquish default if no priorities are set. - However, if Out of Service is TRUE, then don't set the - physical output. This comment may apply to the + However, if Out of Service is TRUE, then don't set the + physical output. This comment may apply to the main loop (i.e. check out of service before changing output) */ status = true; } else { diff --git a/bacnet-stack/ports/pic18f6720/bi.c b/bacnet-stack/ports/pic18f6720/bi.c index 6b8e2c1a..2109ef0d 100644 --- a/bacnet-stack/ports/pic18f6720/bi.c +++ b/bacnet-stack/ports/pic18f6720/bi.c @@ -123,7 +123,7 @@ int Binary_Input_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { diff --git a/bacnet-stack/ports/pic18f6720/bv.c b/bacnet-stack/ports/pic18f6720/bv.c index d79c192c..a4c40ab7 100644 --- a/bacnet-stack/ports/pic18f6720/bv.c +++ b/bacnet-stack/ports/pic18f6720/bv.c @@ -120,7 +120,7 @@ int Binary_Value_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { @@ -244,7 +244,7 @@ bool Binary_Value_Write_Property( Present_Value[object_index] = level; /* Note: you could set the physical output here if we are the highest priority. - However, if Out of Service is TRUE, then don't set the + However, if Out of Service is TRUE, then don't set the physical output. */ status = true; } else if (priority == 6) { @@ -270,8 +270,8 @@ bool Binary_Value_Write_Property( /* Note: you could set the physical output here to the next highest priority, or to the relinquish default if no priorities are set. - However, if Out of Service is TRUE, then don't set the - physical output. This comment may apply to the + However, if Out of Service is TRUE, then don't set the + physical output. This comment may apply to the main loop (i.e. check out of service before changing output) */ status = true; } else { diff --git a/bacnet-stack/ports/pic18f6720/device.c b/bacnet-stack/ports/pic18f6720/device.c index a37e2bf5..fb361162 100644 --- a/bacnet-stack/ports/pic18f6720/device.c +++ b/bacnet-stack/ports/pic18f6720/device.c @@ -242,7 +242,7 @@ int Device_Encode_Property_APDU( uint8_t * apdu, uint32_t object_instance, BACNET_PROPERTY_ID property, - int32_t array_index, + uint32_t array_index, BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CODE * error_code) { diff --git a/bacnet-stack/src/rpm.c b/bacnet-stack/src/rpm.c index 4cfbf93e..6b6859bb 100644 --- a/bacnet-stack/src/rpm.c +++ b/bacnet-stack/src/rpm.c @@ -81,7 +81,7 @@ int rpm_encode_apdu_object_begin( int rpm_encode_apdu_object_property( uint8_t * apdu, BACNET_PROPERTY_ID object_property, - int32_t array_index) + uint32_t array_index) { int apdu_len = 0; /* total length of the apdu, return value */ @@ -344,7 +344,7 @@ int rpm_ack_encode_apdu_object_begin( int rpm_ack_encode_apdu_object_property( uint8_t * apdu, BACNET_PROPERTY_ID object_property, - int32_t array_index) + uint32_t array_index) { int apdu_len = 0; /* total length of the apdu, return value */ @@ -457,7 +457,7 @@ int rpm_ack_decode_object_property( uint8_t * apdu, unsigned apdu_len, BACNET_PROPERTY_ID * object_property, - int32_t * array_index) + uint32_t * array_index) { unsigned len = 0; unsigned tag_len = 0; @@ -702,7 +702,7 @@ void testReadPropertyMultipleAck( BACNET_OBJECT_TYPE object_type = OBJECT_DEVICE; uint32_t object_instance = 0; BACNET_PROPERTY_ID object_property = PROP_OBJECT_IDENTIFIER; - int32_t array_index = 0; + uint32_t array_index = 0; BACNET_APPLICATION_DATA_VALUE application_data[4] = { {0} }; BACNET_APPLICATION_DATA_VALUE test_application_data = { 0 }; uint8_t application_data_buffer[MAX_APDU] = { 0 }; @@ -721,7 +721,6 @@ void testReadPropertyMultipleAck( Also check case of storing a backoff point (i.e. save enough room for object_end) */ apdu_len = rpm_ack_encode_apdu_init(&apdu[0], invoke_id); - /* object beginning */ rpmdata.object_type = OBJECT_DEVICE; rpmdata.object_instance = 123;