Esempio n. 1
0
 public override Task <MEmpty> SetGPIO(MGPIO request, ServerCallContext context)
 {
     try
     {
         common.GPIOController.SetGPIO(request.IoPin, request.State);
         return(Task.FromResult(new MEmpty()));
     }
     catch (Exception e)
     {
         return(Task.FromException <MEmpty>(e));
     }
 }
Esempio n. 2
0
 public override Task <MGPIO> GetGPIO(MGPIO request, ServerCallContext context)
 {
     try
     {
         var s = common.GPIOController.ReadGPIO(request.IoPin);
         return(Task.FromResult(new MGPIO()
         {
             IoPin = request.IoPin,
             State = s
         }));
     }
     catch (Exception e)
     {
         return(Task.FromException <MGPIO>(e));
     }
 }