
Remote script download using RC intrinsic function
LZT 123 7799 R1B
9
3.3 Embedded Application Code
The following code sample (using Sony Ericsson’s M2mpower help file)
can be used to set-up the RC functionality within a script.
/* This example shows how simple Over the Air Download can work
using the RC function. */
int
Rslt;
RemoteMode ()
{
int
st = 0;
int
first;
int
num;
int
cnt;
st = 0;
cnt = 0;
chcrt
(1);
prtf
(
"\nRemote Mode\n"
);
/* auto answer on data channel */
chw
(1,
"ATS0=1\n\r"
, 8);
/* wait for data mode */
st = 0;
first = 1;
while
(st == 0 && cnt < 60)
{
/* check status of call every second */
dlys
(1);
cnt++;
st
=
chsts
(1);
/* check for DCD */
st = st & 0x02;
}
/* setup remote control */
while
(st != 0)
{
if
(first == 1)
{
st
=
rc
(1);
prtf
(
"rc status NUMBER 1 = %d\n"
, st);
first
=
0;
}