n = WCHNET_SocketRecvLen(id, NULL); //query length
// printf("Receive Len = %02x\n", n);
if(n>0)
{
WCHNET_SocketRecv(id, ptrDataIn,&n); //Read the data of the receive buffer into MyBuf
ptrDataIn += n;
DataInReceLen += n;
if (DAP_queue_execute_buf(&DAP_Cmd_queue, MyBuf, DataInReceLen,&rbuf))
{
if(DAP_queue_get_send_buf(&DAP_Cmd_queue, &sbuf, &n))
{
WCHNET_SocketSend(id, sbuf,&n); //Send the data
}
}
//revert the input pointers
DataInReceLen = 0;
ptrDataIn = MyBuf;
}
}
这个是通用的吗