I’m integrating a Fez Domino with an RFID reader module. The module uses a proprietary 2 wire serial protocol - so not I2C or SPI - and this has to be implemented through bit-banging two pins.
I’m trying to write an emulator component for it first but I’m stuck. I can’t use the I2C or SPI ports in the emulation, which would be somewhat easier.
How can I communicate from the emulator component back to the firmware? I really don’t want to rewrite the communications protocol on the two pins to emulate the actual hardware and would rather like to use a higher level of abstraction.
My initial idea was to implement an interface in the emulator class that would raise a TagScanned event in the managed driver. The firmware would have the logic to catch this event and handle it. Trouble is I can’t seem to get it right to raise an event from the emulator to be caught by the firmware. The eventhandler types are different between the emulator and the firmware.
Am I missing something obvious? What is the correct way to create emulated hardware abstracted from a port?