diff --git a/lib/bacnet-services.js b/lib/bacnet-services.js index e475c226..16de1953 100644 --- a/lib/bacnet-services.js +++ b/lib/bacnet-services.js @@ -398,7 +398,7 @@ module.exports.DecodeReinitializeDevice = function(buffer, offset, apduLen) { module.exports.EncodeReadRange = function(buffer, objectId, propertyId, arrayIndex, requestType, position, time, count) { baAsn1.encode_context_objectId(buffer, 0, objectId.type, objectId.instance); baAsn1.encodeContextEnumerated(buffer, 1, propertyId); - if (arrayIndex === baAsn1.BACNET_ARRAY_ALL) { + if (arrayIndex !== baAsn1.BACNET_ARRAY_ALL) { baAsn1.encodeContextUnsigned(buffer, 2, arrayIndex); } switch (requestType) { @@ -525,7 +525,7 @@ module.exports.DecodeReadPropertyMultipleAcknowledge = function(buffer, offset, module.exports.EncodeWriteProperty = function(buffer, objectType, objectInstance, propertyId, arrayIndex, priority, valueList) { baAsn1.encode_context_object_id(buffer, 0, objectType, objectInstance); baAsn1.encodeContextEnumerated(buffer, 1, propertyId); - if (arrayIndex === baAsn1.BACNET_ARRAY_ALL) { + if (arrayIndex !== baAsn1.BACNET_ARRAY_ALL) { baAsn1.encodeContextUnsigned(buffer, 2, arrayIndex); } baAsn1.encode_opening_tag(buffer, 3); @@ -533,7 +533,7 @@ module.exports.EncodeWriteProperty = function(buffer, objectType, objectInstance baAsn1.bacapp_encode_application_data(buffer, value); }); baAsn1.encode_closing_tag(buffer, 3); - if (priority === baAsn1.BACNET_NO_PRIORITY) { + if (priority !== baAsn1.BACNET_NO_PRIORITY) { baAsn1.encodeContextUnsigned(buffer, 4, priority); } }; @@ -543,7 +543,7 @@ var EncodeWritePropertyMultiple = module.exports.EncodeWritePropertyMultiple = f baAsn1.encode_opening_tag(buffer, 1); valueList.forEach(function(pValue) { baAsn1.encodeContextEnumerated(buffer, 0, pValue.property.propertyIdentifier); - if (pValue.property.propertyArrayIndex === baAsn1.BACNET_ARRAY_ALL) { + if (pValue.property.propertyArrayIndex !== baAsn1.BACNET_ARRAY_ALL) { baAsn1.encodeContextUnsigned(buffer, 1, pValue.property.propertyArrayIndex); } baAsn1.encode_opening_tag(buffer, 2); @@ -551,7 +551,7 @@ var EncodeWritePropertyMultiple = module.exports.EncodeWritePropertyMultiple = f baAsn1.bacapp_encode_application_data(buffer, value); }); baAsn1.encode_closing_tag(buffer, 2); - if (pValue.priority === baAsn1.BACNET_NO_PRIORITY) { + if (pValue.priority !== baAsn1.BACNET_NO_PRIORITY) { baAsn1.encodeContextUnsigned(buffer, 3, pValue.priority); } });