Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FirmwareStatusNotificationRequest(status = Installed) (refs EVEREST-1175) #8

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.14.7)

project(everest-chargebyte VERSION 0.13.0
project(everest-chargebyte VERSION 0.14.0
DESCRIPTION "chargebyte's Hardware EVerest Modules"
LANGUAGES CXX)

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This repository includes the following modules:
## Compatibility matrix
| Tag | EVerest release |
|----------|----------|
| 0.14.0 | 2024.7.0 |
| 0.13.0 | 2024.7.0 |
| 0.12.0 | 2024.5.0 |
| 0.11.0 | 2024.5.0 |
Expand Down
8 changes: 7 additions & 1 deletion modules/CbSystem/main/systemImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@ static std::string get_partition(PartitionType part_type) {
}

void systemImpl::ready() {
// TODO: Remove this sleep when fix of the issues (ref: https://github.com/EVerest/libocpp/issues/758,
// https://github.com/EVerest/everest-core/issues/841) are implemented
sleep(20);
check_update_marker();
}

void systemImpl::check_update_marker() {
// In case the firmware-update marker file exists, we need to check if the firmware update was successful
// and publish the status.
if (fs::exists(MARKER_FILE_PATH)) {
Expand All @@ -159,7 +165,7 @@ void systemImpl::ready() {
if (partition == get_partition(PartitionType::Active)) {
this->publish_firmware_update_status(
{types::system::FirmwareUpdateStatusEnum::Installed, std::stoi(request_id)});
EVLOG_info << "Firmware update was successful";
EVLOG_info << "Firmware update was successful (id: " << request_id << ")";
} else {
this->publish_firmware_update_status(
{types::system::FirmwareUpdateStatusEnum::InstallationFailed, std::stoi(request_id)});
Expand Down
6 changes: 6 additions & 0 deletions modules/CbSystem/main/systemImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ class systemImpl : public systemImplBase {
*/
void install_signed_firmware(const types::system::FirmwareUpdateRequest& firmware_update_reqeust,
const std::filesystem::path& firmware_file_path);

/**
* @brief Checks if the firmware update marker is present and if so,
* notify the upper layer that the firmware update was successfuly installed.
*/
void check_update_marker();
// ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1
};

Expand Down