Class connecting to hardware via socket or serial and implementing the commands for writing and reading.