-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
850 additions
and
703 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include "http/HTTPRequestManager.h" | ||
#include "ota/FirmwareBinaryHash.h" | ||
#include "ota/OtaUpdateChannel.h" | ||
#include "SemVer.h" | ||
|
||
#include <string_view> | ||
|
||
namespace OpenShock::HTTP::FirmwareCDN { | ||
/// @brief Fetches the firmware version for the given channel from the firmware CDN. | ||
/// Valid response codes: 200, 304 | ||
/// @param channel The channel to fetch the firmware version for. | ||
/// @return The firmware version or an error response. | ||
HTTP::Response<OpenShock::SemVer> GetFirmwareVersion(OtaUpdateChannel channel); | ||
|
||
/// @brief Fetches the list of available boards for the given firmware version from the firmware CDN. | ||
/// Valid response codes: 200, 304 | ||
/// @param version The firmware version to fetch the boards for. | ||
/// @return The list of available boards or an error response. | ||
HTTP::Response<std::vector<std::string>> GetFirmwareBoards(const OpenShock::SemVer& version); | ||
|
||
/// @brief Fetches the binary hashes for the given firmware version from the firmware CDN. | ||
/// Valid response codes: 200, 304 | ||
/// @param version The firmware version to fetch the binary hashes for. | ||
/// @return The binary hashes or an error response. | ||
HTTP::Response<std::vector<FirmwareBinaryHash>> GetFirmwareBinaryHashes(const OpenShock::SemVer& version); | ||
} // namespace OpenShock::HTTP::FirmwareCDN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <string> | ||
|
||
namespace OpenShock | ||
{ | ||
struct FirmwareBinaryHash | ||
{ | ||
std::string name; | ||
uint8_t hash[32]; | ||
}; | ||
} // namespace OpenShock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <string> | ||
|
||
namespace OpenShock | ||
{ | ||
struct FirmwareReleaseInfo { | ||
std::string appBinaryUrl; | ||
uint8_t appBinaryHash[32]; | ||
std::string filesystemBinaryUrl; | ||
uint8_t filesystemBinaryHash[32]; | ||
}; | ||
} // namespace OpenShock |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#include "SemVer.h" | ||
|
||
#include <freertos/task.h> | ||
|
||
namespace OpenShock { | ||
class OtaUpdateClient { | ||
public: | ||
OtaUpdateClient(const OpenShock::SemVer& version); | ||
~OtaUpdateClient(); | ||
|
||
bool Start(); | ||
private: | ||
void _task(); | ||
|
||
OpenShock::SemVer m_version; | ||
TaskHandle_t m_taskHandle; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
93585f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cpp-Linter Report⚠️
Some files did not pass the configured checks!
clang-format (v18.1.8) reports: 7 file(s) not formatted
Have any feedback or feature suggestions? Share it here.