Skip to content

feat: Add basic implementation of C++ Client#5

Merged
tomasz-blasz merged 4 commits intomainfrom
feature/cpp-client
Dec 10, 2025
Merged

feat: Add basic implementation of C++ Client#5
tomasz-blasz merged 4 commits intomainfrom
feature/cpp-client

Conversation

@tomasz-blasz
Copy link
Contributor

No description provided.

tomasz-blasz and others added 3 commits December 10, 2025 14:06
* feature: draft cpp api
* chore: Update NOTICE with Sky Copyright section
* device api changed to comply with openrpc api

---------

Co-authored-by: Adam Czynszak <adam.czynszak@sky.uk>
Co-authored-by: Marcin Wojciechowski <marcin.wojciechowski@sky.uk>
This PR contains all changes present in PR #:392

* feat: Split CPP-SDK into separate repositories
  Transport abstraction has been moved into separate repository as the
  same abstraction is being used by other SDKs.
* feat: Set unique name for demo app
* feat: Enable Demo App from the main cmake
* fix: Build demo app from the main cmake and separately
* feat: Do not reference to IModule
* fix: Update to new namespaces introduced in firebolt-native-transport
* feat: Move json types to separate dir
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a comprehensive C++ client implementation for the Firebolt SDK, introducing core functionality for device management, lifecycle control, secure storage, localization, HDMI input handling, metrics, and closed captions management.

Key Changes:

  • Complete C++ SDK implementation with interface abstractions and implementations for multiple Firebolt modules
  • Comprehensive test suite including unit tests and integration tests using GoogleTest
  • Demo application showcasing SDK usage patterns
  • Build system setup using CMake with support for both static and shared libraries

Reviewed changes

Copilot reviewed 57 out of 58 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
include/*.h Public API headers defining interfaces for Device, HDMIInput, Lifecycle, Localization, Metrics, SecureStorage, and ClosedCaptions modules
src/*_impl.{h,cpp} Implementation classes for all SDK modules with JSON serialization/deserialization
src/json_types/* JSON data type converters for translating between C++ types and WPEFramework JSON types
src/firebolt.cpp Main accessor implementation providing unified interface to all SDK modules
test/unit/*Test.cpp Unit tests for all major SDK modules using GoogleTest framework
test/CoreSDKTest.{h,cpp} Integration test suite with comprehensive coverage of SDK functionality
test/Main.cpp, test/Unit.cpp Test harness implementations for both manual and automated test execution
demo/FireboltDemoService.{h,cpp} Demo service showcasing SDK initialization, device queries, and event subscriptions
demo/main.cpp Demo application entry point
CMakeLists.txt, src/CMakeLists.txt, test/CMakeLists.txt, demo/CMakeLists.txt Build configuration for all project components
build.sh, demo/build.sh Build scripts for streamlined compilation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
else
{
std::cout << "Get device video resolution failed, error: << " << videoResolution.error() << std::endl;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in error message: "error: << " has an extra space between colon and "<<". Should be "error: " << "

Suggested change
std::cout << "Get device video resolution failed, error: << " << videoResolution.error() << std::endl;
std::cout << "Get device video resolution failed, error: " << videoResolution.error() << std::endl;

Copilot uses AI. Check for mistakes.
else
{
std::string errorMessage = "Error: " + std::to_string(static_cast<int>(result.error()));
throw std::runtime_error("SetEdidVersionfailed. " + errorMessage);
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in error message: "SetEdidVersionfailed" is missing a space. Should be "SetEdidVersion failed".

Copilot uses AI. Check for mistakes.
Comment on lines +220 to +280
std::cout << "Get device model failed, error: << " << model.error() << std::endl;
}
if (auto name = Firebolt::IFireboltAccessor::Instance().DeviceInterface().name())
{
std::cout << "Device name is: " << *name << std::endl;
result.name = *name;
currentDeviceName_ = *name;
}
else
{
std::cout << "Get device name failed, error: << " << name.error() << std::endl;
}
if (auto platform = Firebolt::IFireboltAccessor::Instance().DeviceInterface().platform())
{
std::cout << "Device platform is: " << *platform << std::endl;
result.platform = *platform;
}
else
{
std::cout << "Get device platform failed, error: << " << platform.error() << std::endl;
}
if (auto type = Firebolt::IFireboltAccessor::Instance().DeviceInterface().type())
{
std::cout << "Device type is: " << *type << std::endl;
result.type = *type;
}
else
{
std::cout << "Get device type failed, error: << " << type.error() << std::endl;
}
if (auto uid = Firebolt::IFireboltAccessor::Instance().DeviceInterface().uid())
{
std::cout << "Device uid is: " << *uid << std::endl;
result.uid = *uid;
}
else
{
std::cout << "Get device uid failed, error: << " << uid.error() << std::endl;
}
if (auto version = Firebolt::IFireboltAccessor::Instance().DeviceInterface().version())
{
std::cout << "SDL version is: " << version->sdk.major << "." << version->sdk.minor << "." << version->sdk.patch
<< " " << version->sdk.readable << std::endl;
std::cout << "API version is: " << version->api.major << "." << version->api.minor << "." << version->api.patch
<< " " << version->api.readable << std::endl;
std::cout << "Firmware version is: " << version->firmware.major << "." << version->firmware.minor << "."
<< version->firmware.patch << " " << version->firmware.readable << std::endl;
std::cout << "Debug version info is: " << version->debug << std::endl;
}
else
{
std::cout << "Device version failed, error: << " << version.error() << std::endl;
}
if (auto networkInfo = Firebolt::IFireboltAccessor::Instance().DeviceInterface().network())
{
std::cout << "Device network is: state: " << static_cast<int>(networkInfo->state) << ", type: " << static_cast<int>(networkInfo->type)
<< std::endl;
}
else
{
std::cout << "Get device network failed, error: << " << networkInfo.error() << std::endl;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple error messages have the same typo: "error: << " with an extra space between colon and "<<". All should be corrected to "error: " << ". This occurs on lines 220, 230, 239, 248, 257, 271, and 280.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -e
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script should use set -eu for strict error handling instead of just set -e. This is consistent with the repository's convention for bash scripts as seen in other scripts.

Suggested change
set -e
set -eu

Copilot uses AI. Check for mistakes.
auto result = Firebolt::IFireboltAccessor::Instance()
.SecureStorageInterface()
.clearForApp("foo", Firebolt::SecureStorage::StorageScope::ACCOUNT);
EXPECT_EQ(result.error(), Firebolt::Error::None) << "Error on calling SecureStorage.removeForApp() method";
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message incorrectly references "SecureStorage.removeForApp()" but this test is for "clearForApp()". The error message should say "Error on calling SecureStorage.clearForApp() method".

Copilot uses AI. Check for mistakes.
}
else
{
std::cout << "Get device id failed, error: << " << id.error() << std::endl;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in error message: "error: << " has an extra space between colon and "<<". Should be "error: " << "

Copilot uses AI. Check for mistakes.
}
else
{
std::cout << "Get device manufacturer failed, error: << " << manufacturer.error() << std::endl;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in error message: "error: << " has an extra space between colon and "<<". Should be "error: " << "

Copilot uses AI. Check for mistakes.
}
else
{
std::cout << "Get device screen resolution failed, error: << " << screenResolution.error() << std::endl;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in error message: "error: << " has an extra space between colon and "<<". Should be "error: " << "

Copilot uses AI. Check for mistakes.
@tomasz-blasz
Copy link
Contributor Author

Copilot suggestions were ignored since the code was cherry-picked from firebolt-apis and should remain intact.

@tomasz-blasz tomasz-blasz merged commit 7f61484 into main Dec 10, 2025
5 checks passed
@tomasz-blasz tomasz-blasz deleted the feature/cpp-client branch December 10, 2025 13:48
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2025
@tomasz-blasz
Copy link
Contributor Author

🎉 This PR is included in version 0.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants