Add serial port related device helpers and commands

Is this function supposed to exit with non-zero if the top-most statement failed?