Esempio n. 1
0
//
//
// 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);
            // }
        }
Esempio n. 2
0
 public AtomicReadFileAck(BBoolean endOfFile, SignedInteger fileStartPosition, OctetString fileData) : base()
 {
     EndOfFile           = endOfFile;
     FileStartPosition   = fileStartPosition;
     FileData            = fileData;
     ReturnedRecordCount = null;
     FileRecordData      = null;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 public AtomicReadFileAck(BBoolean endOfFile, SignedInteger fileStartPosition,
                          UnsignedInteger returnedRecordCount,
                          SequenceOf fileRecordData) : base()
 {
     EndOfFile           = endOfFile;
     FileStartPosition   = fileStartPosition;
     FileData            = null;
     ReturnedRecordCount = returnedRecordCount;
     FileRecordData      = fileRecordData;
 }
Esempio n. 5
0
 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;
 }
 internal UnconfirmedEventNotificationRequest(ByteStream queue)
 {
     processIdentifier          = (UnsignedInteger)read(queue, typeof(UnsignedInteger), 0);
     initiatingDeviceIdentifier = (ObjectIdentifier)read(queue, typeof(ObjectIdentifier), 1);
     eventObjectIdentifier      = (ObjectIdentifier)read(queue, typeof(ObjectIdentifier), 2);
     timeStamp         = (TimeStamp)read(queue, typeof(TimeStamp), 3);
     notificationClass = (UnsignedInteger)read(queue, typeof(UnsignedInteger), 4);
     priority          = (UnsignedInteger)read(queue, typeof(UnsignedInteger), 5);
     eventType         = (EventType)read(queue, typeof(EventType), 6);
     messageText       = (CharacterString)readOptional(queue, typeof(CharacterString), 7);
     notifyType        = (NotifyType)read(queue, typeof(NotifyType), 8);
     ackRequired       = (BBoolean)readOptional(queue, typeof(BBoolean), 9);
     fromState         = (EventState)readOptional(queue, typeof(EventState), 10);
     toState           = (EventState)read(queue, typeof(EventState), 11);
     eventValues       = NotificationParameters.createNotificationParametersOptional(queue, 12);
 }
        private readonly NotificationParameters eventValues;          // 12 optional

        public UnconfirmedEventNotificationRequest(UnsignedInteger processIdentifier,
                                                   ObjectIdentifier initiatingDeviceIdentifier, ObjectIdentifier eventObjectIdentifier, TimeStamp timeStamp,
                                                   UnsignedInteger notificationClass, UnsignedInteger priority, EventType eventType,
                                                   CharacterString messageText, NotifyType notifyType, BBoolean ackRequired, EventState fromState,
                                                   EventState toState, NotificationParameters eventValues)
        {
            this.processIdentifier          = processIdentifier;
            this.initiatingDeviceIdentifier = initiatingDeviceIdentifier;
            this.eventObjectIdentifier      = eventObjectIdentifier;
            this.timeStamp         = timeStamp;
            this.notificationClass = notificationClass;
            this.priority          = priority;
            this.eventType         = eventType;
            this.messageText       = messageText;
            this.notifyType        = notifyType;
            this.ackRequired       = ackRequired;
            this.fromState         = fromState;
            this.toState           = toState;
            this.eventValues       = eventValues;
        }
Esempio n. 8
0
 public VtDataAck(BBoolean allNewDataAccepted, UnsignedInteger acceptedOctetCount)
 {
     AllNewDataAccepted = allNewDataAccepted;
     AcceptedOctetCount = acceptedOctetCount;
 }
 public GetEventInformationAck(SequenceOf listOfEventSummaries, BBoolean moreEvents)
 {
     ListOfEventSummaries = listOfEventSummaries;
     MoreEvents           = moreEvents;
 }
Esempio n. 10
0
 public Parameter(BBoolean primitive)
 {
     _primitive = primitive;
 }