def smsProcessing(): RX_API.resetWDT() message = sms.receiveSms() if message is not None: commands = sms_prot.parseCommand(CFG.get('PASS'), message.getText()) if(len(commands) > 0): if(commands[0].getCommand() == 'WRONG_PASSWORD'): sms.sendSms(sms_msg.SmsMessage('0', message.getNumber(), '', 'WRONG PASSWORD')) else: result = '' for c in commands: result = result + executeCommand(c) if(int(CFG.get('SMS_ACK')) > 0): sms.sendSms(sms_msg.SmsMessage('0', message.getNumber(), '', result)) sms.deleteSms(message.getId())
def smsProcessing(): message = sms.receiveSms() if message is not None: commands = sms_prot.parseCommand(CFG.get('PASS'), message.getText()) if(len(commands) > 0): if(commands[0].getCommand() == 'WRONG_PASSWORD'): print ('Wrong password') else: result = '' for c in commands: result = result + executeCommand(c) sms.sendSms(sms_msg.SmsMessage('0', message.getNumber(), '', result)) if(CFG.get('SMSDELETEALL') == '0'): sms.deleteSms(message.getId()) if(CFG.get('SMSDELETEALL') == '1'): sms.deleteSms(message.getId())
grayscale = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # detect faces in the grayscale frame faces = detector(grayscale, 0) if len(faces) != 1: numOfFrames2 += 1 if numOfFrames2 >= FRAMES_BELOW_EAR_MAX: if alert == False: alert = True led.on() if sent: sent = 0 sendSms( phone, "UNSAFE DRIVING ALERT:\nHello, Please contact " + name + " , to ensure their safety while driving.They are currently at " + findAddress(), ) cv2.putText( frame, "PAY ATTENTION!", (20, 30), cv2.FONT_HERSHEY_DUPLEX, 0.8, (255, 255, 255), 2, ) else: numOfFrames2 = 0
def sendAlert(text): for num in CFG.getList('ALERT'): print('Send alert to: %s\r' % (num)) sms.sendSms(sms_msg.SmsMessage('0', num, '', text))
def notify(): data=request.form sendSms(dict(data)) return jsonify({"msg":"your response is sent"})
def sendAlarm(text): r = -1; for num in CFG.getList('ALARMPHONES'): print 'Send alarm to: %s' % (num) r = sms.sendSms(sms_msg.SmsMessage('0', num, '', text)) return r
def sendAlert(text): for num in CFG.getList('ALERT'): RX_API.resetWDT() SER.send('Send alert to: %s\r' % (num)) sms.sendSms(sms_msg.SmsMessage('0', num, '', text))