Bindings: Python: Add get_chip_versions

This commit is contained in:
Kyle Schwarz
2025-10-09 22:51:18 -04:00
parent 495632ddb7
commit 5d672d48d4
7 changed files with 199 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import icsneopy
def chip_versions():
devices = icsneopy.find_all_devices()
if len(devices) == 0:
print("no devices found")
return False
device = devices[0]
print(f"selected {device}")
if not device.open():
print("unable to open device")
return False
chip_versions = device.get_chip_versions()
if not chip_versions:
print("no chip versions")
return False
print("chip versions:")
for i in chip_versions:
version = f"{i.major}.{i.minor}.{i.maintenance}.{i.build}"
print(f" id: {i.id}, name: {i.name}, version: {version}")
return True
if __name__ == "__main__":
chip_versions()