Move DeviceType to first position in GetIdentification
This commit is contained in:
+5
-1
@@ -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,
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ const requestSchema = p.enumType('Request', {
|
||||
export type Response = p.InferType<typeof responseSchema>
|
||||
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'),
|
||||
|
||||
Reference in New Issue
Block a user