diff --git a/src/infuse_iot/generated/kv_definitions.py b/src/infuse_iot/generated/kv_definitions.py index 86af714..5f67682 100644 --- a/src/infuse_iot/generated/kv_definitions.py +++ b/src/infuse_iot/generated/kv_definitions.py @@ -278,6 +278,17 @@ class lte_networking_modes(VLACompatLittleEndianStruct): ] _pack_ = 1 + class lte_sim_imsi(VLACompatLittleEndianStruct): + """'International Modem Subscriber Identity' as returned by AT+CIMI""" + + NAME = "LTE_SIM_IMSI" + BASE_ID = 47 + RANGE = 1 + _fields_ = [ + ("imsi", ctypes.c_uint64), + ] + _pack_ = 1 + class bluetooth_peer(VLACompatLittleEndianStruct): """Bluetooth peer device""" @@ -404,6 +415,7 @@ class secure_storage_reserved(VLACompatLittleEndianStruct): 44: lte_sim_uicc, 45: lte_pdp_config, 46: lte_networking_modes, + 47: lte_sim_imsi, 50: bluetooth_peer, 51: lora_config, 52: bluetooth_throughput_limit, diff --git a/src/infuse_iot/generated/tdf_definitions.py b/src/infuse_iot/generated/tdf_definitions.py index b0dacd2..2360805 100644 --- a/src/infuse_iot/generated/tdf_definitions.py +++ b/src/infuse_iot/generated/tdf_definitions.py @@ -1503,6 +1503,38 @@ class exception_stack_frame(TdfReadingBase): "frame": "0x{:08x}", } + class battery_voltage(TdfReadingBase): + """Battery voltage""" + + ID = 53 + NAME = "BATTERY_VOLTAGE" + _fields_ = [ + ("voltage", ctypes.c_uint16), + ] + _pack_ = 1 + _postfix_ = { + "voltage": "mV", + } + _display_fmt_ = { + "voltage": "{}", + } + + class battery_soc(TdfReadingBase): + """Battery state of charge""" + + ID = 54 + NAME = "BATTERY_SOC" + _fields_ = [ + ("soc", ctypes.c_uint8), + ] + _pack_ = 1 + _postfix_ = { + "soc": "%", + } + _display_fmt_ = { + "soc": "{}", + } + id_type_mapping: dict[int, type[TdfReadingBase]] = { readings.announce.ID: readings.announce, @@ -1554,6 +1586,8 @@ class exception_stack_frame(TdfReadingBase): readings.wifi_disconnected.ID: readings.wifi_disconnected, readings.network_scan_count.ID: readings.network_scan_count, readings.exception_stack_frame.ID: readings.exception_stack_frame, + readings.battery_voltage.ID: readings.battery_voltage, + readings.battery_soc.ID: readings.battery_soc, } __all__ = [ diff --git a/src/infuse_iot/tools/localhost/index.html b/src/infuse_iot/tools/localhost/index.html index 53c9e97..d833adb 100644 --- a/src/infuse_iot/tools/localhost/index.html +++ b/src/infuse_iot/tools/localhost/index.html @@ -1,5 +1,7 @@ + +
diff --git a/src/infuse_iot/zephyr/lte.py b/src/infuse_iot/zephyr/lte.py index aba4d08..3d24089 100644 --- a/src/infuse_iot/zephyr/lte.py +++ b/src/infuse_iot/zephyr/lte.py @@ -22,7 +22,7 @@ def __str__(self): self.REGISTERED_ROAMING: "Registered (Roaming)", self.UICC_FAIL: "SIM card failure", } - return pretty_names[self.value] + return pretty_names[self] class AccessTechnology(enum.IntEnum): @@ -36,7 +36,7 @@ def __str__(self): self.LTE_M: "LTE-M", self.NB_IOT: "NB-IoT", } - return pretty_names[self.value] + return pretty_names[self] class LteSystemMode(enum.IntEnum): @@ -60,7 +60,7 @@ def __str__(self): self.LTE_M_NB_IOT_GNSS: "LTE-M + NB-IoT + GNSS", self.DEFAULT: "Modem default", } - return pretty_names[self.value] + return pretty_names[self] class LteSystemPreference(enum.IntEnum): @@ -78,7 +78,7 @@ def __str__(self): self.PLMN_LTE_M: "PLMN > LTE-M", self.PLMN_NB_IOT: "PLMN > NB-IoT", } - return pretty_names[self.value] + return pretty_names[self] class LteBand: diff --git a/src/infuse_iot/zephyr/wifi.py b/src/infuse_iot/zephyr/wifi.py index 20a9cfb..189d535 100644 --- a/src/infuse_iot/zephyr/wifi.py +++ b/src/infuse_iot/zephyr/wifi.py @@ -37,7 +37,7 @@ def __str__(self): self.BAND_5_GHZ: "5 GHz", self.BAND_6_GHZ: "6 GHz", } - return pretty_names[self.value] + return pretty_names[self] class FrequencyChannel(enum.IntEnum): @@ -67,7 +67,7 @@ def __str__(self): self.WIFI_802_11ax_6Ghz: "802.11.ax (6 GHz)", self.WIFI_802_11be: "802.11.be", } - return pretty_names[self.value] + return pretty_names[self] class SecurityType(enum.IntEnum): @@ -91,4 +91,4 @@ def __str__(self): self.WEP: "WEP", self.WPA_PSK: "WPA-PSK", } - return pretty_names[self.value] + return pretty_names[self]