Simulation API - Suggestions and Requirements
See original GitHub issueWe have several PRs suggesting the addition of a simulation GPIO Driver to simplify development and testing without actual hardware (see #1827 and #1823). The team has agreed that such a simulation is desirable, but it should include, at least as possible further extensions, simulation components for other hardware interfaces, particularly I2C, SPI or PWM.
Suggested class structure:
namespace Iot.Devices.Simulation
{
public class SimulationBoard : Board
{
// ....
public override GpioController CreateGpioController()
{
return new GpioController(PinNumberingScheme.Logical, new SimulationGpioDriver(NumberOfPinsToSimulate));
}
}
public class SimulationGpioDriver : GpioDriver
{
// ....
}
public class SimulationI2cBus : I2cBus
{
// ...
}
// ....
}
To simulate the behavior of the actual hardware, the simulation devices should have a “backend” interface that allows connecting a simulation implementation, either by having events to connect to, such as showcased here, or something like a REST api to connect an external simulation Gui to. That simulation GUI could then simulate the wiring between inputs/outputs or simulate devices on the I2C bus.
Suggestions or improvements?
I do not expect that a first implementation would be able to support all cases, but it shouldn’t block further development towards such a scenario.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:17 (13 by maintainers)
Top GitHub Comments
From @raffaeler’s suggestions on #383:
The goals for this proposal:
ref: https://github.com/dotnet/iot/issues/383