Documentation for the Data Sharing BIBBs: RP, RPM, WP.

A start on ReadRange for Trending BIBB.
This commit is contained in:
tbrennan3
2010-02-28 03:44:06 +00:00
parent 2a68202503
commit cd33aa18e9
12 changed files with 210 additions and 34 deletions
+20
View File
@@ -42,6 +42,26 @@
/** @file h_rp.c Handles Read Property requests. */
/** Handler for a ReadProperty Service request.
* @ingroup DSRP
* This handler will be invoked by apdu_handler() if it has been enabled
* by a call to apdu_set_confirmed_handler().
* This handler builds a response packet, which is
* - an Abort if
* - the message is segmented
* - if decoding fails
* - if the response would be too large
* - the result from Device_Read_Property(), if it succeeds
* - an Error if Device_Read_Property() fails
* or there isn't enough room in the APDU to fit the data.
*
* @param service_request [in] The contents of the service request.
* @param service_len [in] The length of the service_request.
* @param src [in] BACNET_ADDRESS of the source of the message
* @param service_data [in] The BACNET_CONFIRMED_SERVICE_DATA information
* decoded from the APDU header of this message.
*/
void handler_read_property(
uint8_t * service_request,
uint16_t service_len,
+15 -1
View File
@@ -43,7 +43,9 @@
/** @file h_rp_a.c Handles Read Property Acknowledgments. */
/* for debugging... */
/** For debugging...
* @param [in] data portion of the ACK
*/
static void PrintReadPropertyData(
BACNET_READ_PROPERTY_DATA * data)
{
@@ -105,6 +107,18 @@ static void PrintReadPropertyData(
}
}
/** Handler for a ReadProperty ACK.
* @ingroup DSRP
* Doesn't actually do anything, except, for debugging, to
* print out the ACK message.
*
* @param service_request [in] The contents of the service request.
* @param service_len [in] The length of the service_request.
* @param src [in] BACNET_ADDRESS of the source of the message
* @param service_data [in] The BACNET_CONFIRMED_SERVICE_DATA information
* decoded from the APDU header of this message.
*/
void handler_read_property_ack(
uint8_t * service_request,
uint16_t service_len,
+21 -1
View File
@@ -98,7 +98,7 @@ static unsigned RPM_Object_Property_Count(
return count;
}
/* Encode the RPM property returning the length of the encoding,
/** Encode the RPM property returning the length of the encoding,
or 0 if there is no room to fit the encoding. */
static int RPM_Encode_Property(
uint8_t * apdu,
@@ -156,6 +156,26 @@ static int RPM_Encode_Property(
return apdu_len;
}
/** Handler for a ReadPropertyMultiple Service request.
* @ingroup DSRPM
* This handler will be invoked by apdu_handler() if it has been enabled
* by a call to apdu_set_confirmed_handler().
* This handler builds a response packet, which is
* - an Abort if
* - the message is segmented
* - if decoding fails
* - if the response would be too large
* - the result from each included read request, if it succeeds
* - an Error if processing fails for all, or individual errors if only some fail,
* or there isn't enough room in the APDU to fit the data.
*
* @param service_request [in] The contents of the service request.
* @param service_len [in] The length of the service_request.
* @param src [in] BACNET_ADDRESS of the source of the message
* @param service_data [in] The BACNET_CONFIRMED_SERVICE_DATA information
* decoded from the APDU header of this message.
*/
void handler_read_property_multiple(
uint8_t * service_request,
uint16_t service_len,
+12
View File
@@ -266,6 +266,18 @@ static void PrintReadPropertyMultipleData(
}
}
/** Handler for a ReadPropertyMultiple ACK.
* @ingroup DSRPM
* For each read property, print out the ACK'd data for debugging,
* and free the request data items from linked property list.
*
* @param service_request [in] The contents of the service request.
* @param service_len [in] The length of the service_request.
* @param src [in] BACNET_ADDRESS of the source of the message
* @param service_data [in] The BACNET_CONFIRMED_SERVICE_DATA information
* decoded from the APDU header of this message.
*/
void handler_read_property_multiple_ack(
uint8_t * service_request,
uint16_t service_len,
+21 -4
View File
@@ -41,6 +41,25 @@
/** @file h_wp.c Handles Write Property requests. */
/** Handler for a WriteProperty Service request.
* @ingroup DSWP
* This handler will be invoked by apdu_handler() if it has been enabled
* by a call to apdu_set_confirmed_handler().
* This handler builds a response packet, which is
* - an Abort if
* - the message is segmented
* - if decoding fails
* - an ACK if Device_Write_Property() succeeds
* - an Error if Device_Write_Property() fails
* or there isn't enough room in the APDU to fit the data.
*
* @param service_request [in] The contents of the service request.
* @param service_len [in] The length of the service_request.
* @param src [in] BACNET_ADDRESS of the source of the message
* @param service_data [in] The BACNET_CONFIRMED_SERVICE_DATA information
* decoded from the APDU header of this message.
*/
void handler_write_property(
uint8_t * service_request,
uint16_t service_len,
@@ -123,8 +142,7 @@ void handler_write_property(
}
/*
* Perform basic validation of Write Property argument based on
/** Perform basic validation of Write Property argument based on
* the assumption that it is a string. Check for correct data type,
* correct encoding (fixed here as ANSI X34),correct length, and
* finally if it is allowed to be empty.
@@ -163,8 +181,7 @@ bool WPValidateString(
return(bResult);
}
/*
* Perform simple validation of type of Write Property argument based
/** Perform simple validation of type of Write Property argument based
* the expected type vs the actual. Set up error response if the
* validation fails. Cuts out reams of repeated code in the object code.
*/
+13 -1
View File
@@ -45,7 +45,19 @@
/** @file s_rp.c Send Read Property request. */
/* returns invoke id of 0 if device is not bound or no tsm available */
/** Sends a Read Property request.
* @ingroup DSRP
*
* @param device_id [in] ID of the destination device
* @param object_type [in] Type of the object whose property is to be read.
* @param object_instance [in] Instance # of the object to be read.
* @param object_property [in] Property to be read, but not ALL, REQUIRED, or OPTIONAL.
* @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.
* @return invoke id of outgoing message, or 0 if device is not bound or no tsm available
*/
uint8_t Send_Read_Property_Request(
uint32_t device_id, /* destination device */
BACNET_OBJECT_TYPE object_type,
+10 -1
View File
@@ -45,7 +45,16 @@
/** @file s_rpm.c Send Read Property Multiple request. */
/* returns invoke id of 0 if device is not bound or no tsm available */
/** Sends a Read Property Multiple request.
* @ingroup DSRPM
*
* @param pdu [out] Buffer to build the outgoing message into
* @param max_pdu [in] Length of the pdu buffer.
* @param device_id [in] ID of the destination device
* @param read_access_data [in] Ptr to structure with the linked list of
* properties 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_Multiple_Request(
uint8_t * pdu,
size_t max_pdu,
+15 -1
View File
@@ -45,7 +45,7 @@
/** @file s_wp.c Send a Write Property request. */
/* returns the invoke ID for confirmed request, or zero on failure */
/** returns the invoke ID for confirmed request, or zero on failure */
uint8_t Send_Write_Property_Request_Data(
uint32_t device_id,
BACNET_OBJECT_TYPE object_type,
@@ -125,6 +125,20 @@ uint8_t Send_Write_Property_Request_Data(
return invoke_id;
}
/** Sends a Write Property request.
* @ingroup DSWP
*
* @param device_id [in] ID of the destination device
* @param object_type [in] Type of the object whose property is to be written.
* @param object_instance [in] Instance # of the object to be written.
* @param object_property [in] Property to be written.
* @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.
* @return invoke id of outgoing message, or 0 on failure.
*/
uint8_t Send_Write_Property_Request(
uint32_t device_id,
BACNET_OBJECT_TYPE object_type,