' **********************************************************************
' * Script name:   Output_Test                                         *
' * Description:   Ustn the geofences the aoutput will be activate or  *
' *                deactivate, in addition the unit will send a message*
' *                to the serial port to indicate the status of the    *
' *                output                                              *
' *                IO changes its states (high/low)                    *
' * Responsible:   Ramiro Sanchez                                      *
' * Date:          02/21/2011                                          *
' **********************************************************************

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

' --------------------------------------------------------------------
' AT commands storage
' --------------------------------------------------------------------
at$stoatev=1,at$iogp2=0
at$stoatev=2,at$msgsnd=0,"output 1 (IO2) deactivate"
at$stoatev=3,at$iogp2=1
at$stoatev=4,at$msgsnd=0,"output 1 (IO2) activate"

at$stoatev=5,at$iogp3=0
at$stoatev=6,at$msgsnd=0,"output 2 (IO3) deactivate"
at$stoatev=7,at$iogp3=1
at$stoatev=8,at$msgsnd=0,"output 2 (IO3) activate"

at$stoatev=9,at$iogp5=0
at$stoatev=10,at$msgsnd=0,"output 3 (IO5) deactivate"
at$stoatev=11,at$iogp5=1
at$stoatev=12,at$msgsnd=0,"output 3 (IO5) activate"

' --------------------------------------------------------------------
' Event definition
' --------------------------------------------------------------------
AT$EVENT=19,1,21,0,0
AT$EVENT=19,3,44,1,0
AT$EVENT=19,3,44,2,0
	
AT$EVENT=20,1,21,1,1
AT$EVENT=20,3,44,3,0
AT$EVENT=20,3,44,4,0

AT$EVENT=21,1,22,0,0
AT$EVENT=21,3,44,5,0
AT$EVENT=21,3,44,6,0

AT$EVENT=22,1,22,1,1
AT$EVENT=22,3,44,7,0
AT$EVENT=22,3,44,8,0

AT$EVENT=23,1,23,0,0
AT$EVENT=23,3,44,9,0
AT$EVENT=23,3,44,10,0

AT$EVENT=24,1,23,1,1
AT$EVENT=24,3,44,11,0
AT$EVENT=24,3,44,12,0

at&w
