示例#1
0
 def __init__(self, port, inQ, outQ, sdebug = 0, debug = 0):
     self.port = port
     self.addr = None
     self.socket = None
     self.discovery_once = False
     self.inQ = inQ
     self.outQ = outQ
     self.fp = None
     self.name = 'vi_app'
     self.trace_enable = 0
     self.stop_web_upload = None
     self.stop_trace = None
     self.stop_monitor = None
     self.stop_button_monitor = None
     self.button_irq_cnt = 1
     self.trace_lock = threading.Lock()
     self.trace_raw_lock = threading.Lock()
     self.threads = []
     self.lost_cnt = 0
     self.gsm = None
     self.bt5 = self.bt5_check()
     self.sdebug = sdebug
     self.debug = debug
     self.boardid = boardid_inquiry(1)
     self.sd_space = 0
     self.usb = None
     # LEDs instances
     pathid = self.boardid > 0
     self.bt_led = xcmodem_led.xcModemLed('bt_led', led_path['bt'][pathid])
     self.wifi_led = xcmodem_led.xcModemLed('wifi_led', led_path['wifi'][pathid])
     self.bat_led_grn = xcmodem_led.xcModemLed('bat_led_grn', led_path['bat_grn'][pathid])
     self.bat_led_red = xcmodem_led.xcModemLed('bat_led_red', led_path['bat_red'][pathid])
     modem_state[self.name] = vi_state.IDLE
     self.charger = SMBus(0)   # open Linux device /dev/ic2-0
     self.led_cntl = SMBus(2)  # open Linux device /dev/ic2-2
     self.charger_fault = 0
     self.battery_check()
示例#2
0
 def __init__(self, sdebug=0, debug=0, tear_off=0):
     self.name = 'gsm_app'
     self.debug = debug
     self.sdebug = sdebug
     if self.debug:
         print(self.name + " init")
     self.gsm_ser = xcmodem_ser.xcModemSer('/dev/ttyACM3', self.sdebug)
     self.gsm_ser.set_speed('115200', '8N1')
     self.led_ctl = boardid_inquiry() > 0
     if self.led_ctl:
         self.gsm_led = xcModemLed('gsm_led', led_path['gsm'][self.led_ctl])
         self.gsm_led.off()
     else:
         self.gsm_led = gsmLed('gsm_led')
         self.gsm_led.default()
     self.start_once = 0
     self.tear_off = tear_off
     self.csq_thread = None
     modem_state[self.name] = app_state.IDLE
示例#3
0
 def __init__(self, sdebug = 0, debug = 0, tear_off = 0):
     self.name = 'gsm_app'
     self.debug = debug
     self.sdebug = sdebug
     if self.debug:
         print (self.name + " init")
     self.gsm_ser = xcmodem_ser.xcModemSer('/dev/ttyACM3', self.sdebug)
     self.gsm_ser.set_speed('115200','8N1')
     self.led_ctl = boardid_inquiry() > 0
     if self.led_ctl:
         self.gsm_led = xcModemLed('gsm_led', led_path['gsm'][self.led_ctl])
         self.gsm_led.off()
     else:
         self.gsm_led = gsmLed('gsm_led')
         self.gsm_led.default()
     self.start_once = 0
     self.tear_off = tear_off
     self.csq_thread = None
     modem_state[self.name] = app_state.IDLE
示例#4
0
 def __init__(self, sdebug=0, debug=0):
     threading.Thread.__init__(self)
     self.name = 'gps_app'
     pathid = boardid_inquiry() > 0
     self.led = xcmodem_led.xcModemLed('gps_led', led_path['gps'][pathid])
     self.gps = xcModemGps(self.name, sdebug, debug)
示例#5
0
 def __init__(self, sdebug = 0, debug = 0):
     threading.Thread.__init__(self)
     self.name = 'gps_app'
     pathid = boardid_inquiry() > 0
     self.led = xcmodem_led.xcModemLed('gps_led', led_path['gps'][pathid])
     self.gps = xcModemGps(self.name, sdebug, debug)