Changed RR handler to call Device_Objects_RR_Info directly.

Removed handler_rr_object_set and associated info. 
Simplified parameter passing to rr info functions by passing ptr to BACnet_Read_Range_Data.
This commit is contained in:
petermcs
2010-02-18 11:12:38 +00:00
parent d7d22234d4
commit 9c9e4b9603
7 changed files with 29 additions and 58 deletions
+3 -11
View File
@@ -36,20 +36,12 @@
#include "npdu.h"
#include "abort.h"
#include "readrange.h"
#include "device.h"
/** @file h_rr.c Handles Read Range requests. */
static uint8_t Temp_Buf[MAX_APDU] = { 0 };
static get_rr_info_fn get_rr_info;
void handler_rr_object_set(
get_rr_info_fn pFunction1)
{
get_rr_info = pFunction1;
}
/* Encodes the property APDU and returns the length,
or sets the error, and returns -1 */
int Encode_RR_payload(
@@ -65,9 +57,9 @@ int Encode_RR_payload(
pRequest->error_code = ERROR_CODE_OTHER;
/* handle each object type */
info_fn_ptr = *get_rr_info(pRequest->object_type);
info_fn_ptr = Device_Objects_RR_Info(pRequest->object_type);
if ((get_rr_info != NULL) && (info_fn_ptr(pRequest->object_instance, pRequest->object_property, &PropInfo, &pRequest->error_class, &pRequest->error_code) != false)) {
if ((info_fn_ptr != NULL) && (info_fn_ptr(pRequest, &PropInfo) != false)) {
/* We try and do some of the more generic error checking here to cut down on duplication of effort */
if((pRequest->RequestType == RR_BY_POSITION) && (pRequest->Range.RefIndex == 0)) {/* First index is 1 so can't accept 0 */