LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Not working on the ARM board (https://www.linuxquestions.org/questions/linux-newbie-8/not-working-on-the-arm-board-4175465442/)

sushantbhangale 06-10-2013 04:33 AM

Not working on the ARM board
 
Code:

char buff[255];
        fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NDELAY |O_TRUNC);
        if (fd == -1){
                printf("Can't open port!\n");
                return 1;
        }
        else {

                while (1)
                {
                        send(fd,"NULL");
                        char st[100];
                      memset(st,'\0',sizeof(st));
                        buff[0] = '\0';
                        send(fd, "AT\r\n");
                        sleep(1);
                        size = read(fd,buff,255);
                        printf("GOT:%s",buff);
                        if(buff[0]=='E')
                        {
                                return -1;
                        }
                }


michaelk 06-10-2013 01:22 PM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Continue here:
http://www.linuxquestions.org/questi...rd-4175464834/


All times are GMT -5. The time now is 08:53 AM.