Esempio n. 1
0
def fsm_monitor_connection(nm: nmoperations.NM):
    if nm.is_connected_to_internet():
        logging.info("monitor_connection: connected to internet")
        wait_then_run(60, fsm_monitor_connection, [nm], blocking=True)
    else:
        logging.info("monitor_connection: not connected to internet")
        enable_ap(nm)
Esempio n. 2
0
def fsm_is_conn_b(nm: nmoperations.NM):
    if nm.is_connected_to_internet():
        logging.info("is_conn_b: connected to internet, monitoring connection")
        fsm_monitor_connection(nm)
    else:
        logging.info(
            "is_conn_b: not connected to internet, going into AP mode")
        enable_ap(nm)
Esempio n. 3
0
def fsm_is_conn_a(nm: nmoperations.NM):
    if nm.is_connected_to_internet():
        logging.info("is_conn_a: connected to internet, monitoring connection")
        fsm_monitor_connection(nm)
    else:
        logging.info(
            "is_conn_a: not connected to internet, attempting to connect to any open network"
        )
        fsm_connect_any(nm)