15 lines
303 B
Python
15 lines
303 B
Python
|
import pygsm
|
||
|
|
||
|
modem = pygsm.GsmModem("/dev/ttyS0", baudrate=115200, timeout=1)
|
||
|
modem.boot()
|
||
|
|
||
|
|
||
|
|
||
|
for i in range(25):
|
||
|
try:
|
||
|
temp = modem.command('AT+CMGR=' + str(i+1)+',1')
|
||
|
if "REC READ" in temp[0]:
|
||
|
modem.query('AT+CMGD=' + str(i+1))
|
||
|
except:
|
||
|
pass
|