Simulate serial port writes
Fix tests