lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] TM4C1294 LWIP Usage


From: Lee
Subject: Re: [lwip-users] TM4C1294 LWIP Usage
Date: Sun, 21 Dec 2014 18:18:01 -0700 (MST)

Hi Noam,

I did manage to get it working.

#include "tcp_tx.h"
#include <stdint.h>
#include "lwip/debug.h"
#include "lwip/stats.h"



static err_t tx_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
{

  LWIP_UNUSED_ARG(len);
  LWIP_UNUSED_ARG( arg );
  tcp_write( pcb, data_buffer,1024, 0 );
  return ERR_OK;
}


static void close_conn (struct tcp_pcb *pcb )
{
    tcp_arg(pcb, NULL);
    tcp_sent(pcb, NULL);
    tcp_close(pcb);
}

static err_t tx_accept(void *arg, struct tcp_pcb *pcb, err_t err )
{
    LWIP_UNUSED_ARG( arg );
    LWIP_UNUSED_ARG( err );
    tcp_setprio( pcb, TCP_PRIO_MIN );
    tcp_err( pcb, NULL );
    tcp_write( pcb, data_buffer,1024, 0 );
    tcp_sent(pcb,tx_sent);
    return ERR_OK;
}


void tcp_initialize( void )
{
    struct tcp_pcb *tcp_pcb;
    tcp_pcb = tcp_new();
    tcp_bind(tcp_pcb, IP_ADDR_ANY, 1234);
    tcp_pcb = tcp_listen( tcp_pcb );
    tcp_accept( tcp_pcb, tx_accept );
}

It doesn't work without an initial  tx_write in the accept function for some
reason. Thanks for your help. I'll now start looking at how much data this
will throughput but at the moment its very slow, partially due to my PC
clent taking 0.2S to Ack.

Lee.



--
View this message in context: 
http://lwip.100.n7.nabble.com/TM4C1294-LWIP-Usage-tp23623p23641.html
Sent from the lwip-users mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]