A n 9 3 – Silicon Laboratories SI2493/57/34/15/04 User Manual

Page 268

Advertising
background image

A N 9 3

268

Rev. 1.3

sCurrentTime = clock();

iPasses++;

if( sCurrentTime > (sStartTime + sWaitTime) )

{

strcat(cpErrorString, "Timeout of "); strcat(cpErrorString, cpResponse);

printf ("\n%s\n", cpErrorString);

strncpy(cpInput_test, cpInputBuffer, iCharCnt);

cpInput_test[iCharCnt]='\0'; //copy the received bytes for late display

return cpInputBuffer; // we exit with the same input string we came in with

// because we time out.

}

}

};

// -------------------------------------------------------------------------

void AssertRTS(bool bAssert)

{

BOOL bSuccess;

if(bAssert)

dcb.fRtsControl = RTS_CONTROL_ENABLE; // assert RTS

else

dcb.fRtsControl = RTS_CONTROL_DISABLE; // dis-assert RTS

bSuccess = SetCommState(hCom, &dcb);

if (!bSuccess)

{ // Handle the error.

printf ("SetCommState failed with error %d.\n", GetLastError());

exit(1);

}

else

return;

}

void AssertDTR(bool bAssert)

{

BOOL bSuccess;

if(bAssert)

dcb.fDtrControl = RTS_CONTROL_ENABLE; // assert RTS

else

dcb.fDtrControl = RTS_CONTROL_DISABLE; // dis-assert RTS

bSuccess = SetCommState(hCom, &dcb);

if (!bSuccess)

{ // Handle the error.

printf ("SetCommState failed with error %d.\n", GetLastError());

exit(1);

}

Advertising
This manual is related to the following products: