Ejemplo n.º 1
0
def stopEngine(sms):
	Helper.writeLog('#Begin: StopEngine function')
	Helper.writeLog('-Password in sms is '+sms.password)

	if Password == SavedPassword and SavedPassword != 0 :
		Helper.writeLog('-In Stop engine Condition')

		GPSLat = getGPSLocation('Lat')
		Helper.writeLog('-Latitude= '+GPSLat)

		GPSLon = getGPSLocation('Lon')
		Helper.writeLog('-Longitude= '+GPSLon)				

		Number = sms.number

		GPIO.setIOvalue(8,0)	

		Helper.writeLog('-Before Sending the SMS')
	
		SMSHandler.sendSMS(Number,'Your car was last seen in this location http://maps.google.com/?q='+GPSLat.rstrip().lstrip()+','+GPSLon.rstrip().lstrip())

		Helper.writeLog('-Deleting SMS')
		SMSHandler.deleteSMS(MessageIndex,'STP')
	else :
		Helper.writeLog('Deleting SMS')
		SMSHandler.deleteSMS(MessageIndex,'STP 2')	
Ejemplo n.º 2
0
def startEngine(sms):
    Helper.writeLog('#Begin: StartEngine function')
    Helper.writeLog('-Password in sms is ' + sms.password)

    if Password == SavedPassword and SavedPassword != 0:
        Helper.writeLog('-In Start engine Condition')

        GPSLat = getGPSLocation('Lat')
        Helper.writeLog('-Latitude= ' + GPSLat)

        GPSLon = getGPSLocation('Lon')
        Helper.writeLog('-Longitude= ' + GPSLon)

        GPIO.setIOvalue(8, 1)

        Helper.writeLog('-Before Sending the SMS')

        SMSHandler.sendSMS(
            Number,
            'Your car now is ready to start at this location http://maps.google.com/?q='
            + GPSLat.rstrip().lstrip() + ',' + GPSLon.rstrip().lstrip())

        Helper.writeLog('-Deleting SMS')
        SMSHandler.deleteSMS(MessageIndex, 'STRT')
    else:
        Helper.writeLog('-Deleting SMS')
        SMSHandler.deleteSMS(MessageIndex, 'STRT 2')
Ejemplo n.º 3
0
def getLocation(sms):
	global SavedPassword
	Helper.writeLog('#Begin: getLocation function')
	Helper.writeLog('-Password in sms is '+sms.password)

	if Password == SavedPassword and SavedPassword != 0 :
		Helper.writeLog('-In Password Condition')

		GPSLat = getGPSLocation('Lat')
		Helper.writeLog('-Latitude= '+GPSLat)

		GPSLon = getGPSLocation('Lon')
		Helper.writeLog('-Longitude= '+GPSLon)
		
		Helper.writeLog('-Before Sending the SMS')
	
		SMSHandler.sendSMS(sms.number,'http://maps.google.com/?q='+GPSLat.rstrip().lstrip()+','+GPSLon.rstrip().lstrip())

		Helper.writeLog('-Deleting SMS')
		SMSHandler.deleteSMS(MessageIndex,'GL')
	else :
		Helper.writeLog('Deleting SMS')
		SMSHandler.deleteSMS(MessageIndex,'GL 2')
		
	Helper.writeLog('##Left: getLocation function')
Ejemplo n.º 4
0
def getLocation(sms):
    global SavedPassword
    Helper.writeLog('#Begin: getLocation function')
    Helper.writeLog('-Password in sms is ' + sms.password)

    if Password == SavedPassword and SavedPassword != 0:
        Helper.writeLog('-In Password Condition')

        GPSLat = getGPSLocation('Lat')
        Helper.writeLog('-Latitude= ' + GPSLat)

        GPSLon = getGPSLocation('Lon')
        Helper.writeLog('-Longitude= ' + GPSLon)

        Helper.writeLog('-Before Sending the SMS')

        SMSHandler.sendSMS(
            sms.number, 'http://maps.google.com/?q=' +
            GPSLat.rstrip().lstrip() + ',' + GPSLon.rstrip().lstrip())

        Helper.writeLog('-Deleting SMS')
        SMSHandler.deleteSMS(MessageIndex, 'GL')
    else:
        Helper.writeLog('Deleting SMS')
        SMSHandler.deleteSMS(MessageIndex, 'GL 2')

    Helper.writeLog('##Left: getLocation function')
Ejemplo n.º 5
0
def stopEngine(sms):
    Helper.writeLog('#Begin: StopEngine function')
    Helper.writeLog('-Password in sms is ' + sms.password)

    if Password == SavedPassword and SavedPassword != 0:
        Helper.writeLog('-In Stop engine Condition')

        GPSLat = getGPSLocation('Lat')
        Helper.writeLog('-Latitude= ' + GPSLat)

        GPSLon = getGPSLocation('Lon')
        Helper.writeLog('-Longitude= ' + GPSLon)

        Number = sms.number

        GPIO.setIOvalue(8, 0)

        Helper.writeLog('-Before Sending the SMS')

        SMSHandler.sendSMS(
            Number,
            'Your car was last seen in this location http://maps.google.com/?q='
            + GPSLat.rstrip().lstrip() + ',' + GPSLon.rstrip().lstrip())

        Helper.writeLog('-Deleting SMS')
        SMSHandler.deleteSMS(MessageIndex, 'STP')
    else:
        Helper.writeLog('Deleting SMS')
        SMSHandler.deleteSMS(MessageIndex, 'STP 2')
Ejemplo n.º 6
0
def update(sms):
	Helper.writeLog('#Begin: Update function')
	Helper.writeLog('-Password in sms is '+sms.password)

	if Password == SavedPassword and SavedPassword != 0:
		Helper.writeLog('-In UPD Pass Condition')
		update(sms.number,MessageIndex)
	else :
		Helper.writeLog('Deleting SMS')
		SMSHandler.deleteSMS(MessageIndex,'UPD 2')
Ejemplo n.º 7
0
def update(sms):
    Helper.writeLog('#Begin: Update function')
    Helper.writeLog('-Password in sms is ' + sms.password)

    if Password == SavedPassword and SavedPassword != 0:
        Helper.writeLog('-In UPD Pass Condition')
        update(sms.number, MessageIndex)
    else:
        Helper.writeLog('Deleting SMS')
        SMSHandler.deleteSMS(MessageIndex, 'UPD 2')
Ejemplo n.º 8
0
def setPwd(sms):
	global SavedPassword
	Helper.writeLog('#Begin: SetPwd function')
	Helper.writeLog('-Password in sms is '+sms.password)

	if sms.password != '' and SavedPassword == 0 :
		Helper.writeLog('-In Password Condition')
		SavedPassword = sms.password
		
		Helper.writeLog('-Number is '+sms.sender)
		Helper.writeLog('-Before Sending the SMS')
		SMSHandler.sendSMS(sms.sender,'Password set successfully')
	elif MessageIndex != '1' :
		Helper.writeLog('-Deleting SMS')
		SMSHandler.deleteSMS(MessageIndex,'SETPWD')
		
	Helper.writeLog('##Left: setPwd function')
Ejemplo n.º 9
0
def setPwd(sms):
    global SavedPassword
    Helper.writeLog('#Begin: SetPwd function')
    Helper.writeLog('-Password in sms is ' + sms.password)

    if sms.password != '' and SavedPassword == 0:
        Helper.writeLog('-In Password Condition')
        SavedPassword = sms.password

        Helper.writeLog('-Number is ' + sms.sender)
        Helper.writeLog('-Before Sending the SMS')
        SMSHandler.sendSMS(sms.sender, 'Password set successfully')
    elif MessageIndex != '1':
        Helper.writeLog('-Deleting SMS')
        SMSHandler.deleteSMS(MessageIndex, 'SETPWD')

    Helper.writeLog('##Left: setPwd function')
Ejemplo n.º 10
0
def deleteAllMessages(sms):
	Helper.writeLog('#Begin: DeleteAllMessages function')
	Helper.writeLog('-Password in sms is '+Password)

	if Password == SavedPassword and SavedPassword != 0 :
		Helper.writeLog('-In Delete All Condition')

		Number = sms.number

		Helper.writeLog('-Before Sending the SMS')

		Helper.writeLog('-Deleting SMS')
		AllSMS = SMSHandler.check4SMS()
		if len(AllSMS) > 1:
			for i in range(1,len(AllSMS)):
				SMSHandler.deleteSMS(AllSMS[i].msgindex,'DELALL')

		SavedPassword = 0
		SMSHandler.sendSMS(Number,'All messages has been deleted!')
	else :
		Helper.writeLog('-Deleting SMS')
		SMSHandler.deleteSMS(MessageIndex,'DELALL 2')
Ejemplo n.º 11
0
def deleteAllMessages(sms):
    Helper.writeLog('#Begin: DeleteAllMessages function')
    Helper.writeLog('-Password in sms is ' + Password)

    if Password == SavedPassword and SavedPassword != 0:
        Helper.writeLog('-In Delete All Condition')

        Number = sms.number

        Helper.writeLog('-Before Sending the SMS')

        Helper.writeLog('-Deleting SMS')
        AllSMS = SMSHandler.check4SMS()
        if len(AllSMS) > 1:
            for i in range(1, len(AllSMS)):
                SMSHandler.deleteSMS(AllSMS[i].msgindex, 'DELALL')

        SavedPassword = 0
        SMSHandler.sendSMS(Number, 'All messages has been deleted!')
    else:
        Helper.writeLog('-Deleting SMS')
        SMSHandler.deleteSMS(MessageIndex, 'DELALL 2')
Ejemplo n.º 12
0
def startEngine(sms):
	Helper.writeLog('#Begin: StartEngine function')
	Helper.writeLog('-Password in sms is '+sms.password)

	if Password == SavedPassword and SavedPassword != 0 :
		Helper.writeLog('-In Start engine Condition')

		GPSLat = getGPSLocation('Lat')
		Helper.writeLog('-Latitude= '+GPSLat)

		GPSLon = getGPSLocation('Lon')
		Helper.writeLog('-Longitude= '+GPSLon)				

		GPIO.setIOvalue(8,1)	

		Helper.writeLog('-Before Sending the SMS')
	
		SMSHandler.sendSMS(Number,'Your car now is ready to start at this location http://maps.google.com/?q='+GPSLat.rstrip().lstrip()+','+GPSLon.rstrip().lstrip())

		Helper.writeLog('-Deleting SMS')
		SMSHandler.deleteSMS(MessageIndex,'STRT')
	else :
		Helper.writeLog('-Deleting SMS')
		SMSHandler.deleteSMS(MessageIndex,'STRT 2')