Skip to content

Commit

Permalink
Merge pull request #8 from chargebyte/Fix_FirmwareStatusNotificationR…
Browse files Browse the repository at this point in the history
…eq_Installed_v2

Fix FirmwareStatusNotificationRequest(status = Installed) (refs EVEREST-1175)
  • Loading branch information
FaHaGit authored Sep 4, 2024
2 parents 3c81565 + 0af174d commit 9709c13
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
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

0 comments on commit 9709c13

Please sign in to comment.