NEED HELP IN PYTHON CODE
this code is a part of function that make an array of received SMS's so you can read them and send a reply on them.
but it keeps entering the loop which is not what suppose to happen.
Anyone can help?
MDM.send('AT+CMGL="REC UNREAD"\r', 0)
smslist = ' '
res = ' '
timeout = MOD.secCounter() + 60
while ( (res.find('\r\nOK\r\n') == -1) and (MOD.secCounter() < timeout) ):
debugmsg('Timeout now: %d timeout: %d' % (MOD.secCounter(), timeout))
res = MDM.receive(50)
smslist = smslist + res
#debugmsg('get %s' % smslist)
MOD.sleep(1)#wait 0.1sec
smsparts = smslist.split('\r\n')
smspartslen = len(smsparts)
debugmsg('SMS Parts %d' % smspartslen)
smsmsgs = []
|