An93 – Silicon Laboratories SI2493/57/34/15/04 User Manual
Page 263

AN93
Rev. 1.3
263
char caUA_PKT_STR[] = {(char)0x30, (char)0x73, (char)0x19, (char)0xb1, (char)0 };
char caRR_PKT_STR[] = {(char)0x30, (char)0x19, (char)0xa0, (char)0x19, (char)0xb1, (char)0 };
char caSNRM_PKT_STR[] = {(char)0x30, (char)0x93, (char)0x19, (char)0xb1, (char)0 };
char caRX_PKT_STR[] = {(char)0x19, (char)0xb1, (char)0 };
void AlternateCall(void);
int main(int argc, char* argv[])
{
// Initialize these buffers.
cpInBuffer = (char *)malloc(100000);
cpOutBuffer = (char *)malloc(100000);
cpErrorString = (char *)malloc(100000);
for (int i= 0; i< 10000; i++)
{
cpInBuffer[i] = 0;
cpOutBuffer[i] = 0;
cpErrorString[i] = 0;
}
cpInputRd = cpInBuffer;
cpInputWr = cpInBuffer;
unsigned long ulNoOfbytes;
SetupSerPort();
LoadAndSendPatch();
AssertDTR(true);// Leave DTR asserted for calling
cpInputRd = SendAndWaitFor("atz\r", cpInputRd, "OK\r\n", 300); // A soft reset Just in case
Delay(300); // Important, AN93 implies this delay must be done after an ATZ.
cpInputRd = SendAndWaitFor("ATE0\r", cpInputRd, "OK\r\n", 300);
cpInputRd_temp = SendAndWaitFor("AT&T6\r", cpInputRd, "OK\r\n", 300);// Get the patch CRC
printf ("%s \n", cpInputRd); cpInputRd=cpInputRd_temp; // Display the patch CRC
// setup county of operation ********************MODIFY to your locality******************
// cpInputRd = SendAndWaitFor("at+gci=B5\r", cpInputRd, "OK\r\n", 300);
// &D2 enables escape pin, // X4 enable extended result codes
// \V2 report connect message only // %c0 disable data compression
// %V1 Auto line status detection mode is the fixed method
// +IFC=0,2 No data flow control, Hardware flow control
cpInputRd = SendAndWaitFor("AT&D2x4\\V2%c0%V1+IFC=0,2\r", cpInputRd, "OK\r\n", 300);
// \N0 wire mode, // +FCLASS=1 HDLC mumbo jumbo
cpInputRd = SendAndWaitFor("AT\\N0+FCLASS=1\r", cpInputRd, "OK\r\n", 300);
cpInputRd = SendAndWaitFor("AT:UAA,8004\r", cpInputRd, "OK\r\n", 300);
// +ES=6,,8 enabled synch access, // 6,, enables synch access on initiating a connect