question about avb webserver

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
snakeyong
Member
Posts: 8
Joined: Fri Nov 11, 2011 1:30 pm

question about avb webserver

Postby snakeyong » Thu Feb 02, 2012 3:30 pm

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
User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Postby Andy » Tue Feb 07, 2012 4:50 pm

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).
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: No registered users and 2 guests