diff --git a/firmware/src/app.rs b/firmware/src/app.rs index 8e9abfa..c082f90 100644 --- a/firmware/src/app.rs +++ b/firmware/src/app.rs @@ -24,6 +24,10 @@ enum Chroma { Black, } +// GetIdentification is always `0x00`, and the device should always return a response starting with +// the two-byte sequence `0x00 [DeviceType]`. Theoretically this leaves space for different devices +// to adopt different schemas (although we hope to only use this as a last resort). + #[derive(Deserialize)] enum Request<'a> { GetIdentification, @@ -38,7 +42,7 @@ enum Request<'a> { #[derive(Serialize)] enum Response<'a> { - GetIdentification { serial: &'a str, model: DeviceType }, + GetIdentification { model: DeviceType, serial: &'a str }, UpdateDisplay, SetPattern, } diff --git a/webapp/src/lib/image/device.ts b/webapp/src/lib/image/device.ts index 6c7e813..584f87e 100644 --- a/webapp/src/lib/image/device.ts +++ b/webapp/src/lib/image/device.ts @@ -26,8 +26,8 @@ const requestSchema = p.enumType('Request', { export type Response = p.InferType const responseSchema = p.enumType('Response', { GetIdentification: p.structVariant('GetIdentification', { - serial: p.string(), model: deviceTypeSchema, + serial: p.string(), }), UpdateDisplay: p.unitVariant('UpdateDisplay'), SetPattern: p.unitVariant('SetPattern'),