Skip to content

Commit

Permalink
Update to better support DFU devices
Browse files Browse the repository at this point in the history
  • Loading branch information
JaciBrunning committed Dec 26, 2023
1 parent 99b1b7f commit 45d715a
Show file tree
Hide file tree
Showing 11 changed files with 156 additions and 286 deletions.
154 changes: 55 additions & 99 deletions grapple-hook/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"title": "MegaSchema",
"type": "object",
"required": [
"firmware_req",
"firmware_rsp",
"lasercan_req",
"lasercan_rsp",
"old_version_req",
Expand All @@ -11,6 +13,12 @@
"provider_manager_rsp"
],
"properties": {
"firmware_req": {
"$ref": "#/definitions/FirmwareUpgradeDeviceRequest"
},
"firmware_rsp": {
"$ref": "#/definitions/FirmwareUpgradeDeviceResponse"
},
"lasercan_req": {
"$ref": "#/definitions/LaserCanRequest"
},
Expand All @@ -36,10 +44,10 @@
{
"type": "object",
"required": [
"Serial"
"Dfu"
],
"properties": {
"Serial": {
"Dfu": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
Expand All @@ -50,12 +58,12 @@
{
"type": "object",
"required": [
"CanId"
"Serial"
],
"properties": {
"CanId": {
"Serial": {
"type": "integer",
"format": "uint8",
"format": "uint32",
"minimum": 0.0
}
},
Expand Down Expand Up @@ -246,24 +254,6 @@
},
"FirmwareUpgradeDeviceRequest": {
"oneOf": [
{
"type": "object",
"required": [
"data",
"method"
],
"properties": {
"data": {
"type": "object"
},
"method": {
"type": "string",
"enum": [
"start_field_upgrade"
]
}
}
},
{
"type": "object",
"required": [
Expand Down Expand Up @@ -317,24 +307,6 @@
},
"FirmwareUpgradeDeviceResponse": {
"oneOf": [
{
"type": "object",
"required": [
"data",
"method"
],
"properties": {
"data": {
"type": "null"
},
"method": {
"type": "string",
"enum": [
"start_field_upgrade"
]
}
}
},
{
"type": "object",
"required": [
Expand Down Expand Up @@ -564,20 +536,12 @@
],
"properties": {
"data": {
"type": "object",
"required": [
"long"
],
"properties": {
"long": {
"type": "boolean"
}
}
"type": "object"
},
"method": {
"type": "string",
"enum": [
"set_range"
"start_field_upgrade"
]
}
}
Expand All @@ -592,18 +556,18 @@
"data": {
"type": "object",
"required": [
"roi"
"long"
],
"properties": {
"roi": {
"$ref": "#/definitions/LaserCanRoi"
"long": {
"type": "boolean"
}
}
},
"method": {
"type": "string",
"enum": [
"set_roi"
"set_range"
]
}
}
Expand All @@ -618,20 +582,18 @@
"data": {
"type": "object",
"required": [
"budget"
"roi"
],
"properties": {
"budget": {
"type": "integer",
"format": "uint8",
"minimum": 0.0
"roi": {
"$ref": "#/definitions/LaserCanRoi"
}
}
},
"method": {
"type": "string",
"enum": [
"set_timing_budget"
"set_roi"
]
}
}
Expand All @@ -646,18 +608,20 @@
"data": {
"type": "object",
"required": [
"msg"
"budget"
],
"properties": {
"msg": {
"$ref": "#/definitions/GrappleDeviceRequest"
"budget": {
"type": "integer",
"format": "uint8",
"minimum": 0.0
}
}
},
"method": {
"type": "string",
"enum": [
"grapple"
"set_timing_budget"
]
}
}
Expand All @@ -676,14 +640,14 @@
],
"properties": {
"msg": {
"$ref": "#/definitions/FirmwareUpgradeDeviceRequest"
"$ref": "#/definitions/GrappleDeviceRequest"
}
}
},
"method": {
"type": "string",
"enum": [
"firmware"
"grapple"
]
}
}
Expand Down Expand Up @@ -723,7 +687,7 @@
"method": {
"type": "string",
"enum": [
"set_range"
"start_field_upgrade"
]
}
}
Expand All @@ -741,7 +705,7 @@
"method": {
"type": "string",
"enum": [
"set_roi"
"set_range"
]
}
}
Expand All @@ -759,7 +723,7 @@
"method": {
"type": "string",
"enum": [
"set_timing_budget"
"set_roi"
]
}
}
Expand All @@ -772,12 +736,12 @@
],
"properties": {
"data": {
"$ref": "#/definitions/GrappleDeviceResponse"
"type": "null"
},
"method": {
"type": "string",
"enum": [
"grapple"
"set_timing_budget"
]
}
}
Expand All @@ -790,12 +754,12 @@
],
"properties": {
"data": {
"$ref": "#/definitions/FirmwareUpgradeDeviceResponse"
"$ref": "#/definitions/GrappleDeviceResponse"
},
"method": {
"type": "string",
"enum": [
"firmware"
"grapple"
]
}
}
Expand Down Expand Up @@ -920,7 +884,7 @@
"method": {
"type": "string",
"enum": [
"get_error"
"start_field_upgrade"
]
}
}
Expand All @@ -938,7 +902,7 @@
"method": {
"type": "string",
"enum": [
"get_firmware_url"
"get_error"
]
}
}
Expand All @@ -951,20 +915,12 @@
],
"properties": {
"data": {
"type": "object",
"required": [
"msg"
],
"properties": {
"msg": {
"$ref": "#/definitions/GrappleDeviceRequest"
}
}
"type": "object"
},
"method": {
"type": "string",
"enum": [
"grapple"
"get_firmware_url"
]
}
}
Expand All @@ -983,14 +939,14 @@
],
"properties": {
"msg": {
"$ref": "#/definitions/FirmwareUpgradeDeviceRequest"
"$ref": "#/definitions/GrappleDeviceRequest"
}
}
},
"method": {
"type": "string",
"enum": [
"firmware"
"grapple"
]
}
}
Expand All @@ -1007,12 +963,12 @@
],
"properties": {
"data": {
"type": "string"
"type": "null"
},
"method": {
"type": "string",
"enum": [
"get_error"
"start_field_upgrade"
]
}
}
Expand All @@ -1025,15 +981,12 @@
],
"properties": {
"data": {
"type": [
"string",
"null"
]
"type": "string"
},
"method": {
"type": "string",
"enum": [
"get_firmware_url"
"get_error"
]
}
}
Expand All @@ -1046,12 +999,15 @@
],
"properties": {
"data": {
"$ref": "#/definitions/GrappleDeviceResponse"
"type": [
"string",
"null"
]
},
"method": {
"type": "string",
"enum": [
"grapple"
"get_firmware_url"
]
}
}
Expand All @@ -1064,12 +1020,12 @@
],
"properties": {
"data": {
"$ref": "#/definitions/FirmwareUpgradeDeviceResponse"
"$ref": "#/definitions/GrappleDeviceResponse"
},
"method": {
"type": "string",
"enum": [
"firmware"
"grapple"
]
}
}
Expand Down
Loading

0 comments on commit 45d715a

Please sign in to comment.