The read and write functions read from and write to a communications device, determine communications errors, and determine the status of the transmit and receive queues.