Esempio n. 1
0
 /// <summary>
 /// The insert.
 /// </summary>
 /// <param name="device">
 /// The device.
 /// </param>
 public void Insert(RemoteDevice device)
 {
     if (device != null)
     {
         this._myDb.Insert(device);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// The assign packet to device.
        /// </summary>
        private void AssignPacketToDevice(IPacket packet)
        {
            IRemoteDevice dev = this._deviceList.FirstOrDefault(x => x.HwAddr == packet.SrcAddress);
            if (dev != null)
            {
                dev.AddPacketToReceiveQueue(packet);
            }
            else
            {
                var newDev = new RemoteDevice(packet);

                // TODO remove after testing
                //this.sqliteDb.Insert(newDev);
                this._deviceList.Add(newDev);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// The assign packet to device.
        /// </summary>
        /// <param name="packet">
        /// The packet.
        /// </param>
        private void AssignPacketToDevice(IPacket packet)
        {
            IRemoteDevice dev = this.deviceList.FirstOrDefault(x => x.HwAddr == packet.SrcAddress);

            if(dev != null)
            {
                dev.AddPacketToReceiveQueue(packet);
            }
            else
            {
                var newDev = new RemoteDevice(packet);
                this.deviceList.Add(newDev);
            }
        }