I'm using arm9 with Eclipse(GNU), board at91sam9260!

Maybe the way that I'm using tcp_write is wrong!

part of my lwipopts.h:

/* This is the callback function that is called
when a TCP segment has arrived in the connection. */
static err_t
httpd_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
{

 //    static u32_t reqcount;

    //printf("CB recv %x, %x, %x, %x\n\r", arg, pcb, p, err);
    if (err != ERR_OK) {
        return err;
    }

    /* If we got a NULL pbuf in p, the remote end has closed
    the connection. */
    if(p == NULL) {
        /* Close the connection. */
        tcp_close(pcb);
        return ERR_OK;
    }

        /* The payload pointer in the pbuf contains the data
        in the TCP segment. */

        int len = strlen(p->payload);
        if (len <= 0)
                return ERR_OK;

        char* cmd = p->payload;

        printf("rcv: \""); printf(cmd); printf("\"\n\r");

        if (StartsWith(cmd, "@read") && len >= 21) {

           for (SndPacketCount=0; SndPacketCount < SndPacketTotal; 
SndPacketCount++) {
             getbuffer();
             tcp_write(pcb, SndBuffer, SndBufferLen, 0);
             tcp_output(pcb);
           }
                        
           printf("rd_ok#");
           tcp_write(pcb, "rd_ok#", 6, 0);
        }
}
  
-------------------------------------------------------

I made a program with C# that comunicate with arm through Ethernet, and with uIP
I receive the data in C# application correctly, but with this one, dont work;/

Thanks

Diego




_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to