Esempio n. 1
0
def _turn_off_echo():
    output = send_at_com("ATE0", "OK")

    if output[2] == 0:
        pass
    else:
        raise ModemNotReachable("Error occured turning of AT echo : send_at_com -> ATE0")
Esempio n. 2
0
def _identify_iccid():
    output = send_at_com(identified_module.ccid_command, "OK")
    raw_iccid = output[0] if output[2] == 0 else ""

    if raw_iccid != "":
        iccid_filter = filter(str.isdigit, raw_iccid)
        system_id["iccid"] = "".join(iccid_filter)
        return system_id["iccid"]
    else:
        raise ModemNotReachable("ICCID couldn't be detected!")
Esempio n. 3
0
def _identify_imei():
    output = send_at_com("AT+CGSN", "OK")
    raw_imei = output[0] if output[2] == 0 else ""

    if raw_imei != "":
        imei_filter = filter(str.isdigit, raw_imei)
        system_id["imei"] = "".join(imei_filter)
        return system_id["imei"]
    else:
        raise ModemNotReachable("IMEI couldn't be detected!")
Esempio n. 4
0
def _identify_fw_version():
    output = send_at_com("AT+CGMR", "OK")
    if output[2] == 0:
        raw = output[0].split("\n")

        for _, value in enumerate(raw):
            if value != "":
                system_id["sw_version"] = value
                break

        if system_id["sw_version"] != "":
            return system_id["sw_version"]
    else:
        raise ModemNotReachable("Firmware Ver. couldn't be detected!")