public FormDeviceSpy()
        {
            InitializeComponent();
            CPData cpData = new CPData();

            _networkTracker = new UPnPNetworkTracker(cpData);
        }
Example #2
0
        internal void UpdateRemovedCP(string roomID, CriticalMsgPoints cp)
        {
            CPData cpd = new CPData(cp.MsgID, cp.GroupID, cp.GroupID, cp.Type.ToString(), "msg", "chat-bubble-two", new DateTime(), "", "", cp.Type, cp.Priority);

            context.Clients.Group(roomID).updateRemovedCPGraph(roomID, cpd);
            context.Clients.Group(roomID + toolbarStr).updateRemovedCPToolBar(roomID, cpd);
        }
Example #3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="listener">A listener that wishes to be notified about device events.</param>
        public DeviceDetector(IDeviceEventListener listener)
        {
            _deviceEventListener = listener;

            // Setup UPnP device detection.
            UPnPConfiguration.LOGGER = new Tve3Logger();
            _upnpControlPointData    = new CPData();
            _upnpAgent = new UPnPNetworkTracker(_upnpControlPointData);
            _upnpAgent.RootDeviceAdded   += OnUpnpRootDeviceAdded;
            _upnpAgent.RootDeviceRemoved += OnUpnpRootDeviceRemoved;
            _upnpControlPoint             = new UPnPControlPoint(_upnpAgent);

            // Setup other (BDA, PBDA, WDM) device detection.
            try
            {
                InitBdaDetectionGraph();
            }
            catch (Exception ex)
            {
                Log.Log.Error("Failed to initialise the BDA device detection graph!\r\n{0}", ex);
                throw;
            }
            _systemDeviceChangeEventWatcher = new ManagementEventWatcher();
            // EventType 2 and 3 are device arrival and removal. See:
            // http://msdn.microsoft.com/en-us/library/windows/desktop/aa394124%28v=vs.85%29.aspx
            _systemDeviceChangeEventWatcher.Query         = new WqlEventQuery("SELECT * FROM Win32_DeviceChangeEvent WHERE EventType = 2 OR EventType = 3");
            _systemDeviceChangeEventWatcher.EventArrived += OnSystemDeviceConnectedOrDisconnected;
        }
Example #4
0
        private void UpdateNewCP(string roomID, CriticalActionPoints cp)
        {
            CPData cpd = new CPData(cp.ActionID, cp.TabID, cp.Action.Tab.GroupID, cp.Type.ToString(), "act", "flash", cp.Action.TimeStamp, cp.Action.UserID, cp.Action.ToStringWithoutUser(), cp.Type, cp.Priority);

            context.Clients.Group(roomID).updateNewCPGraph(roomID, cpd);
            context.Clients.Group(roomID + toolbarStr).updateNewCPToolBar(roomID, cpd);
        }
        public UPnPServerWatcher()
        {
            CPData cpData = new CPData();

            _networkTracker = new UPnPNetworkTracker(cpData);
            _networkTracker.RootDeviceAdded   += OnUPnPRootDeviceAdded;
            _networkTracker.RootDeviceRemoved += OnUPnPRootDeviceRemoved;
        }
 public UPnPDeviceTracker()
 {
     _upnpControlPointData         = new CPData();
     _upnpAgent                    = new UPnPNetworkTracker(_upnpControlPointData);
     _upnpAgent.RootDeviceAdded   += OnUpnpRootDeviceAdded;
     _upnpAgent.RootDeviceRemoved += OnUpnpRootDeviceRemoved;
     _upnpControlPoint             = new UPnPControlPoint(_upnpAgent);
 }
        public UPnPClientControlPoint(string homeServerSystemId)
        {
            _homeServerSystemId = homeServerSystemId;
            CPData cpData = new CPData();

            _networkTracker = new UPnPNetworkTracker(cpData);
            _controlPoint   = new UPnPControlPoint(_networkTracker);
            _networkTracker.RootDeviceAdded += OnUPnPRootDeviceAdded;
        }
        public UPnPServerControlPoint()
        {
            CPData cpData = new CPData();

            _networkTracker = new UPnPNetworkTracker(cpData);
            _controlPoint   = new UPnPControlPoint(_networkTracker);
            _networkTracker.RootDeviceAdded   += OnUPnPRootDeviceAdded;
            _networkTracker.RootDeviceRemoved += OnUPnPRootDeviceRemoved;
        }
        public GENAClientController(CPData cpData, DeviceConnection connection, EndpointConfiguration endpoint, UPnPVersion upnpVersion)
        {
            _cpData                = cpData;
            _connection            = connection;
            _endpoint              = endpoint;
            _upnpVersion           = upnpVersion;
            _eventNotificationPath = "/" + Guid.NewGuid();
            IPAddress address = endpoint.EndPointIPAddress;

            _eventNotificationEndpoint = new IPEndPoint(address, address.AddressFamily == AddressFamily.InterNetwork ?
                                                        cpData.HttpPortV4 : cpData.HttpPortV6);
            _subscriptionRenewalTimer = new Timer(OnSubscriptionRenewalTimerElapsed);
        }
Example #10
0
        public GENAClientController(CPData cpData, DeviceConnection connection, EndpointConfiguration endpoint, UPnPVersion upnpVersion)
        {
            _cpData                = cpData;
            _connection            = connection;
            _endpoint              = endpoint;
            _upnpVersion           = upnpVersion;
            _eventNotificationPath = cpData.ServicePrefix + "/" + Guid.NewGuid();
            IPAddress address = endpoint.EndPointIPAddress;
            var       port    = UPnPServer.DEFAULT_UPNP_AND_SERVICE_PORT_NUMBER;

            _eventNotificationEndpoint = new IPEndPoint(address, port);
            _subscriptionRenewalTimer  = new Timer(OnSubscriptionRenewalTimerElapsed);
        }
 /// <summary>
 /// Creates a new instance of <see cref="SSDPClientController"/>.
 /// </summary>
 public SSDPClientController(CPData cpData)
 {
     _cpData = cpData;
 }
 /// <summary>
 /// Creates a new instance of <see cref="SSDPClientController"/>.
 /// </summary>
 public SSDPClientController(CPData cpData)
 {
   _cpData = cpData;
 }
 public GENAClientController(CPData cpData, DeviceConnection connection, EndpointConfiguration endpoint, UPnPVersion upnpVersion)
 {
   _cpData = cpData;
   _connection = connection;
   _endpoint = endpoint;
   _upnpVersion = upnpVersion;
   _eventNotificationPath = "/" + Guid.NewGuid();
   IPAddress address = endpoint.EndPointIPAddress;
   _eventNotificationEndpoint = new IPEndPoint(address, address.AddressFamily == AddressFamily.InterNetwork ?
       cpData.HttpPortV4 : cpData.HttpPortV6);
   _subscriptionRenewalTimer = new Timer(OnSubscriptionRenewalTimerElapsed);
 }