UART flow control with WP7608

I cannot find another way to access RTS and CTS other than my previous suggestion.

I think using ioctl() to set CTS is the most proper way and standard way.
Currently I have no idea why RTS cannot be read by ioctl().
Below is the code to read the RTS status by AT command, let me know if you accept this.
If no, we need a FW fix on this so that we can read RTS status by ioctl().

int get_RTS_status()
{

	 int     fd_rts;
	 int     sel,len,i;
	 int     wrote = 0;
	 char * pch;

	 fd_set  rfds;
	 unsigned char buf[1024];
	 unsigned char cmd[100];
	 struct timeval timeout;
	 fd_rts = open ("/dev/ttyAT", O_RDWR | O_NOCTTY | O_NDELAY);
      struct termios options;
      fcntl (fd_rts, F_SETFL, 0);
      tcgetattr (fd_rts, &options);
	  options.c_cflag |= (CLOCAL | CREAD);
	  options.c_cflag &= ~PARENB;
	  options.c_cflag &= ~CSTOPB;
	  options.c_cflag &= ~CSIZE;
	  options.c_cflag |= CS8;
	  options.c_cflag |= CRTSCTS;
	  options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
	  options.c_iflag &= ~(INLCR | ICRNL | IGNCR);
	  options.c_oflag &= ~OPOST;
	  options.c_oflag &= ~OLCUC;
	  options.c_oflag &= ~ONLRET;
	  options.c_oflag &= ~ONOCR;
	  options.c_oflag &= ~OCRNL;
	  tcsetattr (fd_rts, TCSANOW, &options);


	  memset(cmd,0,sizeof(cmd));
	  strncpy(cmd,"AT!entercnd=\"A710\";!BSGPIO?6\r\n",30);
	  wrote = write (fd_rts, cmd, strlen (cmd));
	  LE_INFO("wrote  %d ",wrote);
	  if (wrote<0)
	  {
		  LE_INFO("RTS = -1 ");
              close(fd_rts);
		  return -1;
	  }

	  tcdrain (fd_rts);
	   usleep (100000);

	   for (i = 0; i < 100; i++) {

	     FD_ZERO (&rfds);
	     FD_SET (fd_rts, &rfds);

	     timeout.tv_sec = 0;
	     timeout.tv_usec =10000 ;

	     if ((sel = select (fd_rts + 1, &rfds, NULL, NULL, &timeout)) > 0)
	     {
	       if (FD_ISSET (fd_rts, &rfds)) {
				memset (buf, 0, sizeof (buf));
				len = read (fd_rts, buf, sizeof (buf));
	       }

	     }
	   }

	     close(fd_rts);

	 	pch = strstr(buf, "State:     0");
	 	if (pch != NULL)
	 		{
	 		 	 LE_INFO("RTS =0 ");
	 		 	return 0;
	 		}
	 		else /* Substring not found */
	 		{
	 			LE_INFO("RTS =1 ");
	 			return 1;
	 		}




}