From 75685e83136a041924a43d7917ca0f02d88da443 Mon Sep 17 00:00:00 2001 From: CommanderRedYT Date: Thu, 2 Dec 2021 10:07:21 +0100 Subject: [PATCH] Added ota wiki --- OTA-Server.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 OTA-Server.md diff --git a/OTA-Server.md b/OTA-Server.md new file mode 100644 index 0000000..1da4de8 --- /dev/null +++ b/OTA-Server.md @@ -0,0 +1,71 @@ +We have implemented a simple "protocol" called ***otaDescriptor***. This is used to provide information to which builds are available for updating. + +The config parameter should only contain the domain (for example example.com or http://example.com). + +## URL structure +``` +example.com/otaDescriptor?all&username=foo + | | + / \ + / \ + / \ + [ Show all commits ] [ Username (Required) ] + +example.com/otaDescriptor?username=foo&count=8&branch=master + | | | + / | \ + / | \ + / | \ + [ Username (Optional) ] | [ Branch (Optional) ] + | + [ Count (How many commits should be in response; Optional) ] + +example.com/otaDescriptor + +This should return last 10 commits of every user (as no user was specified) +``` +## Responses + +Example response (/otaDescriptor?username=foo): +```json +{ + "availableVersions":{ + "c1d2320.Advanced-Text-renderer":true, + "704109f.master":true, + "aee7a35.master":true, + "dea0280.master":true, + "9a879ec.master":true, + "4411a82.master":true, + "eb7f5a0.master":true, + "9981132.master":true, + "562fc16.master":true, + "d4325f2.master":true + }, + "url":"\/builds\/foo\/{}.bin", + "latest":"\/builds\/foo\/latest.bin", + "currentVersion":"c1d2320.Advanced-Text-renderer", + "currentVersionHasOta":true +} +``` + +Example response (/otaDescriptor?username=foo&branch=master): +```json +{ + "availableVersions":{ + "704109f.master":true, + "aee7a35.master":true, + "dea0280.master":true, + "9a879ec.master":true, + "4411a82.master":true, + "eb7f5a0.master":true, + "9981132.master":true, + "562fc16.master":true, + "d4325f2.master":true, + "740ca46.master":true + }, + "url":"\/builds\/foo\/{}.bin", + "latest":"\/builds\/foo\/latest.bin", + "currentVersion":"704109f.master", + "currentVersionHasOta":true +} +``` \ No newline at end of file