EMBEDDED APPLICATIONS FCT
2.4
Telematics Core Service Script {TCS_SMS.sc}
Below is a listing of the TCS application.
char *msgRequest = "Request";
char *msgSchedule = "Schedule";
char *msgStop = "Stop";
/*****************************************************
* Name: ReadSMS
* Arguments: char *d_p, int dLen
* char *a_p, int aLen
* Return: int 1 or 0
* Description: Reads the first un-read SMS
*****************************************************/
ReadSMS (char *d_p, int dLen, char *a_p, int aLen)
{
int sNo = 0;
if (gtf(29) > 0)
{
sNo = smsrs ();
smsrm(d_p, dLen, sNo);
smsra(a_p, aLen, sNo);
smsd(sNo);
prtf("\nReceived SMS [%s,%s]\n", d_p, a_p);
return (1);
}
return (0);
}
/*****************************************************
* Name: SendNavData
* Arguments: char *adrs, int format
* Return: int 1 or 0
* Description: Send navigation data SMS.
* format=0 Raw, format=1 ASCII
*****************************************************/
SendNavData (char *adrs, int format)
{
char pL_p[255];
int pLSze = 0;
int pLCSum = 0;
sbfm(98, format, 0, pL_p, 255, &pLSze, &pLCSum);
prtf("\nReceived NavData Format:%d Size:%d CSum:%d\nData[%s]\n", format, pLSze,
pLCSum, pL_p);
LZT 123 8017 R1A
8