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:
skarg
2012-12-07 16:28:01 +00:00
parent 63df640a3f
commit 934fcbf012
6 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -569,7 +569,7 @@ bool Device_Valid_Object_Name(
struct object_functions *pObject = NULL;
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);
if (check_id) {
pObject = Device_Objects_Find_Functions(type);
+4 -4
View File
@@ -194,7 +194,7 @@ static object_functions_t My_Object_Table[] = {
NULL /* COV */ ,
NULL /* COV Clear */ ,
NULL /* Intrinsic Reporting */ },
#if 0
#if 0
{OBJECT_CHARACTERSTRING_VALUE,
CharacterString_Value_Init,
CharacterString_Value_Count,
@@ -210,7 +210,7 @@ static object_functions_t My_Object_Table[] = {
NULL /* COV */ ,
NULL /* COV Clear */ ,
NULL /* Intrinsic Reporting */ },
#endif
#endif
#if defined(INTRINSIC_REPORTING)
{OBJECT_NOTIFICATION_CLASS,
Notification_Class_Init,
@@ -304,7 +304,7 @@ static object_functions_t My_Object_Table[] = {
NULL /* COV */ ,
NULL /* COV Clear */ ,
NULL /* Intrinsic Reporting */ },
#endif
#endif
{OBJECT_TRENDLOG,
Trend_Log_Init,
Trend_Log_Count,
@@ -1025,7 +1025,7 @@ bool Device_Valid_Object_Name(
struct object_functions *pObject = NULL;
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);
if (check_id) {
pObject = Device_Objects_Find_Functions(type);
+1 -1
View File
@@ -575,7 +575,7 @@ bool Device_Valid_Object_Name(
struct my_object_functions *pObject = NULL;
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);
if (check_id) {
pObject = Device_Objects_Find_Functions((BACNET_OBJECT_TYPE) type);
+1 -1
View File
@@ -502,7 +502,7 @@ bool Device_Valid_Object_Name(
struct my_object_functions *pObject = NULL;
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);
if (check_id) {
pObject = Device_Objects_Find_Functions((BACNET_OBJECT_TYPE) type);
+1 -1
View File
@@ -547,7 +547,7 @@ bool Device_Valid_Object_Name(
char *name = NULL;
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);
if (check_id) {
name = Device_Valid_Object_Id(type, instance);
+1 -1
View File
@@ -561,7 +561,7 @@ bool Device_Valid_Object_Name(
struct my_object_functions *pObject = NULL;
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);
if (check_id) {
pObject = Device_Objects_Find_Functions((BACNET_OBJECT_TYPE) type);