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)) { if ((pPropList != NULL) && (pPropList[Property_List_Index] != -1)) {
int prop = pPropList[Property_List_Index]; int prop = pPropList[Property_List_Index];
int32_t array_index; uint32_t array_index;
IsLongArray = false; IsLongArray = false;
if (Using_Walked_List) { if (Using_Walked_List) {
if (Walked_List_Length == 0) { if (Walked_List_Length == 0) {
+1 -1
View File
@@ -228,7 +228,7 @@ void rpm_ack_print_data(
(unsigned) listOfProperties->propertyIdentifier); (unsigned) listOfProperties->propertyIdentifier);
} }
#endif #endif
if (listOfProperties->propertyArrayIndex != (int32_t) BACNET_ARRAY_ALL) { if (listOfProperties->propertyArrayIndex != BACNET_ARRAY_ALL) {
#if PRINT_ENABLED #if PRINT_ENABLED
fprintf(stdout, "[%d]", listOfProperties->propertyArrayIndex); fprintf(stdout, "[%d]", listOfProperties->propertyArrayIndex);
#endif #endif
+2 -2
View File
@@ -55,7 +55,7 @@
* @param array_index [in] Optional: if the Property is an array, * @param array_index [in] Optional: if the Property is an array,
* - 0 for the array size * - 0 for the array size
* - 1 to n for individual array members * - 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 * @return invoke id of outgoing message, or 0 if device is not bound or no tsm available
*/ */
uint8_t Send_Read_Property_Request( uint8_t Send_Read_Property_Request(
@@ -63,7 +63,7 @@ uint8_t Send_Read_Property_Request(
BACNET_OBJECT_TYPE object_type, BACNET_OBJECT_TYPE object_type,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID object_property, BACNET_PROPERTY_ID object_property,
int32_t array_index) uint32_t array_index)
{ {
BACNET_ADDRESS dest; BACNET_ADDRESS dest;
BACNET_ADDRESS my_address; BACNET_ADDRESS my_address;
+5 -3
View File
@@ -54,7 +54,7 @@ uint8_t Send_Write_Property_Request_Data(
uint8_t * application_data, uint8_t * application_data,
int application_data_len, int application_data_len,
uint8_t priority, uint8_t priority,
int32_t array_index) uint32_t array_index)
{ {
BACNET_ADDRESS dest; BACNET_ADDRESS dest;
BACNET_ADDRESS my_address; 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 object_value [in] The value to be written to the property.
* @param priority [in] Write priority of 1 (highest) to 16 (lowest) * @param priority [in] Write priority of 1 (highest) to 16 (lowest)
* @param array_index [in] Optional: if the Property is an array, * @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. * @return invoke id of outgoing message, or 0 on failure.
*/ */
uint8_t Send_Write_Property_Request( uint8_t Send_Write_Property_Request(
@@ -146,7 +148,7 @@ uint8_t Send_Write_Property_Request(
BACNET_PROPERTY_ID object_property, BACNET_PROPERTY_ID object_property,
BACNET_APPLICATION_DATA_VALUE * object_value, BACNET_APPLICATION_DATA_VALUE * object_value,
uint8_t priority, uint8_t priority,
int32_t array_index) uint32_t array_index)
{ {
uint8_t application_data[MAX_APDU] = { 0 }; uint8_t application_data[MAX_APDU] = { 0 };
int apdu_len = 0, len = 0; int apdu_len = 0, len = 0;
+3 -3
View File
@@ -98,7 +98,7 @@ typedef struct BACnet_Access_Error {
struct BACnet_Property_Reference; struct BACnet_Property_Reference;
typedef struct BACnet_Property_Reference { typedef struct BACnet_Property_Reference {
BACNET_PROPERTY_ID propertyIdentifier; BACNET_PROPERTY_ID propertyIdentifier;
int32_t propertyArrayIndex; /* optional */ uint32_t propertyArrayIndex; /* optional */
/* either value or error, but not both. /* either value or error, but not both.
Use NULL value to indicate error */ Use NULL value to indicate error */
BACNET_APPLICATION_DATA_VALUE *value; BACNET_APPLICATION_DATA_VALUE *value;
@@ -110,7 +110,7 @@ typedef struct BACnet_Property_Reference {
struct BACnet_Property_Value; struct BACnet_Property_Value;
typedef struct BACnet_Property_Value { typedef struct BACnet_Property_Value {
BACNET_PROPERTY_ID propertyIdentifier; BACNET_PROPERTY_ID propertyIdentifier;
int32_t propertyArrayIndex; uint32_t propertyArrayIndex;
BACNET_APPLICATION_DATA_VALUE value; BACNET_APPLICATION_DATA_VALUE value;
uint8_t priority; uint8_t priority;
/* simple linked list */ /* simple linked list */
@@ -123,7 +123,7 @@ typedef struct BACnet_Object_Property_Value {
BACNET_OBJECT_TYPE object_type; BACNET_OBJECT_TYPE object_type;
uint32_t object_instance; uint32_t object_instance;
BACNET_PROPERTY_ID object_property; BACNET_PROPERTY_ID object_property;
int32_t array_index; uint32_t array_index;
BACNET_APPLICATION_DATA_VALUE *value; BACNET_APPLICATION_DATA_VALUE *value;
} BACNET_OBJECT_PROPERTY_VALUE; } BACNET_OBJECT_PROPERTY_VALUE;
+1 -1
View File
@@ -56,7 +56,7 @@
/* large BACnet Object Type */ /* large BACnet Object Type */
#define BACNET_MAX_OBJECT (0x3FF) #define BACNET_MAX_OBJECT (0x3FF)
/* Array index 0=size of array, n=array element n, MAX=all array elements */ /* 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 */ /* Priority Array for commandable objects */
#define BACNET_NO_PRIORITY 0 #define BACNET_NO_PRIORITY 0
#define BACNET_MIN_PRIORITY 1 #define BACNET_MIN_PRIORITY 1
+3 -3
View File
@@ -119,7 +119,7 @@ extern "C" {
BACNET_OBJECT_TYPE object_type, BACNET_OBJECT_TYPE object_type,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID object_property, BACNET_PROPERTY_ID object_property,
int32_t array_index); uint32_t array_index);
uint8_t Send_Read_Property_Multiple_Request( uint8_t Send_Read_Property_Multiple_Request(
uint8_t * pdu, uint8_t * pdu,
size_t max_pdu, size_t max_pdu,
@@ -134,7 +134,7 @@ extern "C" {
BACNET_PROPERTY_ID object_property, BACNET_PROPERTY_ID object_property,
BACNET_APPLICATION_DATA_VALUE * object_value, BACNET_APPLICATION_DATA_VALUE * object_value,
uint8_t priority, uint8_t priority,
int32_t array_index); uint32_t array_index);
uint8_t Send_Write_Property_Request_Data( uint8_t Send_Write_Property_Request_Data(
uint32_t device_id, uint32_t device_id,
BACNET_OBJECT_TYPE object_type, BACNET_OBJECT_TYPE object_type,
@@ -143,7 +143,7 @@ extern "C" {
uint8_t * application_data, uint8_t * application_data,
int application_data_len, int application_data_len,
uint8_t priority, uint8_t priority,
int32_t array_index); uint32_t array_index);
/* returns the invoke ID for confirmed request, or 0 if failed */ /* returns the invoke ID for confirmed request, or 0 if failed */
uint8_t Send_Reinitialize_Device_Request( uint8_t Send_Reinitialize_Device_Request(
-12
View File
@@ -209,18 +209,6 @@ extern "C" {
void rpm_ack_print_data( void rpm_ack_print_data(
BACNET_READ_ACCESS_DATA * rpm_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( void handler_cov_subscribe(
uint8_t * service_request, uint8_t * service_request,
uint16_t service_len, uint16_t service_len,
+1 -1
View File
@@ -43,7 +43,7 @@ typedef struct BACnet_Read_Property_Data {
BACNET_OBJECT_TYPE object_type; BACNET_OBJECT_TYPE object_type;
uint32_t object_instance; uint32_t object_instance;
BACNET_PROPERTY_ID object_property; BACNET_PROPERTY_ID object_property;
int32_t array_index; uint32_t array_index;
uint8_t *application_data; uint8_t *application_data;
int application_data_len; int application_data_len;
BACNET_ERROR_CLASS error_class; BACNET_ERROR_CLASS error_class;
+4 -4
View File
@@ -49,7 +49,7 @@ typedef struct BACnet_RPM_Data {
BACNET_OBJECT_TYPE object_type; BACNET_OBJECT_TYPE object_type;
uint32_t object_instance; uint32_t object_instance;
BACNET_PROPERTY_ID object_property; BACNET_PROPERTY_ID object_property;
int32_t array_index; uint32_t array_index;
BACNET_ERROR_CLASS error_class; BACNET_ERROR_CLASS error_class;
BACNET_ERROR_CODE error_code; BACNET_ERROR_CODE error_code;
} BACNET_RPM_DATA; } BACNET_RPM_DATA;
@@ -118,7 +118,7 @@ extern "C" {
int rpm_encode_apdu_object_property( int rpm_encode_apdu_object_property(
uint8_t * apdu, uint8_t * apdu,
BACNET_PROPERTY_ID object_property, BACNET_PROPERTY_ID object_property,
int32_t array_index); uint32_t array_index);
int rpm_encode_apdu_object_end( int rpm_encode_apdu_object_end(
uint8_t * apdu); uint8_t * apdu);
@@ -158,7 +158,7 @@ extern "C" {
int rpm_ack_encode_apdu_object_property( int rpm_ack_encode_apdu_object_property(
uint8_t * apdu, uint8_t * apdu,
BACNET_PROPERTY_ID object_property, BACNET_PROPERTY_ID object_property,
int32_t array_index); uint32_t array_index);
int rpm_ack_encode_apdu_object_property_value( int rpm_ack_encode_apdu_object_property_value(
uint8_t * apdu, uint8_t * apdu,
@@ -186,7 +186,7 @@ extern "C" {
uint8_t * apdu, uint8_t * apdu,
unsigned apdu_len, unsigned apdu_len,
BACNET_PROPERTY_ID * object_property, BACNET_PROPERTY_ID * object_property,
int32_t * array_index); uint32_t * array_index);
#ifdef TEST #ifdef TEST
#include "ctest.h" #include "ctest.h"
int rpm_decode_apdu( int rpm_decode_apdu(
+1 -1
View File
@@ -47,7 +47,7 @@ typedef struct BACnet_Write_Property_Data {
BACNET_OBJECT_TYPE object_type; BACNET_OBJECT_TYPE object_type;
uint32_t object_instance; uint32_t object_instance;
BACNET_PROPERTY_ID object_property; 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]; uint8_t application_data[MAX_APDU];
int application_data_len; int application_data_len;
uint8_t priority; /* use BACNET_NO_PRIORITY if no priority */ uint8_t priority; /* use BACNET_NO_PRIORITY if no priority */
+1 -1
View File
@@ -94,7 +94,7 @@ int Analog_Input_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -96,7 +96,7 @@ int Analog_Value_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -55,7 +55,7 @@ extern "C" {
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code); BACNET_ERROR_CODE * error_code);
+1 -1
View File
@@ -109,7 +109,7 @@ int Binary_Value_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -60,7 +60,7 @@ extern "C" {
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code); BACNET_ERROR_CODE * error_code);
+1 -1
View File
@@ -166,7 +166,7 @@ int Device_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -94,7 +94,7 @@ int Analog_Input_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -96,7 +96,7 @@ int Analog_Value_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -109,7 +109,7 @@ int Binary_Value_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -172,7 +172,7 @@ int Device_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -103,7 +103,7 @@ int Analog_Input_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -151,7 +151,7 @@ int Analog_Value_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -123,7 +123,7 @@ int Binary_Input_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -120,7 +120,7 @@ int Binary_Value_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) BACNET_ERROR_CODE * error_code)
{ {
+1 -1
View File
@@ -242,7 +242,7 @@ int Device_Encode_Property_APDU(
uint8_t * apdu, uint8_t * apdu,
uint32_t object_instance, uint32_t object_instance,
BACNET_PROPERTY_ID property, BACNET_PROPERTY_ID property,
int32_t array_index, uint32_t array_index,
BACNET_ERROR_CLASS * error_class, BACNET_ERROR_CLASS * error_class,
BACNET_ERROR_CODE * error_code) 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( int rpm_encode_apdu_object_property(
uint8_t * apdu, uint8_t * apdu,
BACNET_PROPERTY_ID object_property, BACNET_PROPERTY_ID object_property,
int32_t array_index) uint32_t array_index)
{ {
int apdu_len = 0; /* total length of the apdu, return value */ 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( int rpm_ack_encode_apdu_object_property(
uint8_t * apdu, uint8_t * apdu,
BACNET_PROPERTY_ID object_property, BACNET_PROPERTY_ID object_property,
int32_t array_index) uint32_t array_index)
{ {
int apdu_len = 0; /* total length of the apdu, return value */ int apdu_len = 0; /* total length of the apdu, return value */
@@ -457,7 +457,7 @@ int rpm_ack_decode_object_property(
uint8_t * apdu, uint8_t * apdu,
unsigned apdu_len, unsigned apdu_len,
BACNET_PROPERTY_ID * object_property, BACNET_PROPERTY_ID * object_property,
int32_t * array_index) uint32_t * array_index)
{ {
unsigned len = 0; unsigned len = 0;
unsigned tag_len = 0; unsigned tag_len = 0;
@@ -702,7 +702,7 @@ void testReadPropertyMultipleAck(
BACNET_OBJECT_TYPE object_type = OBJECT_DEVICE; BACNET_OBJECT_TYPE object_type = OBJECT_DEVICE;
uint32_t object_instance = 0; uint32_t object_instance = 0;
BACNET_PROPERTY_ID object_property = PROP_OBJECT_IDENTIFIER; 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 application_data[4] = { {0} };
BACNET_APPLICATION_DATA_VALUE test_application_data = { 0 }; BACNET_APPLICATION_DATA_VALUE test_application_data = { 0 };
uint8_t application_data_buffer[MAX_APDU] = { 0 }; uint8_t application_data_buffer[MAX_APDU] = { 0 };
@@ -721,7 +721,6 @@ void testReadPropertyMultipleAck(
Also check case of storing a backoff point Also check case of storing a backoff point
(i.e. save enough room for object_end) */ (i.e. save enough room for object_end) */
apdu_len = rpm_ack_encode_apdu_init(&apdu[0], invoke_id); apdu_len = rpm_ack_encode_apdu_init(&apdu[0], invoke_id);
/* object beginning */ /* object beginning */
rpmdata.object_type = OBJECT_DEVICE; rpmdata.object_type = OBJECT_DEVICE;
rpmdata.object_instance = 123; rpmdata.object_instance = 123;