A function in example device.c, Device_Object_List_Identifier, uses an array index, which starts at 1, not 0. Fixes WhoHas for last name in object list. Thank you, Peter van der Stok!
This commit is contained in:
@@ -569,7 +569,7 @@ bool Device_Valid_Object_Name(
|
|||||||
struct object_functions *pObject = NULL;
|
struct object_functions *pObject = NULL;
|
||||||
|
|
||||||
max_objects = Device_Object_List_Count();
|
max_objects = Device_Object_List_Count();
|
||||||
for (i = 0; i < max_objects; i++) {
|
for (i = 1; i <= max_objects; i++) {
|
||||||
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
||||||
if (check_id) {
|
if (check_id) {
|
||||||
pObject = Device_Objects_Find_Functions(type);
|
pObject = Device_Objects_Find_Functions(type);
|
||||||
|
|||||||
@@ -1025,7 +1025,7 @@ bool Device_Valid_Object_Name(
|
|||||||
struct object_functions *pObject = NULL;
|
struct object_functions *pObject = NULL;
|
||||||
|
|
||||||
max_objects = Device_Object_List_Count();
|
max_objects = Device_Object_List_Count();
|
||||||
for (i = 0; i < max_objects; i++) {
|
for (i = 1; i <= max_objects; i++) {
|
||||||
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
||||||
if (check_id) {
|
if (check_id) {
|
||||||
pObject = Device_Objects_Find_Functions(type);
|
pObject = Device_Objects_Find_Functions(type);
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ bool Device_Valid_Object_Name(
|
|||||||
struct my_object_functions *pObject = NULL;
|
struct my_object_functions *pObject = NULL;
|
||||||
|
|
||||||
max_objects = Device_Object_List_Count();
|
max_objects = Device_Object_List_Count();
|
||||||
for (i = 0; i < max_objects; i++) {
|
for (i = 1; i <= max_objects; i++) {
|
||||||
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
||||||
if (check_id) {
|
if (check_id) {
|
||||||
pObject = Device_Objects_Find_Functions((BACNET_OBJECT_TYPE) type);
|
pObject = Device_Objects_Find_Functions((BACNET_OBJECT_TYPE) type);
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ bool Device_Valid_Object_Name(
|
|||||||
struct my_object_functions *pObject = NULL;
|
struct my_object_functions *pObject = NULL;
|
||||||
|
|
||||||
max_objects = Device_Object_List_Count();
|
max_objects = Device_Object_List_Count();
|
||||||
for (i = 0; i < max_objects; i++) {
|
for (i = 1; i <= max_objects; i++) {
|
||||||
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
||||||
if (check_id) {
|
if (check_id) {
|
||||||
pObject = Device_Objects_Find_Functions((BACNET_OBJECT_TYPE) type);
|
pObject = Device_Objects_Find_Functions((BACNET_OBJECT_TYPE) type);
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ bool Device_Valid_Object_Name(
|
|||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
|
|
||||||
max_objects = Device_Object_List_Count();
|
max_objects = Device_Object_List_Count();
|
||||||
for (i = 0; i < max_objects; i++) {
|
for (i = 1; i <= max_objects; i++) {
|
||||||
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
||||||
if (check_id) {
|
if (check_id) {
|
||||||
name = Device_Valid_Object_Id(type, instance);
|
name = Device_Valid_Object_Id(type, instance);
|
||||||
|
|||||||
@@ -561,7 +561,7 @@ bool Device_Valid_Object_Name(
|
|||||||
struct my_object_functions *pObject = NULL;
|
struct my_object_functions *pObject = NULL;
|
||||||
|
|
||||||
max_objects = Device_Object_List_Count();
|
max_objects = Device_Object_List_Count();
|
||||||
for (i = 0; i < max_objects; i++) {
|
for (i = 1; i <= max_objects; i++) {
|
||||||
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
check_id = Device_Object_List_Identifier(i, &type, &instance);
|
||||||
if (check_id) {
|
if (check_id) {
|
||||||
pObject = Device_Objects_Find_Functions((BACNET_OBJECT_TYPE) type);
|
pObject = Device_Objects_Find_Functions((BACNET_OBJECT_TYPE) type);
|
||||||
|
|||||||
Reference in New Issue
Block a user