feat(vesc): extend motor diagnostics, configuration and transport recovery
Add firmware and extension catalogues, configuration transactions, sample review and QML diagnostics. Preserve explicit authority, bounded retries and stop recovery in motor transport.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
"""Bounded, read-only firmware diagnostics and exact-attachment USB descriptors."""
|
||||
from pathlib import Path
|
||||
from .serial import check_attachment
|
||||
|
||||
|
||||
def read_diagnostics(device):
|
||||
attachment = device.attachment
|
||||
check_attachment(attachment)
|
||||
path = Path('/sys/bus/usb/devices') / attachment.usb
|
||||
usb = {"port": attachment.usb, "tty": attachment.tty, "speed": attachment.speed}
|
||||
for field in ('idVendor', 'idProduct', 'bcdDevice', 'manufacturer', 'product', 'serial'):
|
||||
try:
|
||||
usb[field] = (path / field).read_text()[:256].strip()
|
||||
except OSError:
|
||||
usb[field] = None
|
||||
reports = {name: device.link.diagnostic(name) for name in ('hw_status', 'faults')}
|
||||
check_attachment(attachment)
|
||||
return {"usb": usb, "reports": reports}
|
||||
Reference in New Issue
Block a user