You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the SwiftGPIO interfaces are tight up to concrete classes which heavily depend on Raspberry Pi's environment, OS and libraries. The downside is the code which has integrated SwiftyGPIO gets crash when run on MAC.
In order to take advanges of XCode, and enable debugging capable on MAC/XCode, I'd like to add mocks feature into SwiftyGPIO.
The overall feature will conduct these things:
Implement mock classes of UARTInterface, SPIInterface, I2CInterface, ADCInterface, OneWireInterface, PWMOutput.
Mock classes provide extra closures, so that developers can provide any simulation logic into any certain function of mock object.
The concrete object shouldn't be created directly, but by help of InstanceCreator
InstanceCreate is able to instantiate the actual objects or alternative mock objects depending on 2 things, enableMock flag and the current OS. if enableMock is true and the OS is MAC then return the mock object, otherwise return the actual object