Enable or Disable the Serial Port

When enabling or disabling the serial port, make sure you have followed the rules below:
  • Include all the following header files:
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <unistd.h>
  • Make sure you use standard functions to open and close the files you need.
    int open(const char *pathname, int flags);
    int close (int fd)