move interface connect/read handling to interface.c