add serial interface unit test with check and fix bug