EMBEDDED APPLICATIONS FCT
LZT 123 8016 R1A
13
else
{
*valstr = val;
}
LCDdata
(*valstr);
scat(sndCmd,
valstr);
}
else if(val == 0x0a) /* SEND key*/
{
if(gtb(8)==1) /*incoming call so answer*/
{
aterr = atsnd(“ATA”, resCmd, 3, 20,
&resCmdSize);
LCDcontrol(0x01);
LCDtext(“Answering”,
9);
}
else if(!(gtf(9))) /*outgoing call so dial number*/
{
CALLING = 1;
LCDcontrol(0xc0);
LCDtext(“Dial”,
4);
scat
(sndCmd,
“;”);
aterr = atsnd (sndCmd, resCmd,
slen(sndCmd),
20,
&resCmdSize);
prtf (“\nsent AT command \n%s”,
sndCmd);
scpy(resndCmd,
sndCmd);
}
}
else if(val == 0x0b) /* REJECT key*/
{
LCDcontrol(0x01);
scpy(sndCmd,
“ATD”);
aterr = atsnd (“ATH”, resCmd, 3, 20,
&resCmdSize);
}
else if(val == 0x0c) /* REDIAL key*/
{
if(!(gtf(9)))
/*outgoing call so dial number*/
{
CALLING = 1;
LCDcontrol(0x01);
LCDtext(“Redial”,
6);
aterr = atsnd (resndCmd, resCmd,
slen(resndCmd),
20,
&resCmdSize);
prtf (“\nsent AT command \n%s”,
resCmd);
}
}
}
}
else
{
PREVKEYPRESSED
=
0;
prtf(“No
Key
Pressed”);
}
if(gtb(8)==1) /*incoming call so answer*/
{
if(!CALLING)
{
CALLING
=
1;