Specifications

AN93
220 Rev. 0.9
char caOutGoing[256];
cpInputRd_temp = SendAndWaitFor("AT&T7\r", cpInputRd, "OK\r\n", 300); //AT&T7
reset the modem.
printf ("Current %s \n", cpInputRd); cpInputRd=cpInputRd_temp;
printf ("Loading patch:%s...\n", fnamePatch);
if ((hpPatchFile = fopen(fnamePatch, "rb")) == NULL)
{
fprintf(stderr, "The Patch File is missing.\n");
exit(1);
}
AssertRTS(true );
cpInputRd=SendAndWaitFor("ATE1\r", cpInputRd, "OK\r\n", 300);
bool bValidLine = true;
while(bValidLine)
{
bValidLine = GetFileTextLine(caOutGoing);
if(bValidLine)
cpInputRd = SendAndWaitFor(caOutGoing, cpInputRd, "OK\r\n", 3000);
}
cpInputRd = SendAndWaitFor("ATE1\r", cpInputRd, "OK\r\n", 300);
cpInputRd_temp = SendAndWaitFor("AT&T6\r", cpInputRd, "OK\r\n", 300);
printf ("Finish Loading, %s \n", cpInputRd); cpInputRd=cpInputRd_temp;
fclose(hpPatchFile);
}
// Returns FALSE when at end of file
// Stops after first LF.
bool GetFileTextLine(char *cpIn)
{
*cpIn = 0; char cpInChar[8]; cpInChar[1] = 0;
while(!feof(hpPatchFile))
{
cpInChar[0] = fgetc(hpPatchFile);
strcat(cpIn, cpInChar);
if(*cpInChar == '\n')
return TRUE;
}
return FALSE;
}