Esempio n. 1
0
        public async Task <HeartbeatResponseModel> UpdateDeviceHeartbeat([FromBody] DeviceHeartbeatModel model)
        {
            var command       = HeartbeatReceived.FromDevice(_context.DeviceId, model);
            var deviceVersion = await _messagingSrv.SendAsync(command);

            return(new HeartbeatResponseModel {
                ConfigurationVersion = deviceVersion.ConfigurationVersion
            });
        }
Esempio n. 2
0
        public static HeartbeatReceived FromDevice(Guid deviceId, DeviceHeartbeatModel deviceHeartbeat)
        {
            if (deviceHeartbeat == null)
                throw new ArgumentNullException(nameof(deviceHeartbeat), 
                    "Command can't be created from null model.");

            return new HeartbeatReceived { 
                DeviceId = deviceId, 
                Heartbeat = deviceHeartbeat };
        }