def connect_modems(options): logger = Modem.debug_logger d = {} for id, data_port, control_port in get_modems(options): modem = Modem(id=id, port=data_port, control_port=control_port, logger=logger) modem = modem.boot() # try: # except errors.GsmModemError: # modem.connect() # modem.command('AT+CFUN=0') # time.sleep(4) # modem.init() d.update({id:modem}) return d
def connect_modems(options=None): modem = Modem(port=DATAPORT, control_port=CONTROLPORT) modem.boot() return {'MTN':modem}