Converted all the BACnet-array-index variables from int32 to uint32 as they were intended.

This commit is contained in:
skarg
2011-08-23 20:11:42 +00:00
parent e0b5b5b164
commit f19f2c29d9
27 changed files with 70 additions and 81 deletions
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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;
+5 -3
View File
@@ -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;
+3 -3
View File
@@ -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;
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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(
-12
View File
@@ -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,
+6 -6
View File
@@ -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 <br>
* 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
+13 -13
View File
@@ -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 <br>
* 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
+9 -9
View File
@@ -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 <br>
* 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
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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)
{
+5 -5
View File
@@ -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 {
+1 -1
View File
@@ -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)
{
+4 -4
View File
@@ -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 {
+1 -1
View File
@@ -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)
{
+4 -5
View File
@@ -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;