[Tinyos-help] connecting to the SerialForwarder

Islam Hegazy islheg at gmail.com
Sun Jun 3 22:00:20 PDT 2007


Hi all

I face a problem with getting data from the SerialForwarder. I wrote a client application using C under Linux. The client connects to the SerialForwarder but it doesn't receive  the data. Following is part of the code:
        addr.sin_port = htons(9001); /* set the port # */

        addr.sin_addr.s_addr = *(long*)host->h_addr_list[0]; /* set the addr */

        conn = connect(sd, (struct sockaddr*)&addr, sizeof(addr)); /* connect! */

        if (conn == -1)

        {

            printf("Can't connect. Error no: %i\n", errno);

            exit(0);

        }

        char s[20];

        int rcd;


        while ((rcd = recv(sd, s, 20, 0)) != 0)

            printf("%s\n", s); 

Is there something missing from this code?



Regards

islheg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070603/0317ead5/attachment.html


More information about the Tinyos-help mailing list