You need to create a serial object, serial(), and you need to use the resulting object in the file identifier position of fwrite() or fread() or fprintf() or fgetl() or the like.
For more advanced serial port use, you would set properties such as buffer sizes and callbacks when you reach a certain number of input characters. See serial object documentation
