Feature/add-device-object-functions-find-api (#1115)
* Added Device_Object_Functions_Find() API to enable override of basic object API function. * Added Device_Object_Functions() API to return basic object API table of functions for all objects.
This commit is contained in:
@@ -187,8 +187,8 @@ static object_functions_t Object_Table[] = {
|
||||
* @return Pointer to the group of object helper functions that implement this
|
||||
* type of Object.
|
||||
*/
|
||||
static struct object_functions *
|
||||
Device_Objects_Find_Functions(BACNET_OBJECT_TYPE Object_Type)
|
||||
struct object_functions *
|
||||
Device_Object_Functions_Find(BACNET_OBJECT_TYPE Object_Type)
|
||||
{
|
||||
struct object_functions *pObject = NULL;
|
||||
|
||||
@@ -220,7 +220,7 @@ rr_info_function Device_Objects_RR_Info(BACNET_OBJECT_TYPE object_type)
|
||||
{
|
||||
struct object_functions *pObject = NULL;
|
||||
|
||||
pObject = Device_Objects_Find_Functions(object_type);
|
||||
pObject = Device_Object_Functions_Find(object_type);
|
||||
return (pObject != NULL ? pObject->Object_RR_Info : NULL);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ void Device_Objects_Property_List(
|
||||
* to populate the pointers to the individual list counters.
|
||||
*/
|
||||
|
||||
pObject = Device_Objects_Find_Functions(object_type);
|
||||
pObject = Device_Object_Functions_Find(object_type);
|
||||
if ((pObject != NULL) && (pObject->Object_RPM_List != NULL)) {
|
||||
pObject->Object_RPM_List(
|
||||
&pPropertyList->Required.pList, &pPropertyList->Optional.pList,
|
||||
@@ -860,7 +860,7 @@ bool Device_Valid_Object_Name(
|
||||
for (i = 1; i <= max_objects; i++) {
|
||||
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
||||
if (check_id) {
|
||||
pObject = Device_Objects_Find_Functions(type);
|
||||
pObject = Device_Object_Functions_Find(type);
|
||||
if ((pObject != NULL) && (pObject->Object_Name != NULL) &&
|
||||
(pObject->Object_Name(instance, &object_name2) &&
|
||||
characterstring_same(object_name1, &object_name2))) {
|
||||
@@ -890,7 +890,7 @@ bool Device_Valid_Object_Id(
|
||||
bool status = false; /* return value */
|
||||
struct object_functions *pObject = NULL;
|
||||
|
||||
pObject = Device_Objects_Find_Functions(object_type);
|
||||
pObject = Device_Object_Functions_Find(object_type);
|
||||
if ((pObject != NULL) && (pObject->Object_Valid_Instance != NULL)) {
|
||||
status = pObject->Object_Valid_Instance(object_instance);
|
||||
}
|
||||
@@ -912,7 +912,7 @@ bool Device_Object_Name_Copy(
|
||||
struct object_functions *pObject = NULL;
|
||||
bool found = false;
|
||||
|
||||
pObject = Device_Objects_Find_Functions(object_type);
|
||||
pObject = Device_Object_Functions_Find(object_type);
|
||||
if (pObject != NULL) {
|
||||
if (pObject->Object_Valid_Instance &&
|
||||
pObject->Object_Valid_Instance(object_instance)) {
|
||||
@@ -1219,7 +1219,7 @@ int Device_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
/* initialize the default return values */
|
||||
rpdata->error_class = ERROR_CLASS_OBJECT;
|
||||
rpdata->error_code = ERROR_CODE_UNKNOWN_OBJECT;
|
||||
pObject = Device_Objects_Find_Functions(rpdata->object_type);
|
||||
pObject = Device_Object_Functions_Find(rpdata->object_type);
|
||||
if (pObject != NULL) {
|
||||
if (pObject->Object_Valid_Instance &&
|
||||
pObject->Object_Valid_Instance(rpdata->object_instance)) {
|
||||
@@ -1335,7 +1335,7 @@ bool Device_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
/* initialize the default return values */
|
||||
wp_data->error_class = ERROR_CLASS_OBJECT;
|
||||
wp_data->error_code = ERROR_CODE_UNKNOWN_OBJECT;
|
||||
pObject = Device_Objects_Find_Functions(wp_data->object_type);
|
||||
pObject = Device_Object_Functions_Find(wp_data->object_type);
|
||||
if (pObject != NULL) {
|
||||
if (pObject->Object_Valid_Instance &&
|
||||
pObject->Object_Valid_Instance(wp_data->object_instance)) {
|
||||
|
||||
Reference in New Issue
Block a user