Page 1 of 1

question about avb webserver

Posted: Thu Feb 02, 2012 3:30 pm
by snakeyong
i have written one function replace "c_api_xtcp_handler" in xr_avb_demo.xc,as follow:

Code: Select all

void linker_svr_handle(chanend tcp_svr,xtcp_connection_t *conn)
{
  unsigned char data[UDP_MAX_BUF];

  switch (conn->event){
    case XTCP_IFUP           :
    case XTCP_IFDOWN         :
    case XTCP_ALREADY_HANDLED: return;
    default                  : break;
  }

  if (conn->local_port == 6002){
    switch (conn->event){
      case XTCP_NEW_CONNECTION:
      case XTCP_POLL          : break;
      case XTCP_RECV_DATA     :
      {
        xtcp_ipaddr_t remote_addr = {conn->remote_addr[0],conn->remote_addr[1],conn->remote_addr[2],conn->remote_addr[3]};
        xtcp_recv(tcp_svr, (char *) data);
        xtcp_bind_remote(tcp_svr, conn, remote_addr, 6003);
        xtcp_init_send(tcp_svr, conn);
	printstrln("receive linker control frame");
      }
        break;
      case XTCP_REQUEST_DATA  :
      case XTCP_SENT_DATA     :
      case XTCP_RESEND_DATA   :
      {
    	xtcp_send(tcp_svr,ctrl_tx_buf.buf,ctrl_tx_buf.len);
        printstrln("send control frame ack");
      }
        break;
      case XTCP_CLOSED        :
    	xtcp_listen(tcp_svr, 6002, XTCP_PROTOCOL_UDP);
        break;
      default                 : break;
    }
    conn->event = XTCP_ALREADY_HANDLED;
  }
  return;
}
and i program a pc software which uses broadcast of UDP to query which avb unit is online use QT。

when i run the software and avb demo, it can only receive 7 times,after avb demo has received 7 times,nothing received anywhere,the log as bellow:
INFO: AVB1722_EthernetRx : Started..
Using dynamic ip
dhcp: 192.168.1.102
Stream #0 ready
receive linker control frame
send control frame ack
receive linker control frame
send control frame ack
receive linker control frame
send control frame ack
receive linker control frame
send control frame ack
receive linker control frame
send control frame ack
receive linker control frame
send control frame ack
receive linker control frame
send control frame ack

what's wrong?and how to debug?3ks

Re: question about avb webserver

Posted: Tue Feb 07, 2012 4:50 pm
by Andy
Hi snakeyong,

I've attached a pdf describing how to get the state of the program at the point of failure. It should tell you where your program is getting stuck (assuming it is).