microsoft / jacdac

Device and service catalogs for Jacdac.
https://aka.ms/jacdac
Creative Commons Attribution 4.0 International
66 stars 25 forks source link

Device error state #10

Closed pelikhan closed 3 years ago

pelikhan commented 4 years ago

Is there a register to surface an error state in device?

pelikhan commented 4 years ago

Is there a register for the error state of a device?

mmoskal commented 4 years ago

@jamesadevine should we have a string register in control service? or maybe a common string register for every service? or should that be numeric?

@pelikhan do you have specific use cases in mind?

I was thinking hardware errors like:

pelikhan commented 4 years ago

I was thinking about surfacing the panic error code.

jamesadevine commented 4 years ago

I was thinking a register in the control service that exposes a "list" of errors if there are any.

In the case where hardware isn't working, I think it is better to panic and send a message over JACDAC.

pelikhan commented 4 years ago

should a device has a "safe boot" option that ignores all sensors and just broadcasts the error code?

mmoskal commented 4 years ago

It could just broadcast while the sensors are broken, I don't think there's much need to safe boot.

pelikhan commented 4 years ago

does jacdac still broadcast while in panic mode?

pelikhan commented 4 years ago

I understand we want to avoid a broken device polluting the bus with error messages.

jamesadevine commented 4 years ago

Yeah, I think you'd just continue sending advertisement reports with some error flag set. A JD debugger/brain could then interrogate a device for its error state when connected

tballmsft commented 3 years ago

Kinds of Failures:

Common failure codes for JACDAC:

Take a look at: https://en.wikipedia.org/wiki/CAN_bus

pelikhan commented 3 years ago

Base register in the service definition

pelikhan commented 3 years ago

https://github.com/microsoft/jacdac/pull/91