Пример #1
0
        public Message Create(MqttApplicationMessageReceivedEventArgs eventArgs)
        {
            var ledMessage = ParseMessageReceived(eventArgs);
            Led led        = new Led
            {
                SerialNumber = ledMessage.idDevice,
                Power        = ledMessage.message,
                MqttClient   = eventArgs.GetMqttClientIdMessageReceived(),
                Status       = Status.Online.ToString()
            };

            return(new LedMessageCommand(led));
        }
Пример #2
0
        public Message Create(MqttApplicationMessageReceivedEventArgs eventArgs)
        {
            var          soilmoistureMessage = ParseMessageReceived(eventArgs);
            Soilmoisture soilmoisture        = new Soilmoisture
            {
                SerialNumber = soilmoistureMessage.idDevace,
                Moisture     = soilmoistureMessage.message,
                MqttClient   = eventArgs.GetMqttClientIdMessageReceived(),
                LogMoisture  = soilmoistureMessage.logMoisture,
                Status       = Status.Online.ToString()
            };

            return(new SoilmoistureMessageCommand(soilmoisture));
        }
Пример #3
0
        public Message Create(MqttApplicationMessageReceivedEventArgs eventArgs)
        {
            var         tepmeratureMessage = ParseMessageReceived(eventArgs);
            Temperature temperature        = new Temperature
            {
                SerialNumber = tepmeratureMessage.idDevace,
                Temp         = tepmeratureMessage.message,
                LogTemp      = tepmeratureMessage.logTemp,
                MqttClient   = eventArgs.GetMqttClientIdMessageReceived(),
                Status       = Status.Online.ToString()
            };

            return(new TemperatureMessageCommand(temperature));
        }
 public Message Create(MqttApplicationMessageReceivedEventArgs eventArgs)
 {
     return(new StatusUpdateMessage(eventArgs.GetMqttClientIdMessageReceived(), Status.Offline));
 }