Ejemplo n.º 1
0
        public bool UnregisterScanner(ICDESniffer pScanner)
        {
            if (pScanner == null || pScanner.GetBaseThing() == null)
            {
                return(false);
            }
            if (MyDiscoScanners.Any(s => s.Key != pScanner.GetBaseThing().cdeMID))
            {
                return(false);
            }

            pScanner.UnregisterDeviceLost(sinkByeBye);
            pScanner.StopScan();
            MyDiscoScanners.RemoveNoCare(pScanner.GetBaseThing().cdeMID);
            return(true);
        }
Ejemplo n.º 2
0
        public bool RegisterScanner(ICDESniffer pScanner)
        {
            if (pScanner == null || pScanner.GetBaseThing() == null)
            {
                return(false);
            }
            if (MyDiscoScanners.Any(s => s.Key == pScanner.GetBaseThing().cdeMID))
            {
                return(false);
            }

            pScanner.RegisterDeviceLost(sinkByeBye);
            pScanner.StartScan(this);
            MyDiscoScanners.TryAdd(pScanner.GetBaseThing().cdeMID, pScanner);
            return(true);
        }