QextSerialPort sp("COM1"); char buf[size]; sp.setBaudRate(BAUD4800); sp.setDataBits(DATA_8); sp.setFlowControl(FLOW_OFF); sp.setStopBits(STOP_1); sp.setParity(PAR_NONE); if (sp.open()) { sp.readBlock(buf,read_size); sp.close(); } else { // handle error }