SI2457-D-FT Silicon Laboratories Inc, SI2457-D-FT Datasheet - Page 267

no-image

SI2457-D-FT

Manufacturer Part Number
SI2457-D-FT
Description
IC ISOMODEM SYSTEM-SIDE 24TSSOP
Manufacturer
Silicon Laboratories Inc
Datasheets

Specifications of SI2457-D-FT

Lead Free Status / Rohs Status
Lead free / RoHS Compliant
}
// Check for a specific response in the input buffer, and return ptr to what
// follows. If this times out or ERRORs before the response is found then a
// NULL is returned; It keeps reading the ser channel while waiting
char *WaitForResponse(char *cpResponse, char *cpInputBuffer, int iTimeOutInMs)
{
{//copy the received bytes for late display
//cpInputWr has char from the port
if(!cpInBuffRd)
return cpInBuffRd;
unsigned long ulNoOfbytes;
clock_t
clock_t
// covert wait time in ms's to clock_t by mutiplying by CLOCKS_PER_SEC/1000
clock_t
int iPasses
int iCharCnt =0;
while(1)
cpInBuffRd = WaitForResponse(cpResponse, cpInBuffRd, iTimeoutMs);
exit(0);
{
*cpInputWr = 0;
char *cpFound = strstr(cpInputBuffer, cpResponse);
*cpInputWr = cTemp;
if(cpFound)
}
// Setup a 50 ms timeout for reads
sCOMMTIMEOUTS.ReadIntervalTimeout
sCOMMTIMEOUTS.ReadTotalTimeoutMultiplier
sCOMMTIMEOUTS.ReadTotalTimeoutConstant
sCOMMTIMEOUTS.WriteTotalTimeoutMultiplier = 0;
sCOMMTIMEOUTS.WriteTotalTimeoutConstant
SetCommTimeouts(hCom,
// Read the serial port
BOOL bError = !ReadFile(hCom,
iCharCount += ulNoOfbytes;
if(bError)
cpInputWr += ulNoOfbytes;
// check for a timeout
char cTemp = *cpInputWr;
strncpy(cpInput_test, cpInputBuffer, iCharCnt);cpInput_test[iCharCnt]='\0';
return cpFound + strlen(cpResponse);
{
strcat(cpErrorString, "Read Error\r\n");
exit(10); // implement a write to file before exit(0)
}
= 0;
sStartTime
sCurrentTime;
sWaitTime = (clock_t)(iTimeOutInMs*CLOCKS_PER_SEC)/1000;
// set to 0
= clock();
&sCOMMTIMEOUTS);
iCharCnt+=ulNoOfbytes;
cpInputWr, 1, &ulNoOfbytes, 0);
Rev. 1.3
= 0;
= 0;
= 50;
= 0;
AN93
267

Related parts for SI2457-D-FT