public Encodable getProperty(PropertyIdentifier pid, UnsignedInteger propertyArrayIndex) { Encodable result = getProperty(pid); if (propertyArrayIndex == null) { return(result); } if (!(result is SequenceOf)) { throw new BACnetServiceException(ErrorClass.Property, ErrorCode.PropertyIsNotAnArray); } SequenceOf array = (SequenceOf )result; uint index = propertyArrayIndex.Value; if (index == 0) { return(new UnsignedInteger((uint)array.Count)); } if (index > array.getCount()) { throw new BACnetServiceException(ErrorClass.Property, ErrorCode.InvalidArrayIndex); } return(array.Get((int)index)); }
public OutOfRange(UnsignedInteger timeDelay, Real lowLimit, Real highLimit, Real deadband) { TimeDelay = timeDelay; LowLimit = lowLimit; HighLimit = highLimit; Deadband = deadband; }
// // // COV subscriptions // public void addCovSubscription(Address from, OctetString linkService, UnsignedInteger subscriberProcessIdentifier, BBoolean issueConfirmedNotifications, UnsignedInteger lifetime) { //synchronized (covSubscriptions) { ObjectCovSubscription sub = findCovSubscription(from, subscriberProcessIdentifier); bool confirmed = issueConfirmedNotifications.Value; if (sub == null) { // Ensure that this object is valid for COV notifications. if (!ObjectCovSubscription.SendCovNotification(Id.ObjectType, null, this.getCovIncrement())) { throw new BACnetServiceException(ErrorClass.Services, ErrorCode.CovSubscriptionFailed, "Object is invalid for COV notifications"); } if (confirmed) { // If the peer wants confirmed notifications, it must be in the remote device list. RemoteDevice d = localDevice.getRemoteDevice(from); if (d == null) { throw new BACnetServiceException(ErrorClass.Services, ErrorCode.CovSubscriptionFailed, "From address not found in remote device list. Cannot send confirmed notifications"); } } sub = new ObjectCovSubscription(from, linkService, subscriberProcessIdentifier, this.getCovIncrement()); covSubscriptions.Add(sub); } sub.SetIssueConfirmedNotifications(issueConfirmedNotifications.Value); sub.SetExpiryTime((int)lifetime.Value); // } }
public ObjectPropertyReference(ObjectIdentifier objectIdentifier, PropertyIdentifier propertyIdentifier, UnsignedInteger propertyArrayIndex) { this.ObjectIdentifier = objectIdentifier; this.PropertyIdentifier = propertyIdentifier; this.PropertyArrayIndex = propertyArrayIndex; }
private void sendCovNotification(ObjectCovSubscription sub, long now) { try { UnsignedInteger timeLeft = new UnsignedInteger(sub.GetTimeRemaining(now)); SequenceOf values = new SequenceOf(ObjectCovSubscription.GetValues(this)); if (sub.IsIssueConfirmedNotifications) { // Confirmed ConfirmedCovNotificationRequest req = new ConfirmedCovNotificationRequest( sub.SubscriberProcessIdentifier, localDevice.Configuration.Id, Id, timeLeft, values); RemoteDevice d = localDevice.getRemoteDevice(sub.Address); localDevice.send(d, req); } else { // Unconfirmed UnconfirmedCovNotificationRequest req = new UnconfirmedCovNotificationRequest( sub.SubscriberProcessIdentifier, localDevice.Configuration.Id, Id, timeLeft, values); localDevice.sendUnconfirmed(sub.Address, sub.LinkService, req); } } catch (BACnetException e) { throw e; //ExceptionDispatch.fireReceivedException(e); } }
internal IAmRequest(ByteStream queue) { iAmDeviceIdentifier = new ObjectIdentifier(queue); maxAPDULengthAccepted = new UnsignedInteger(queue); segmentationSupported = new Segmentation(queue); vendorId = new UnsignedInteger(queue); }
public UnconfirmedPrivateTransferRequest(UnsignedInteger vendorId, UnsignedInteger serviceNumber, Encodable serviceParameters) { this.vendorId = vendorId; this.serviceNumber = serviceNumber; this.serviceParameters = serviceParameters; }
public BufferReady(DeviceObjectPropertyReference bufferProperty, UnsignedInteger previousNotification, UnsignedInteger currentNotification) { BufferProperty = bufferProperty; PreviousNotification = previousNotification; CurrentNotification = currentNotification; }
public ConfirmedPrivateTransferError(byte choice, BACnetError error, UnsignedInteger vendorId, UnsignedInteger serviceNumber, BaseType errorParameters) : base(choice, error) { this.vendorId = vendorId; this.serviceNumber = serviceNumber; this.errorParameters = errorParameters; }
public AccumulatorRecord(DateTime timestamp, UnsignedInteger presentValue, UnsignedInteger accumulatedValue, AccumulatorStatus accumulatorStatus) { Timestamp = timestamp; PresentValue = presentValue; AccumulatedValue = accumulatedValue; AccumulatorStatusValue = accumulatorStatus; }
public IAmRequest(ObjectIdentifier iamDeviceIdentifier, UnsignedInteger maxAPDULengthAccepted, Segmentation segmentationSupported, UnsignedInteger vendorId) { iAmDeviceIdentifier = iamDeviceIdentifier; this.maxAPDULengthAccepted = maxAPDULengthAccepted; this.segmentationSupported = segmentationSupported; this.vendorId = vendorId; }
public PropertyValue(PropertyIdentifier propertyIdentifier, UnsignedInteger propertyArrayIndex, Encodable value, UnsignedInteger priority) { this.PropertyIdentifier = propertyIdentifier; this.PropertyArrayIndex = propertyArrayIndex; this.Value = value; this.Priority = priority; }
public ChangeOfLifeSafety(UnsignedInteger timeDelay, SequenceOf listOfLifeSafetyAlarmValues, SequenceOf listOfAlarmValues, DeviceObjectPropertyReference modePropertyReference) { TimeDelay = timeDelay; ListOfLifeSafetyAlarmValues = listOfLifeSafetyAlarmValues; ListOfAlarmValues = listOfAlarmValues; ModePropertyReference = modePropertyReference; }
public ReadPropertyAck(ObjectIdentifier eventObjectIdentifier, PropertyIdentifier propertyIdentifier, UnsignedInteger propertyArrayIndex, Encodable value) { EventObjectIdentifier = eventObjectIdentifier; PropertyIdentifier = propertyIdentifier; PropertyArrayIndex = propertyArrayIndex; Value = value; }
public DeviceObjectPropertyReference(ObjectIdentifier objectIdentifier, PropertyIdentifier propertyIdentifier, UnsignedInteger propertyArrayIndex, ObjectIdentifier deviceIdentifier) { ObjectIdentifier = objectIdentifier; PropertyIdentifier = propertyIdentifier; PropertyArrayIndex = propertyArrayIndex; DeviceIdentifier = deviceIdentifier; }
public EnrollmentSummary(ObjectIdentifier objectIdentifier, EventType eventType, EventState eventState, UnsignedInteger priority, UnsignedInteger notificationClass) { this.ObjectIdentifier = objectIdentifier; this.EventType = eventType; this.EventState = eventState; this.Priority = priority; this.NotificationClass = notificationClass; }
public Limits(UnsignedInteger deviceInstanceRangeLowLimit, UnsignedInteger deviceInstanceRangeHighLimit) { if (deviceInstanceRangeLowLimit == null || deviceInstanceRangeHighLimit == null) { throw new System.Exception("Both the low and high limits must be set"); } this.DeviceInstanceRangeLowLimit = deviceInstanceRangeLowLimit; this.DeviceInstanceRangeHighLimit = deviceInstanceRangeHighLimit; }
public CovSubscription(RecipientProcess recipient, ObjectPropertyReference monitoredPropertyReference, BBoolean issueConfirmedNotifications, UnsignedInteger timeRemaining, Real covIncrement) { this.Recipient = recipient; this.MonitoredPropertyReference = monitoredPropertyReference; this.IssueConfirmedNotifications = issueConfirmedNotifications; this.TimeRemaining = timeRemaining; this.CovIncrement = covIncrement; }
public ObjectCovSubscription(Address address, OctetString linkService, UnsignedInteger subscriberProcessIdentifier, Real covIncrement) { this.Address = address; this.LinkService = linkService; this.SubscriberProcessIdentifier = subscriberProcessIdentifier; this.covIncrement = covIncrement; }
public AtomicReadFileAck(BBoolean endOfFile, SignedInteger fileStartPosition, UnsignedInteger returnedRecordCount, SequenceOf fileRecordData) : base() { EndOfFile = endOfFile; FileStartPosition = fileStartPosition; FileData = null; ReturnedRecordCount = returnedRecordCount; FileRecordData = fileRecordData; }
public Encodable getPropertyRequired(PropertyIdentifier pid, UnsignedInteger propertyArrayIndex) { Encodable p = getProperty(pid, propertyArrayIndex); if (p == null) { throw new BACnetServiceException(ErrorClass.Property, ErrorCode.UnknownProperty); } return(p); }
public FloatingLimit(UnsignedInteger timeDelay, DeviceObjectPropertyReference setpointReference, Real lowDiffLimit, Real highDiffLimit, Real deadband) { TimeDelay = timeDelay; SetpointReference = setpointReference; LowDiffLimit = lowDiffLimit; HighDiffLimit = highDiffLimit; Deadband = deadband; }
private readonly SequenceOf listOfValues; //<PropertyValue> public UnconfirmedCovNotificationRequest(UnsignedInteger subscriberProcessIdentifier, ObjectIdentifier initiatingDeviceIdentifier, ObjectIdentifier monitoredObjectIdentifier, UnsignedInteger timeRemaining, SequenceOf listOfValues) { this.subscriberProcessIdentifier = subscriberProcessIdentifier; this.initiatingDeviceIdentifier = initiatingDeviceIdentifier; this.monitoredObjectIdentifier = monitoredObjectIdentifier; this.timeRemaining = timeRemaining; this.listOfValues = listOfValues; }
public void removeCovSubscription(Address from, UnsignedInteger subscriberProcessIdentifier) { //synchronized(covSubscriptions) { ObjectCovSubscription sub = findCovSubscription(from, subscriberProcessIdentifier); if (sub != null) { covSubscriptions.Remove(sub); } //} }
public ReadRangeAck(ObjectIdentifier objectIdentifier, PropertyIdentifier propertyIdentifier, UnsignedInteger propertyArrayIndex, ResultFlags resultFlags, UnsignedInteger itemCount, SequenceOf itemData, UnsignedInteger firstSequenceNumber) { ObjectIdentifier = objectIdentifier; PropertyIdentifier = propertyIdentifier; PropertyArrayIndex = propertyArrayIndex; ResultFlags = resultFlags; ItemCount = itemCount; ItemData = itemData; FirstSequenceNumber = firstSequenceNumber; }
private ObjectCovSubscription findCovSubscription(Address from, UnsignedInteger subscriberProcessIdentifier) { foreach (ObjectCovSubscription sub in covSubscriptions) { if (sub.Address.Equals(from) && sub.SubscriberProcessIdentifier.Equals(subscriberProcessIdentifier)) { return(sub); } } return(null); }
public ActionCommand(ObjectIdentifier deviceIdentifier, ObjectIdentifier objectIdentifier, PropertyIdentifier propertyIdentifier, UnsignedInteger propertyArrayIndex, Encodable propertyValue, UnsignedInteger priority, UnsignedInteger postDelay, BBoolean quitOnFailure, BBoolean writeSuccessful) { DeviceIdentifier = deviceIdentifier; ObjectIdentifier = objectIdentifier; PropertyIdentifier = propertyIdentifier; PropertyArrayIndex = propertyArrayIndex; PropertyValue = propertyValue; Priority = priority; PostDelay = postDelay; QuitOnFailure = quitOnFailure; WriteSuccessful = writeSuccessful; }
public void setCommandable(Encodable value, UnsignedInteger priority) { uint pri = 16; if (priority != null) { pri = priority.Value; } PriorityArray priorityArray = (PriorityArray)getProperty(PropertyIdentifier.PriorityArray); priorityArray.set((int)pri, createCommandValue(value)); setCommandableImpl(priorityArray); }
public void removeProperty(PropertyIdentifier pid, UnsignedInteger propertyArrayIndex) { PropertyTypeDefinition def = ObjectProperties.getPropertyTypeDefinitionRequired(Id.ObjectType, pid); if (!def.IsSequence) { throw new BACnetServiceException(ErrorClass.Property, ErrorCode.InvalidArrayIndex); } SequenceOf sequence = (SequenceOf)properties[pid]; if (sequence != null) { sequence.remove((int)propertyArrayIndex.Value); } }
internal UnconfirmedCovNotificationRequest(ByteStream queue) { subscriberProcessIdentifier = (UnsignedInteger)read(queue, typeof(UnsignedInteger), 0); initiatingDeviceIdentifier = (ObjectIdentifier)read(queue, typeof(ObjectIdentifier), 1); monitoredObjectIdentifier = (ObjectIdentifier)read(queue, typeof(ObjectIdentifier), 2); timeRemaining = (UnsignedInteger)read(queue, typeof(UnsignedInteger), 3); try { ThreadLocalObjectTypeStack.set(monitoredObjectIdentifier.ObjectType); listOfValues = readSequenceOf(queue, typeof(PropertyValue), 4); } finally { ThreadLocalObjectTypeStack.remove(); } }