Added an endpoint for toggling pin's value.
This commit is contained in:
parent
ed448c9baf
commit
0d715cf823
|
|
@ -45,5 +45,13 @@ namespace Proculite.GpioRest.Controllers
|
|||
|
||||
return Ok(_gpioService.SetPinLowReturning(pinNumber));
|
||||
}
|
||||
|
||||
[HttpPost("pin-value/toggle/{pinNumber}")]
|
||||
public IActionResult TogglePin(int pinNumber)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest();
|
||||
return Ok(_gpioService.TogglePinReturning(pinNumber));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue