Enable example apps to bind to device 4194303 (#615)

This commit is contained in:
Steve Karg
2024-04-04 10:58:44 -05:00
committed by GitHub
parent 41c11b23d3
commit 0cebc83d88
24 changed files with 77 additions and 77 deletions
+4 -4
View File
@@ -286,9 +286,9 @@ int main(int argc, char *argv[])
} else { } else {
if (target_args == 0) { if (target_args == 0) {
object_instance = strtoul(argv[argi], NULL, 0); object_instance = strtoul(argv[argi], NULL, 0);
if (object_instance >= BACNET_MAX_INSTANCE) { if (object_instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, fprintf(stderr,
"device-instance=%u - it must be less than %u\n", "device-instance=%u - not greater than %u\n",
object_instance, BACNET_MAX_INSTANCE); object_instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
@@ -304,9 +304,9 @@ int main(int argc, char *argv[])
target_args++; target_args++;
} else if (target_args == 2) { } else if (target_args == 2) {
object_instance = strtoul(argv[argi], NULL, 0); object_instance = strtoul(argv[argi], NULL, 0);
if (object_instance >= BACNET_MAX_INSTANCE) { if (object_instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, fprintf(stderr,
"device-instance=%u - it must be less than %u\n", "device-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+1 -1
View File
@@ -393,7 +393,7 @@ int main(int argc, char *argv[])
} }
} }
if (device_id > BACNET_MAX_INSTANCE) { if (device_id > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device=%u - it must be less than %u\n", device_id, fprintf(stderr, "device=%u - not greater than %u\n", device_id,
BACNET_MAX_INSTANCE); BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+4 -4
View File
@@ -274,9 +274,9 @@ int main(int argc, char *argv[])
} else { } else {
if (target_args == 0) { if (target_args == 0) {
object_instance = strtoul(argv[argi], NULL, 0); object_instance = strtoul(argv[argi], NULL, 0);
if (object_instance >= BACNET_MAX_INSTANCE) { if (object_instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, fprintf(stderr,
"device-instance=%u - it must be less than %u\n", "device-instance=%u - not greater than %u\n",
object_instance, BACNET_MAX_INSTANCE); object_instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
@@ -292,9 +292,9 @@ int main(int argc, char *argv[])
target_args++; target_args++;
} else if (target_args == 2) { } else if (target_args == 2) {
object_instance = strtoul(argv[argi], NULL, 0); object_instance = strtoul(argv[argi], NULL, 0);
if (object_instance >= BACNET_MAX_INSTANCE) { if (object_instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, fprintf(stderr,
"object-instance=%u - it must be less than %u\n", "object-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+3 -3
View File
@@ -157,7 +157,7 @@ static void print_help(char *filename)
"If you want disable Device Communications in Device 123\n" "If you want disable Device Communications in Device 123\n"
"for 60 minutes with password 'filister', use the following command:\n" "for 60 minutes with password 'filister', use the following command:\n"
"%s 123 1 60 filister\n", "%s 123 1 60 filister\n",
(unsigned long)(BACNET_MAX_INSTANCE - 1), filename); (unsigned long)BACNET_MAX_INSTANCE, filename);
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
@@ -207,8 +207,8 @@ int main(int argc, char *argv[])
if (argc > 4) { if (argc > 4) {
Communication_Password = argv[4]; Communication_Password = argv[4];
} }
if (Target_Device_Object_Instance >= BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\n", fprintf(stderr, "device-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+4 -4
View File
@@ -235,9 +235,9 @@ int main(int argc, char *argv[])
} else { } else {
if (target_args == 0) { if (target_args == 0) {
object_instance = strtoul(argv[argi], NULL, 0); object_instance = strtoul(argv[argi], NULL, 0);
if (object_instance >= BACNET_MAX_INSTANCE) { if (object_instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, fprintf(stderr,
"device-instance=%u - it must be less than %u\n", "device-instance=%u - not greater than %u\n",
object_instance, BACNET_MAX_INSTANCE); object_instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
@@ -253,9 +253,9 @@ int main(int argc, char *argv[])
target_args++; target_args++;
} else if (target_args == 2) { } else if (target_args == 2) {
object_instance = strtoul(argv[argi], NULL, 0); object_instance = strtoul(argv[argi], NULL, 0);
if (object_instance >= BACNET_MAX_INSTANCE) { if (object_instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, fprintf(stderr,
"object-instance=%u - it must be less than %u\n", "object-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+2 -2
View File
@@ -1135,8 +1135,8 @@ static int CheckCommandLineArgs(int argc, char *argv[])
Target_Device_Object_Instance = strtol(anArg, NULL, 0); Target_Device_Object_Instance = strtol(anArg, NULL, 0);
if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stdout, fprintf(stdout,
"Error: device-instance=%u - it must be less than %u\n", "Error: device-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE + 1); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
print_usage(filename); print_usage(filename);
exit(0); exit(0);
} }
+2 -2
View File
@@ -247,10 +247,10 @@ int main(int argc, char *argv[])
if (argc > 1) { if (argc > 1) {
first_object_instance = strtol(argv[1], NULL, 0); first_object_instance = strtol(argv[1], NULL, 0);
if ((first_object_instance == 0) || if ((first_object_instance == 0) ||
(first_object_instance >= BACNET_MAX_INSTANCE)) { (first_object_instance > BACNET_MAX_INSTANCE)) {
printf("Error: Invalid Object Instance %s \n", argv[1]); printf("Error: Invalid Object Instance %s \n", argv[1]);
printf( printf(
"Provide a number from 1 to %ul \n", BACNET_MAX_INSTANCE - 1); "Provide a number from 1 to %ul \n", BACNET_MAX_INSTANCE);
exit(1); exit(1);
} }
} }
+1 -1
View File
@@ -237,7 +237,7 @@ int main(int argc, char *argv[])
Target_Device_Object_Instance = strtol(argv[1 + Target_Mode], NULL, 0); Target_Device_Object_Instance = strtol(argv[1 + Target_Mode], NULL, 0);
if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\r\n", fprintf(stderr, "device-instance=%u - not greater than %u\r\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+5 -5
View File
@@ -297,14 +297,14 @@ int main(int argc, char *argv[])
Target_Device_Object_Instance = strtol(argv[1], NULL, 0); Target_Device_Object_Instance = strtol(argv[1], NULL, 0);
Target_File_Object_Instance = strtol(argv[2], NULL, 0); Target_File_Object_Instance = strtol(argv[2], NULL, 0);
Local_File_Name = argv[3]; Local_File_Name = argv[3];
if (Target_Device_Object_Instance >= BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\n", fprintf(stderr, "device-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
if (Target_File_Object_Instance >= BACNET_MAX_INSTANCE) { if (Target_File_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "file-instance=%u - it must be less than %u\n", fprintf(stderr, "file-instance=%u - not greater than %u\n",
Target_File_Object_Instance, BACNET_MAX_INSTANCE + 1); Target_File_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
/* setup my info */ /* setup my info */
+1 -1
View File
@@ -345,7 +345,7 @@ int main(int argc, char *argv[])
return 0; return 0;
} }
if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\n", fprintf(stderr, "device-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+4 -4
View File
@@ -406,9 +406,9 @@ int main(int argc, char *argv[])
} else { } else {
if (target_args == 0) { if (target_args == 0) {
Target_Device_Object_Instance = strtol(argv[argi], NULL, 0); Target_Device_Object_Instance = strtol(argv[argi], NULL, 0);
if (Target_Device_Object_Instance >= BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, fprintf(stderr,
"device-instance=%u - it must be less than %u\n", "device-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
@@ -445,9 +445,9 @@ int main(int argc, char *argv[])
rpm_object->object_instance = strtol(argv[argi], NULL, 0); rpm_object->object_instance = strtol(argv[argi], NULL, 0);
if (rpm_object->object_instance > BACNET_MAX_INSTANCE) { if (rpm_object->object_instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, fprintf(stderr,
"object-instance=%u - it must be less than %u\n", "object-instance=%u - not greater than %u\n",
rpm_object->object_instance, rpm_object->object_instance,
BACNET_MAX_INSTANCE + 1); BACNET_MAX_INSTANCE);
return 1; return 1;
} }
tag_value_arg++; tag_value_arg++;
+1 -1
View File
@@ -255,7 +255,7 @@ int main(int argc, char *argv[])
Target_Object_Range_Type = strtol(argv[5], NULL, 0); Target_Object_Range_Type = strtol(argv[5], NULL, 0);
/* some bounds checking */ /* some bounds checking */
if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\r\n", fprintf(stderr, "device-instance=%u - not greater than %u\r\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+2 -2
View File
@@ -167,8 +167,8 @@ int main(int argc, char *argv[])
Reinitialize_Password = argv[3]; Reinitialize_Password = argv[3];
} }
if (Target_Device_Object_Instance >= BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\r\n", fprintf(stderr, "device-instance=%u - not greater than %u\r\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+4 -4
View File
@@ -286,9 +286,9 @@ int main(int argc, char *argv[])
} else { } else {
if (target_args == 0) { if (target_args == 0) {
object_instance = strtoul(argv[argi], NULL, 0); object_instance = strtoul(argv[argi], NULL, 0);
if (object_instance >= BACNET_MAX_INSTANCE) { if (object_instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, fprintf(stderr,
"device-instance=%u - it must be less than %u\n", "device-instance=%u - not greater than %u\n",
object_instance, BACNET_MAX_INSTANCE); object_instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
@@ -304,9 +304,9 @@ int main(int argc, char *argv[])
target_args++; target_args++;
} else if (target_args == 2) { } else if (target_args == 2) {
object_instance = strtoul(argv[argi], NULL, 0); object_instance = strtoul(argv[argi], NULL, 0);
if (object_instance >= BACNET_MAX_INSTANCE) { if (object_instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, fprintf(stderr,
"device-instance=%u - it must be less than %u\n", "device-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+4 -4
View File
@@ -267,8 +267,8 @@ int main(int argc, char *argv[])
} }
/* decode the command line parameters */ /* decode the command line parameters */
Target_Device_Object_Instance = strtol(argv[1], NULL, 0); Target_Device_Object_Instance = strtol(argv[1], NULL, 0);
if (Target_Device_Object_Instance >= BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\n", fprintf(stderr, "device-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
@@ -294,9 +294,9 @@ int main(int argc, char *argv[])
strtol(argv[argi], NULL, 0); strtol(argv[argi], NULL, 0);
if (cov_data->monitoredObjectIdentifier.instance > if (cov_data->monitoredObjectIdentifier.instance >
BACNET_MAX_INSTANCE) { BACNET_MAX_INSTANCE) {
fprintf(stderr, "object-instance=%u - it must be less than %u\n", fprintf(stderr, "object-instance=%u - not greater than %u\n",
cov_data->monitoredObjectIdentifier.instance, cov_data->monitoredObjectIdentifier.instance,
BACNET_MAX_INSTANCE + 1); BACNET_MAX_INSTANCE);
return 1; return 1;
} }
argi++; argi++;
+2 -2
View File
@@ -125,7 +125,7 @@ int main(int argc, char *argv[])
if (++argi < argc) { if (++argi < argc) {
device_id = strtol(argv[argi], NULL, 0); device_id = strtol(argv[argi], NULL, 0);
if (device_id > BACNET_MAX_INSTANCE) { if (device_id > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device=%u - it must be less than %u\n", fprintf(stderr, "device=%u - not greater than %u\n",
device_id, BACNET_MAX_INSTANCE); device_id, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
} }
Device_Set_Object_Instance_Number(device_id); Device_Set_Object_Instance_Number(device_id);
if (target_device_object_instance > BACNET_MAX_INSTANCE) { if (target_device_object_instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\n", fprintf(stderr, "device-instance=%u - not greater than %u\n",
target_device_object_instance, BACNET_MAX_INSTANCE); target_device_object_instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+1 -1
View File
@@ -254,7 +254,7 @@ int main(int argc, char *argv[])
} }
} }
if (device_id > BACNET_MAX_INSTANCE) { if (device_id > BACNET_MAX_INSTANCE) {
debug_perror("device-instance=%u - it must be less than %u\n", debug_perror("device-instance=%u - not greater than %u\n",
device_id, BACNET_MAX_INSTANCE); device_id, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+6 -6
View File
@@ -176,8 +176,8 @@ int main(int argc, char *argv[])
value_list.propertyArrayIndex = BACNET_ARRAY_ALL; value_list.propertyArrayIndex = BACNET_ARRAY_ALL;
} }
if (cov_data.initiatingDeviceIdentifier >= BACNET_MAX_INSTANCE) { if (cov_data.initiatingDeviceIdentifier > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\n", fprintf(stderr, "device-instance=%u - not greater than %u\n",
cov_data.initiatingDeviceIdentifier, BACNET_MAX_INSTANCE); cov_data.initiatingDeviceIdentifier, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
@@ -187,15 +187,15 @@ int main(int argc, char *argv[])
return 1; return 1;
} }
if (cov_data.monitoredObjectIdentifier.instance > BACNET_MAX_INSTANCE) { if (cov_data.monitoredObjectIdentifier.instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "object-instance=%u - it must be less than %u\n", fprintf(stderr, "object-instance=%u - not greater than %u\n",
cov_data.monitoredObjectIdentifier.instance, cov_data.monitoredObjectIdentifier.instance,
BACNET_MAX_INSTANCE + 1); BACNET_MAX_INSTANCE);
return 1; return 1;
} }
if (cov_data.listOfValues->propertyIdentifier > MAX_BACNET_PROPERTY_ID) { if (cov_data.listOfValues->propertyIdentifier > MAX_BACNET_PROPERTY_ID) {
fprintf(stderr, "property-identifier=%u - it must be less than %u\n", fprintf(stderr, "property-identifier=%u - not greater than %u\n",
cov_data.listOfValues->propertyIdentifier, cov_data.listOfValues->propertyIdentifier,
MAX_BACNET_PROPERTY_ID + 1); MAX_BACNET_PROPERTY_ID);
return 1; return 1;
} }
if (tag >= MAX_BACNET_APPLICATION_TAG) { if (tag >= MAX_BACNET_APPLICATION_TAG) {
+1 -1
View File
@@ -229,7 +229,7 @@ int main(int argc, char *argv[])
Target_Service_Number = strtol(argv[3], NULL, 0); Target_Service_Number = strtol(argv[3], NULL, 0);
if ((!Target_Broadcast) && if ((!Target_Broadcast) &&
(Target_Device_Object_Instance > BACNET_MAX_INSTANCE)) { (Target_Device_Object_Instance > BACNET_MAX_INSTANCE)) {
fprintf(stderr, "device-instance=%u - it must be less than %u\n", fprintf(stderr, "device-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
+8 -8
View File
@@ -196,24 +196,24 @@ int main(int argc, char *argv[])
} }
} else { } else {
if (Target_Object_Instance > BACNET_MAX_INSTANCE) { if (Target_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "object-instance=%u - it must be less than %u\r\n", fprintf(stderr, "object-instance=%u - not greater than %u\r\n",
Target_Object_Instance, BACNET_MAX_INSTANCE + 1); Target_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
if (Target_Object_Type > BACNET_MAX_OBJECT) { if (Target_Object_Type > BACNET_MAX_OBJECT) {
fprintf(stderr, "object-type=%u - it must be less than %u\r\n", fprintf(stderr, "object-type=%u - not greater than %u\r\n",
Target_Object_Type, BACNET_MAX_OBJECT + 1); Target_Object_Type, BACNET_MAX_OBJECT);
return 1; return 1;
} }
} }
if (Target_Object_Instance_Min > BACNET_MAX_INSTANCE) { if (Target_Object_Instance_Min > BACNET_MAX_INSTANCE) {
fprintf(stderr, "object-instance-min=%u - it must be less than %u\r\n", fprintf(stderr, "object-instance-min=%u - not greater than %u\r\n",
Target_Object_Instance_Min, BACNET_MAX_INSTANCE + 1); Target_Object_Instance_Min, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
if (Target_Object_Instance_Max > BACNET_MAX_INSTANCE) { if (Target_Object_Instance_Max > BACNET_MAX_INSTANCE) {
fprintf(stderr, "object-instance-max=%u - it must be less than %u\r\n", fprintf(stderr, "object-instance-max=%u - not greater than %u\r\n",
Target_Object_Instance_Max, BACNET_MAX_INSTANCE + 1); Target_Object_Instance_Max, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
/* setup my info */ /* setup my info */
+4 -4
View File
@@ -462,13 +462,13 @@ int main(int argc, char *argv[])
} }
} }
if (Target_Object_Instance_Min > BACNET_MAX_INSTANCE) { if (Target_Object_Instance_Min > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance-min=%u - it must be less than %u\n", fprintf(stderr, "device-instance-min=%u - not greater than %u\n",
Target_Object_Instance_Min, BACNET_MAX_INSTANCE + 1); Target_Object_Instance_Min, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
if (Target_Object_Instance_Max > BACNET_MAX_INSTANCE) { if (Target_Object_Instance_Max > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance-max=%u - it must be less than %u\n", fprintf(stderr, "device-instance-max=%u - not greater than %u\n",
Target_Object_Instance_Max, BACNET_MAX_INSTANCE + 1); Target_Object_Instance_Max, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
/* setup my info */ /* setup my info */
+5 -5
View File
@@ -174,14 +174,14 @@ int main(int argc, char *argv[])
Target_Device_Object_Instance = strtol(argv[1], NULL, 0); Target_Device_Object_Instance = strtol(argv[1], NULL, 0);
Target_File_Object_Instance = strtol(argv[2], NULL, 0); Target_File_Object_Instance = strtol(argv[2], NULL, 0);
Local_File_Name = argv[3]; Local_File_Name = argv[3];
if (Target_Device_Object_Instance >= BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\r\n", fprintf(stderr, "device-instance=%u - not greater than %u\r\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
if (Target_File_Object_Instance >= BACNET_MAX_INSTANCE) { if (Target_File_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "file-instance=%u - it must be less than %u\r\n", fprintf(stderr, "file-instance=%u - not greater than %u\r\n",
Target_File_Object_Instance, BACNET_MAX_INSTANCE + 1); Target_File_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
if (argc > 4) { if (argc > 4) {
+4 -4
View File
@@ -304,8 +304,8 @@ int main(int argc, char *argv[])
Target_Object_Property_Index = BACNET_ARRAY_ALL; Target_Object_Property_Index = BACNET_ARRAY_ALL;
} }
if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\n", fprintf(stderr, "device-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE + 1); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
if (Target_Object_Type > MAX_BACNET_OBJECT_TYPE) { if (Target_Object_Type > MAX_BACNET_OBJECT_TYPE) {
@@ -314,8 +314,8 @@ int main(int argc, char *argv[])
return 1; return 1;
} }
if (Target_Object_Instance > BACNET_MAX_INSTANCE) { if (Target_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "object-instance=%u - it must be less than %u\n", fprintf(stderr, "object-instance=%u - not greater than %u\n",
Target_Object_Instance, BACNET_MAX_INSTANCE + 1); Target_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
if (Target_Object_Property > MAX_BACNET_PROPERTY_ID) { if (Target_Object_Property > MAX_BACNET_PROPERTY_ID) {
+4 -4
View File
@@ -313,8 +313,8 @@ int main(int argc, char *argv[])
} }
/* decode the command line parameters */ /* decode the command line parameters */
Target_Device_Object_Instance = strtol(argv[1], NULL, 0); Target_Device_Object_Instance = strtol(argv[1], NULL, 0);
if (Target_Device_Object_Instance >= BACNET_MAX_INSTANCE) { if (Target_Device_Object_Instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "device-instance=%u - it must be less than %u\n", fprintf(stderr, "device-instance=%u - not greater than %u\n",
Target_Device_Object_Instance, BACNET_MAX_INSTANCE); Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
@@ -357,8 +357,8 @@ int main(int argc, char *argv[])
return 1; return 1;
} }
if (wpm_object->object_instance > BACNET_MAX_INSTANCE) { if (wpm_object->object_instance > BACNET_MAX_INSTANCE) {
fprintf(stderr, "object-instance=%u - it must be less than %u\n", fprintf(stderr, "object-instance=%u - not greater than %u\n",
wpm_object->object_instance, BACNET_MAX_INSTANCE + 1); wpm_object->object_instance, BACNET_MAX_INSTANCE);
return 1; return 1;
} }
do { do {