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

                Telemetry = new PreformHopperTelemetry();

                await SendMessageAsync(Telemetry);

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