示例#1
0
 public FillerDevice(string id, string primaryKey, string schema, string jsonSchemaFile, string iotHub)
     : base(id, primaryKey, schema, jsonSchemaFile, iotHub)
 {
     Telemetry = new FillerTelemetry()
     {
         online    = true,
         running   = true,
         producing = true
     };
 }
示例#2
0
        private async Task <MethodResponse> TurnOffCommandHandler(MethodRequest methodRequest, object userContext)
        {
            try
            {
                Console.WriteLine($"{Id}.{nameof(TurnOffCommandHandler)}...");

                Telemetry = new FillerTelemetry();

                await SendMessageAsync(Telemetry);

                return(new MethodResponse(0));
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Exception on {Id}.{nameof(TurnOffCommandHandler)}: {ex.Message}");
                return(new MethodResponse(-1));
            }
        }