added test of check_modem
This commit is contained in:
parent
e7e855049a
commit
8c37fe23d0
1 changed files with 21 additions and 0 deletions
21
check_modem.py
Normal file
21
check_modem.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from pydbus import SystemBus
|
||||
from gi.repository import GLib
|
||||
import sms_functions
|
||||
|
||||
# Setup logging
|
||||
logfile = "/opt/sms/sms.log"
|
||||
FORMAT = '%(asctime)-15s %(message)s'
|
||||
logging.basicConfig(format=FORMAT,filename=logfile,level=10)
|
||||
logger = logging.getLogger('check_modem')
|
||||
|
||||
if __name__ == "__main__":
|
||||
modem = sms_functions.unlock_and_enable_modem()
|
||||
while not modem.GetStatus().get('signal-quality', None) or not modem.GetStatus()['signal-quality'][1]:
|
||||
modem = sms_functions.get_modem()
|
||||
time.sleep(2)
|
Loading…
Add table
Add a link
Reference in a new issue