Ejemplo n.º 1
0
            /// <summary>
            /// Executes the refresh task
            /// </summary>
            /// <param name="db">The database that is executing the task</param>
            public void Execute(NetworkDatabase db)
            {
                var client = new Client(db._host);
                var queue  = new ReadQueue(client);

                ObjectInfo[] infos = new ObjectInfo[ObjectIdentifiers.Length];

                for (int i = 0; i < infos.Length; i++)
                {
                    infos[i] = db._options.DescriptorRegistrar.CreateDescriptor(
                        VendorId,
                        DeviceInstance,
                        ObjectIdentifiers[i]);

                    infos[i].Refresh(queue);
                }

                try
                {
                    queue.Send();
                    db._db.UpdateObjects(infos);
                    db._updateObjects(infos);
                }
                catch (AggregateException)
                {
                }
            }
Ejemplo n.º 2
0
            /// <summary>
            /// Executes the refresh task
            /// </summary>
            /// <param name="db">The database that is executing the task</param>
            public void Execute(NetworkDatabase db)
            {
                var client = new Client(db._host);
                var queue  = new ReadQueue(client);
                var info   = db._db.GetObject(DeviceInstance, ObjectIdentifier);

                info.Refresh(queue);

                try
                {
                    queue.Send();
                    db._db.UpdateObject(info);
                    db._updateObject(info);
                }
                catch (AggregateException)
                {
                }
            }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructs a new Client instance
 /// </summary>
 /// <param name="host">The host used for sending and receiving appgrams</param>
 public Client(Host host)
 {
     this.Host      = host;
     this.ReadQueue = new ReadQueue(this);
 }
Ejemplo n.º 4
0
 public ReadQueueObjectHandle(ReadQueue queue, uint deviceInstance, ObjectId objectIdentifier) : this()
 {
     this.Queue            = queue;
     this.DeviceInstance   = deviceInstance;
     this.ObjectIdentifier = objectIdentifier;
 }