Changed value of MAX OBJECT type to be consistent with other MAX values, and fixed places that relied on this value (most had a hack in place).

This commit is contained in:
skarg
2010-02-11 04:30:20 +00:00
parent bf0a6ab43d
commit 63d7a8018d
5 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -203,9 +203,9 @@ int main(
Target_Device_Object_Instance, BACNET_MAX_INSTANCE);
return 1;
}
if (Target_Object_Type > MAX_BACNET_OBJECT_TYPE) {
if (Target_Object_Type >= MAX_BACNET_OBJECT_TYPE) {
fprintf(stderr, "object-type=%u - it must be less than %u\r\n",
Target_Object_Type, MAX_BACNET_OBJECT_TYPE + 1);
Target_Object_Type, MAX_BACNET_OBJECT_TYPE);
return 1;
}
if (Target_Object_Instance > BACNET_MAX_INSTANCE) {
+2 -2
View File
@@ -243,9 +243,9 @@ int main(
fprintf(stderr, "Error: not enough object property quads.\r\n");
return 1;
}
if (rpm_object->object_type > MAX_BACNET_OBJECT_TYPE) {
if (rpm_object->object_type >= MAX_BACNET_OBJECT_TYPE) {
fprintf(stderr, "object-type=%u - it must be less than %u\r\n",
rpm_object->object_type, MAX_BACNET_OBJECT_TYPE + 1);
rpm_object->object_type, MAX_BACNET_OBJECT_TYPE);
return 1;
}
rpm_object->object_instance = strtol(argv[tag_value_arg], NULL, 0);
+2 -2
View File
@@ -158,10 +158,10 @@ int main(
cov_data.initiatingDeviceIdentifier, BACNET_MAX_INSTANCE);
return 1;
}
if (cov_data.monitoredObjectIdentifier.type > MAX_BACNET_OBJECT_TYPE) {
if (cov_data.monitoredObjectIdentifier.type >= MAX_BACNET_OBJECT_TYPE) {
fprintf(stderr, "object-type=%u - it must be less than %u\r\n",
cov_data.monitoredObjectIdentifier.type,
MAX_BACNET_OBJECT_TYPE + 1);
MAX_BACNET_OBJECT_TYPE);
return 1;
}
if (cov_data.monitoredObjectIdentifier.instance > BACNET_MAX_INSTANCE) {
+1 -1
View File
@@ -173,7 +173,7 @@ void testIHave(
data.device_id.instance <= BACNET_MAX_INSTANCE;
data.device_id.instance <<= 1) {
for (data.object_id.type = OBJECT_ANALOG_INPUT;
data.object_id.type <= MAX_BACNET_OBJECT_TYPE;
data.object_id.type < MAX_BACNET_OBJECT_TYPE;
data.object_id.type++) {
for (data.object_id.instance = 1;
data.object_id.instance <= BACNET_MAX_INSTANCE;
+1 -1
View File
@@ -218,7 +218,7 @@ void testWhoHas(
data.high_limit += (BACNET_MAX_INSTANCE / 4)) {
data.object_name = false;
for (data.object.identifier.type = OBJECT_ANALOG_INPUT;
data.object.identifier.type <= MAX_BACNET_OBJECT_TYPE;
data.object.identifier.type < MAX_BACNET_OBJECT_TYPE;
data.object.identifier.type++) {
for (data.object.identifier.instance = 1;
data.object.identifier.instance <= BACNET_MAX_INSTANCE;