Compare commits
No commits in common. "29f0c4788ceecabd9c3cff8f02b6033f4c284201" and "83bba359cb1be28ef1c561a2d9e80332ec31116b" have entirely different histories.
29f0c4788c
...
83bba359cb
|
|
@ -27,23 +27,5 @@ namespace Proculite.GpioRest.Controllers
|
||||||
{
|
{
|
||||||
return Ok(_gpioService.StateOfAllPins());
|
return Ok(_gpioService.StateOfAllPins());
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPut("pin-value/high/{pinNumber}")]
|
|
||||||
public IActionResult SetPinHigh(int pinNumber)
|
|
||||||
{
|
|
||||||
if (!ModelState.IsValid)
|
|
||||||
return BadRequest();
|
|
||||||
|
|
||||||
return Ok(_gpioService.SetPinHighReturning(pinNumber));
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPut("pin-value/low/{pinNumber}")]
|
|
||||||
public IActionResult SetPinLow(int pinNumber)
|
|
||||||
{
|
|
||||||
if (!ModelState.IsValid)
|
|
||||||
return BadRequest();
|
|
||||||
|
|
||||||
return Ok(_gpioService.SetPinLowReturning(pinNumber));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,27 +58,5 @@ namespace Proculite.GpioRest.Services
|
||||||
{
|
{
|
||||||
return _pins.Select(PinValueModelOfPin).ToArray();
|
return _pins.Select(PinValueModelOfPin).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPinHigh(int pinNumber)
|
|
||||||
{
|
|
||||||
_gpioController.Write(pinNumber, PinValue.High);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetPinLow(int pinNumber)
|
|
||||||
{
|
|
||||||
_gpioController.Write(pinNumber, PinValue.Low);
|
|
||||||
}
|
|
||||||
|
|
||||||
public PinValueModel SetPinHighReturning(int pinNumber)
|
|
||||||
{
|
|
||||||
SetPinHigh(pinNumber);
|
|
||||||
return PinValueModelOfPin(pinNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
public PinValueModel SetPinLowReturning(int pinNumber)
|
|
||||||
{
|
|
||||||
SetPinLow(pinNumber);
|
|
||||||
return PinValueModelOfPin(pinNumber);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue