magicoe 发表于 2013-9-5 12:05:11

lwip netio 测试的一个问题,高手多多指教

本帖最后由 magicoe 于 2013-9-5 12:06 编辑

这两天再测试LWIP NETIO方面的数据,目前参考了Rt-thread中的netio.c函数,NETIO Recev(对应MCU这边应该是netio_send)功能中,netio_send的一个形参arg中会有time_stamp的一个参数,请问下这个参数是怎样的作用?我修改后(比如把代码红色部分的600改成6000或者60000),吞吐量是翻天覆地。网络上也没对应的资料,求教各位了。谢谢!

static err_t netio_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
{
struct netio_state *ns = arg;
err_t err = ERR_OK;
#ifdef UCOSIII
        OS_ERR ucErr;
#endif
       
if (ns->cntr >= ns->data_len && ns->state == NETIO_STATE_SEND_DATA) {
    /* done with this round of sending */
    ns->buf_pos = 0;
    ns->cntr = 0;
                DEBUGOUT("ns->time_stamp %d\r\n",ns->time_stamp);
    /* check if timer expired */
#ifdef UCOSIII
    if (OSTimeGet(&ucErr) - ns->time_stamp > 600) {
#else
                if (sys_now() - ns->time_stamp > 600) {
#endif
      ns->buf_ptr = 1;
      ns->state = NETIO_STATE_SEND_DATA_LAST;
    } else {
      ns->buf_ptr = 0;
    }
}
页: [1]
查看完整版本: lwip netio 测试的一个问题,高手多多指教