Defining all methods for serialport