' **********************************************************************
' * Script name:   Input_Test                                          *
' * Description:   The device sends the messages to the serial port    *
' *                whent the input 1 and 2 are in high/low             *
' *                It is not include io dbounce                        *
' *                The device will send the message immediately when   *
' *                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$msgsnd=0,"Input 0 OFF"
at$stoatev=2,at$msgsnd=0,"Input 0 ON"


at$evdel=10;$evdel=11;$evdel=12;$evdel=13

' --------------------------------------------------------------------
' IO1 low
' --------------------------------------------------------------------
at$event=10,0,0,0,0
at$event=10,3,44,1,0

' --------------------------------------------------------------------
' IO1 high
' --------------------------------------------------------------------
at$event=11,0,0,1,1
at$event=11,3,44,2,0

at$areg=2

at&w



