def connected_timeout(): log.debug("states: Calling nm.get_active_ssid()") if connection != nm.get_active_ssid(modemgr.get_state_device('CONNECTED')): log.warning("Connection lost on timeout") set_state('HOTSPOT') if modemgr.get_mode() == modemgr.MULTI_MODE: wpa.check_wpa(modemgr.get_ap_device().Interface)
def hotspot_start(): global conn_list log.info("Activating hotspot") hs_ssid = dns_to_conn(dns_names[0]) log.debug("states: Calling nm.get_active_ssid()") if hs_ssid != nm.get_active_ssid(modemgr.get_state_device('HOTSPOT')): mdns.clear_entries() conn_list = [] activate_connection(hs_ssid, 'HOTSPOT') else: log.debug("Didn't need to reactivate - already running") # the connect callback won't happen - let's 'pass' manually timeout_add(100, fake_hs_pass)
def hotspot_start(): global conn_list log.info("Activating hotspot") hs_ssid = dns_to_conn(dns_names[0]) # if we are in two-wifi device mode, skip the reconnect if possible, # to avoid kicking some clients off if hs_ssid != nm.get_active_ssid(modemgr.get_state_device('HOTSPOT')): mdns.clear_entries() conn_list = [] # tolerate Raspberry Pi 2 try: activate_connection(hs_ssid, 'HOTSPOT') except DBusException: log.warn("Error connecting hotspot") else: log.debug("Didn't need to reactivate - already running") # the connect callback won't happen - let's 'pass' manually timeout_add(100, fake_hs_pass)
def delete_connection(self): ssid = nm.get_active_ssid(modemgr.get_link_device()) nm.del_connection_by_ssid(ssid) states.set_state('HOTSPOT')
def connected_timeout(): if connection != nm.get_active_ssid(modemgr.get_state_device('CONNECTED')): log.warn("Connection lost on timeout") set_state('HOTSPOT')
def delete_connection(self): nm.del_connection_by_ssid(nm.get_active_ssid()) states.set_state('HOTSPOT')
def connected_timeout(): if connection != nm.get_active_ssid(): log.warn("Connection lost on timeout") set_state('HOTSPOT')