Closed mmoskal closed 3 years ago
Is the presence of role manager an indicator that the device is a brain?
Yes, I like all of the suggested option bits.
I was never a huge fan of looking for the highest device id, looking for a bit in an announce packet seems much more achievable and universal.
Did we also want to have ones to indicate that parts of the protocol stack are supported? i.e. STREAM_SUPPORTED
We might also want to have a bit field to indicate rough active power consumption?
Another useful one might be the REDUCED_FUNCTIONALITY
flag which indicates to others that the device has limitations, such as an 8 byte receive buffer
Padauk won't be able to detect role manager if it isn't service number 1 (it only can accept up to 8 bytes of payload). So I do think we need a bit. Also there could be a role manager on a ML module, though I guess it's not a brain? Or maybe it is...
As for streams, I think it's a per-service thing. A service either uses streams or it doesn't, no need to advertise that separately for the whole device. I guess you just won't be able to do these services on smallest Padauk (but they are things like TCP, role manager, etc. anyways).
I would skip the power consumption for now, unless we have some understanding of what's needed and have some scenario in mind?
And yes, we definitely want reduced functionality bit. Maybe we can define it as "no multiple packets per frame" and the maximum payload would then be service-dependent (typically 4 bytes, but we can usually easily support 8 since the tx buffer needs 8 byte payload for announce (ctrl + 1 service)).
RoleManager presence was always a bit of a hack.
@mmoskal this is ready on my side.
the documentation went into https://github.com/microsoft/jacdac/blob/main/services/control.md#commands which also fixed packet inspector - so this is done
I propose to reserve bits in word0 of announce packet (we currently have 15 bits free there):