public GatewayDevice ToGatewayDevice(string gatewayId)
        {
            var gatewayDevice = new GatewayDevice
            {
                DeviceName = $"{gatewayId}:{DeviceInfo.Manufacturer}|{gatewayId}:{DeviceName}|{Index}",
                DeviceType = DeviceName,
                Properties = Properties.ToGatewayDeviceProperties()
            };

            return(gatewayDevice);
        }
Exemplo n.º 2
0
                public GatewayDevice ValidGateway(GatewayDevice defaultDevice)
                {
                    for (GatewayDevice device : devices.Values)
                    {
                        try {
                            if (device.isConnected())
                            {
                                return(device);
                            }
                        }
                        catch (Exception ex) {
                            /* noop */
                        }
                    }

                    /* if none found, return the default device */
                    return(defaultDevice);
                }