Scanner emulation is similar to emulating everything else in programming, and I assume that you are misunderstanding the problem. Everything that the โscannerโ consumes should consume an interface, not an implementation (see โDโ in SOLID ). This will allow you to create a separate implementation, which is an emulated version of the hardware.
Now in this case, perhaps the interface does not have much that you need in the interface - perhaps some configuration / initialization, on / off, and even or a delegate to receive data.
source share