Mercurial > nand-ecoscentric
comparison host/tools/ecostest/common/eCosTest.cpp @ 84:489eb5632bc3 ecos-sw-2000-04-28
Merge from eCos master repository on 2000-04-28-18:44:39-BST
| author | jlarmour |
|---|---|
| date | Fri, 28 Apr 2000 18:18:36 +0000 |
| parents | 6736c52df507 |
| children | c37d3a9e1b28 |
comparison
equal
deleted
inserted
replaced
| 83:1094d5fdd3e0 | 84:489eb5632bc3 |
|---|---|
| 924 _tunlink(m_strExecutable); | 924 _tunlink(m_strExecutable); |
| 925 } | 925 } |
| 926 sendResult(); | 926 sendResult(); |
| 927 m_pSock->recvInteger(n); // receive an ack | 927 m_pSock->recvInteger(n); // receive an ack |
| 928 } else { | 928 } else { |
| 929 // Client-side GDB | |
| 929 bool bTargetReady; | 930 bool bTargetReady; |
| 930 if(_TCHAR('\0')==*(m_pResource->ResetString())){ | 931 if(_TCHAR('\0')==*(m_pResource->ResetString())){ |
| 931 bTargetReady=true; | 932 bTargetReady=true; |
| 932 TRACE(_T("No reset possible\n")); | 933 TRACE(_T("No reset possible\n")); |
| 933 } else { | 934 } else { |
| 936 } | 937 } |
| 937 TRACE(_T("Send Target Ready indicator=%d\n"),bTargetReady); | 938 TRACE(_T("Send Target Ready indicator=%d\n"),bTargetReady); |
| 938 m_pSock->sendInteger(bTargetReady,_T("target ready indicator")); | 939 m_pSock->sendInteger(bTargetReady,_T("target ready indicator")); |
| 939 | 940 |
| 940 int nAck=-1; | 941 int nAck=-1; |
| 941 int dTimeout=m_ep.DownloadTimeout()+MAX(3*m_ep.ActiveTimeout(),15*60*1000); | |
| 942 | 942 |
| 943 if(bTargetReady){ | 943 if(bTargetReady){ |
| 944 if(CeCosSocket::IsLegalHostPort(m_pResource->Serial())){ | 944 if(CeCosSocket::IsLegalHostPort(m_pResource->Serial())){ |
| 945 TRACE(_T("Sending %s\n"),(LPCTSTR)m_pResource->Serial()); | 945 TRACE(_T("Sending %s\n"),(LPCTSTR)m_pResource->Serial()); |
| 946 if(m_pSock->sendString(m_pResource->Serial(),_T("Serial name")) && m_pSock->recvInteger(nAck,_T("Terminating ack"),dTimeout)){ | 946 if(m_pSock->sendString(m_pResource->Serial(),_T("Serial name")) && m_pSock->recvInteger(nAck,_T("Terminating ack"),CeCosSocket::NOTIMEOUT)){ |
| 947 TRACE(_T("Terminating ack=%d\n"),nAck); | 947 TRACE(_T("Terminating ack=%d\n"),nAck); |
| 948 } | 948 } |
| 949 } else { | 949 } else { |
| 950 String strHostPort(CeCosSocket::HostPort(CeCosSocket::MyHostName(),m_nAuxPort)); | 950 String strHostPort(CeCosSocket::HostPort(CeCosSocket::MyHostName(),m_nAuxPort)); |
| 951 | 951 |
| 961 m_bStopConnectSocketToSerial=false; // Used to tap ConnectSocketToSerial thread on the shoulder | 961 m_bStopConnectSocketToSerial=false; // Used to tap ConnectSocketToSerial thread on the shoulder |
| 962 | 962 |
| 963 CeCosThreadUtils::RunThread(SConnectSocketToSerialThreadFunc,this,&bConnectSocketToSerialThreadDone,_T("SConnectSocketToSerialThreadFunc")); | 963 CeCosThreadUtils::RunThread(SConnectSocketToSerialThreadFunc,this,&bConnectSocketToSerialThreadDone,_T("SConnectSocketToSerialThreadFunc")); |
| 964 | 964 |
| 965 // Wait for either client or the ConnectSocketToSerial thread to finish. | 965 // Wait for either client or the ConnectSocketToSerial thread to finish. |
| 966 if(m_pSock->recv(&nAck,sizeof(int),_T("Terminating ack"),dTimeout,DerefBool,&bConnectSocketToSerialThreadDone)){ | 966 if(m_pSock->recv(&nAck,sizeof(int),_T("Terminating ack"),CeCosSocket::NOTIMEOUT,DerefBool,&bConnectSocketToSerialThreadDone)){ |
| 967 TRACE(_T("Session terminated by request of client (%s)\n"),(LPCTSTR)Image((StatusType)nAck)); | 967 TRACE(_T("Session terminated by request of client (%s)\n"),(LPCTSTR)Image((StatusType)nAck)); |
| 968 } else if(0!=m_pSock->SocketError()){ | 968 } else if(0!=m_pSock->SocketError()){ |
| 969 TRACE(_T("Session terminated by socket error - %s\n"),(LPCTSTR)m_pSock->SocketErrString()); | 969 TRACE(_T("Session terminated by socket error - %s\n"),(LPCTSTR)m_pSock->SocketErrString()); |
| 970 } | 970 } |
| 971 if(!bConnectSocketToSerialThreadDone){ | 971 if(!bConnectSocketToSerialThreadDone){ |
