Hello, Im doing a project where a wav file is sent from host to target and this file is listened through dsp target speaker. To sent the file I use RTDX. The file is cut up in groups of fixed size and this groups are sent in a continuosly loop. The host application is implemented in Visual C++ 6.0. The code of the host application is : ... ... while( j < max_packets){ SetData(data); numBytes = 0; while(numBytes >= 0){ status = rtdx->StatusOfWrite(&numBytes); if (status != 0){ AfxMessageBox(" - Error: StatusOfWrite failed!"); return; } } status = rtdx->Write(sa, &bufferstate); if (status != 0){ AfxMessageBox(" - Error: Write failed &i!",j); return; } j++; } ... ... The code of target application is : ... ... TARGET_INITIALIZE(); RTDX_enableInput(&control_channel); while(1) { if(busystatus == 0){ if (RTDX_sizeofInput(&control_channel) == SIZE_OF_MSG) DecodePacket(data); status = RTDX_readNB(&control_channel,data,SIZE_OF_MSG); if ( status == RTDX_READ_ERROR ) { LOG_printf(&trace,"ERROR: RTDX_read failed!\n" ); exit( -1 ); }else if ( status == 0 ) { LOG_printf(&trace,"ERROR: Unable read!\n" ); exit( -1 ); } } busystatus = RTDX_channelBusy(&control_channel); if(busystatus == 1) TSK_sleep(1); } ... ... The result of the test indicate me that "real-time" is not get with RTDX, because a retard happen between some sending data packets. Why is it? Is possible "real-time" in sending from host to target in a continuously loop really? Are there any error in host or target code? Im grateful if somebody send me an example of loop to send data from host to target. |
RTDX used to send data continuosly from host to target
Started by ●April 27, 2004