Added init functions to object header files. Finished refactoring the demo read and write property handlers to use function tables.
This commit is contained in:
@@ -32,10 +32,10 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
void Analog_Input_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
void Analog_Input_Property_Lists(
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
bool Analog_Input_Valid_Instance(
|
||||
uint32_t object_instance);
|
||||
unsigned Analog_Input_Count(
|
||||
|
||||
@@ -58,7 +58,8 @@ extern "C" {
|
||||
bool Analog_Output_Present_Value_Relinquish(
|
||||
uint32_t object_instance,
|
||||
unsigned priority);
|
||||
|
||||
|
||||
void Analog_Output_Init(void);
|
||||
|
||||
int Analog_Output_Encode_Property_APDU(
|
||||
uint8_t * apdu,
|
||||
|
||||
@@ -74,6 +74,8 @@ extern "C" {
|
||||
bool bacfile_write_stream_data(
|
||||
BACNET_ATOMIC_WRITE_FILE_DATA * data);
|
||||
|
||||
void bacfile_init(void);
|
||||
|
||||
/* handling for read property service */
|
||||
int bacfile_encode_property_apdu(
|
||||
uint8_t * apdu,
|
||||
|
||||
@@ -53,6 +53,9 @@ extern "C" {
|
||||
char *Binary_Value_Name(
|
||||
uint32_t object_instance);
|
||||
|
||||
void Binary_Value_Init(
|
||||
void);
|
||||
|
||||
int Binary_Value_Encode_Property_APDU(
|
||||
uint8_t * apdu,
|
||||
uint32_t object_instance,
|
||||
|
||||
@@ -40,10 +40,21 @@
|
||||
#include "bacenum.h"
|
||||
#include "wp.h"
|
||||
|
||||
typedef unsigned (*object_count_function) (void);
|
||||
typedef uint32_t (*object_index_to_instance_function)
|
||||
(unsigned index);
|
||||
typedef char * (*object_name_function)
|
||||
(uint32_t object_instance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
void Device_Object_Function_Set(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
object_count_function count_function,
|
||||
object_index_to_instance_function index_function,
|
||||
object_name_function name_function);
|
||||
|
||||
void Device_Init(
|
||||
void);
|
||||
@@ -127,6 +138,7 @@ extern "C" {
|
||||
|
||||
int Device_Encode_Property_APDU(
|
||||
uint8_t * apdu,
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_ID property,
|
||||
int32_t array_index,
|
||||
BACNET_ERROR_CLASS * error_class,
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
#include "bacdef.h"
|
||||
#include "apdu.h"
|
||||
#include "bacapp.h"
|
||||
#include "rp.h"
|
||||
#include "rpm.h"
|
||||
#include "wp.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -75,9 +78,10 @@ extern "C" {
|
||||
|
||||
void handler_read_property_object_set(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
read_property_function pFunction);
|
||||
read_property_function pFunction1,
|
||||
object_valid_instance_function pFunction2);
|
||||
|
||||
void handler_read_property_ack(
|
||||
void handler_read_property_ack(
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS * src,
|
||||
@@ -144,6 +148,10 @@ extern "C" {
|
||||
BACNET_ADDRESS * src,
|
||||
BACNET_CONFIRMED_SERVICE_DATA * service_data);
|
||||
|
||||
void handler_read_property_multiple_list_set(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
rpm_property_lists_function pFunction);
|
||||
|
||||
void handler_read_property_multiple_ack(
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
|
||||
@@ -51,6 +51,9 @@ extern "C" {
|
||||
char *Load_Control_Name(
|
||||
uint32_t object_instance);
|
||||
|
||||
void Load_Control_Init(
|
||||
void);
|
||||
|
||||
int Load_Control_Encode_Property_APDU(
|
||||
uint8_t * apdu,
|
||||
uint32_t object_instance,
|
||||
|
||||
@@ -47,6 +47,8 @@ extern "C" {
|
||||
unsigned index);
|
||||
char *Life_Safety_Point_Name(
|
||||
uint32_t object_instance);
|
||||
void Life_Safety_Point_Init(
|
||||
void);
|
||||
|
||||
int Life_Safety_Point_Encode_Property_APDU(
|
||||
uint8_t * apdu,
|
||||
|
||||
@@ -48,6 +48,9 @@ extern "C" {
|
||||
char *Multistate_Output_Name(
|
||||
uint32_t object_instance);
|
||||
|
||||
void Multistate_Output_Init(
|
||||
void);
|
||||
|
||||
int Multistate_Output_Encode_Property_APDU(
|
||||
uint8_t * apdu,
|
||||
uint32_t object_instance,
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "bacdef.h"
|
||||
#include "bacenum.h"
|
||||
|
||||
typedef struct BACnet_Read_Property_Data {
|
||||
BACNET_OBJECT_TYPE object_type;
|
||||
@@ -48,11 +50,15 @@ typedef struct BACnet_Read_Property_Data {
|
||||
|
||||
typedef int (*read_property_function) (
|
||||
uint8_t * apdu,
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_ID property,
|
||||
int32_t array_index,
|
||||
BACNET_ERROR_CLASS * error_class,
|
||||
BACNET_ERROR_CODE * error_code);
|
||||
|
||||
typedef bool (*object_valid_instance_function) (
|
||||
uint32_t object_instance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -49,6 +49,10 @@ typedef struct BACnet_Read_Access_Data {
|
||||
struct BACnet_Read_Access_Data *next;
|
||||
} BACNET_READ_ACCESS_DATA;
|
||||
|
||||
typedef void (*rpm_property_lists_function) (
|
||||
const int **pRequired,
|
||||
const int **pOptional,
|
||||
const int **pProprietary);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -55,7 +55,6 @@ typedef struct BACnet_Write_Property_Data {
|
||||
|
||||
typedef bool (*write_property_function) (
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data,
|
||||
uint8_t * service_request,
|
||||
BACNET_ERROR_CLASS * error_class,
|
||||
BACNET_ERROR_CODE * error_code);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user