Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "infuse_iot"
version = "0.2.1"
version = "0.3.0"
authors = [{name = "Embeint Holdings Pty Ltd", email = "[email protected]"}]
description = "Infuse-IoT Platform python package"
classifiers = [
Expand Down
1 change: 0 additions & 1 deletion src/infuse_iot/cpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ def _cleanup_jumps(cls, old: bytes, instructions: list[Instr]) -> list[Instr]:
if len(instructions) >= 2 and isinstance(instructions[1], SetAddrInstr):
# ADDR, COPY, ADRR
if instr.shift == -instructions[1].shift:
print(copy.length)
# Replace with a write instead
merged.append(WriteInstr(old[instr.new : instr.new + copy.length]))
replaced = True
Expand Down
1 change: 1 addition & 0 deletions src/infuse_iot/generated/rpc_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ class response(VLACompatLittleEndianStruct):
("param_2", ctypes.c_uint32),
("thread", 8 * ctypes.c_char),
]
vla_field = ("esf", 0 * ctypes.c_uint32)
_pack_ = 1


Expand Down
5 changes: 4 additions & 1 deletion src/infuse_iot/generated/tdf_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def name(self) -> str:
return self.field

def val_fmt(self) -> str:
return self._display_fmt.format(self.val)
if isinstance(self.val, list) and self._display_fmt != "{}":
return ",".join([self._display_fmt.format(v) for v in self.val])
else:
return self._display_fmt.format(self.val)


class TdfStructBase(ctypes.LittleEndianStructure):
Expand Down
14 changes: 7 additions & 7 deletions src/infuse_iot/generated/tdf_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,14 +1356,14 @@ class lora_rx(TdfReadingBase):
]
_pack_ = 1
_postfix_ = {
"snr": "",
"rssi": "",
"snr": "dB",
"rssi": "dBm",
"payload": "",
}
_display_fmt_ = {
"snr": "{}",
"rssi": "{}",
"payload": "{}",
"payload": "0x{:02x}",
}

class lora_tx(TdfReadingBase):
Expand All @@ -1379,7 +1379,7 @@ class lora_tx(TdfReadingBase):
"payload": "",
}
_display_fmt_ = {
"payload": "{}",
"payload": "0x{:02x}",
}

class idx_array_freq(TdfReadingBase):
Expand All @@ -1394,7 +1394,7 @@ class idx_array_freq(TdfReadingBase):
_pack_ = 1
_postfix_ = {
"tdf_id": "",
"frequency": "",
"frequency": "Hz",
}
_display_fmt_ = {
"tdf_id": "{}",
Expand All @@ -1413,7 +1413,7 @@ class idx_array_period(TdfReadingBase):
_pack_ = 1
_postfix_ = {
"tdf_id": "",
"period": "",
"period": "ns",
}
_display_fmt_ = {
"tdf_id": "{}",
Expand Down Expand Up @@ -1500,7 +1500,7 @@ class exception_stack_frame(TdfReadingBase):
"frame": "",
}
_display_fmt_ = {
"frame": "{}",
"frame": "0x{:08x}",
}


Expand Down
2 changes: 2 additions & 0 deletions src/infuse_iot/rpc_wrappers/last_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ def handle_response(self, return_code, response):
print(f"\t Param 1: 0x{response.param_1:08x}")
print(f"\t Param 2: 0x{response.param_2:08x}")
print(f"\t Thread: {response.thread.decode('utf-8')}")
for idx, val in enumerate(response.esf):
print(f"\t ESF[{idx:2d}]: 0x{val:08x}")
Loading