Lines Matching refs:fd
41 static int at_command(int fd, char *cmd, int to) in at_command() argument
48 len = write(fd, cmd, strlen(cmd)); in at_command()
53 FD_SET(fd, &rfds); in at_command()
58 if ((sel = select(fd + 1, &rfds, NULL, NULL, &timeout)) > 0) { in at_command()
60 if (FD_ISSET(fd, &rfds)) { in at_command()
62 len = read(fd, buf, sizeof(buf)); in at_command()
83 int fd; in open_device() local
85 fd = open(device, O_RDWR | O_NOCTTY | O_NONBLOCK); in open_device()
86 if (fd < 0) { in open_device()
92 tcflush(fd, TCIOFLUSH); in open_device()
96 tcsetattr(fd, TCSANOW, &ti); in open_device()
98 return fd; in open_device()
146 int fd; in main() local
167 fd = open_socket(&bdaddr, channel); in main()
170 fd = open_device(argv[1]); in main()
173 if (fd < 0) in main()
176 at_command(fd, "ATZ\r\n", 10000); in main()
177 at_command(fd, "AT+CPBS=\"ME\"\r\n", 10000); in main()
178 at_command(fd, "AT+CPBR=1,100\r\n", 100000); in main()
180 close(fd); in main()