' **********************************************************************
' * Script name:   RTC event                                           *
' * Description:   The device sends the UDP messages at RTC time, this *
' *                message will be generate after x minute defined in  *
' *                the last parameter od the command                   *
' *                With the geofences 1 and 2 we will change the alarm *
' *                period time, use the current date and time as a     *
' *                reference to define the new peeriod of the RTC alarm*
' * Responsible:   Ramiro Sanchez                                      *
' * Date:          05/20/2008                                          *
' **********************************************************************

' --------------------------------------------------------------------
' General configuration
' --------------------------------------------------------------------
AT&F
AT+GSN
AT$PKG?
AT$MDMID?
at+cgatt=0
at+cgdcont=1,"IP","internet3.voicestream.com"
at$friend=1,1,"209.42.60.137"
at$udpapi=,1720


at$RTCTIME?
at$rtcalrm=9,8,13,15,25,0,2
at$RTCTIME?
at$rtcalrm?

at$event=10,1,28,1,1
AT$EVENT=10,3,60,10,3674318
AT$EVENT=10,3,53,10,1

at$event=11,1,21,0,0
AT$EVENT=11,3,60,11,3674318
AT$EVENT=11,3,53,10,1

at$event=12,1,21,1,1
AT$EVENT=12,3,60,12,3674318
AT$EVENT=12,3,53,2,2

at$event=13,1,22,0,0
AT$EVENT=13,3,60,13,3674318
AT$EVENT=13,3,53,2,4

at$event=14,1,22,1,1
AT$EVENT=14,3,60,14,3674318
AT$EVENT=14,3,53,2,8

'use the command at$RTCTIME? to get the current RTC time
'use the command at$rtcalrm? to get the current RTC alarm defined

at+cgatt=1
at$areg=2
at&w

