Ejemplo n.º 1
0
    public void Discover()
    {
        if (_isDiscovered)
        {
            return;
        }

        _isDiscovered = true;
        OnDiscovered?.Invoke();
    }
Ejemplo n.º 2
0
        public static void DiscoverDevices()
        {
            var discoveredHumidifiers = MiioTransport
                                        .SendDiscoverMessage()
                                        .Where(x => x.type == "0404"); // magic number identifying air humidifier

            foreach (var(ip, type, serial, token) in discoveredHumidifiers)
            {
                OnDiscovered?.Invoke(null, new DiscoverEventArgs(ip, type, serial, token));
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Find all available mi robot vacuums in the LAN
        /// </summary>
        public static void DiscoverDevices()
        {
            var discoveredRobots = MiioTransport
                                   .SendDiscoverMessage()
                                   .Where(x => x.type == "05c5"); // magic number identifying rockrobo.vacuum.v1

            foreach (var(ip, type, serial, token) in discoveredRobots)
            {
                OnDiscovered?.Invoke(null, new DiscoverEventArgs(ip, type, serial, token));
            }
        }
Ejemplo n.º 4
0
    public void SetDiscoveredStatus(bool status)
    {
        _isDiscovered = status;

        OnDiscovered?.Invoke(status);
    }