Skip to content

Commit

Permalink
Merge branch 'next' of https://github.com/rdkcentral/firebolt-apis in…
Browse files Browse the repository at this point in the history
…to native-sdk-source-build
  • Loading branch information
kevinshahfws committed Aug 8, 2024
2 parents 7dfabeb + 7b74c9b commit c34305f
Show file tree
Hide file tree
Showing 29 changed files with 1,640 additions and 43 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# [1.3.0-next.3](https://github.com/rdkcentral/firebolt-apis/compare/v1.3.0-next.2...v1.3.0-next.3) (2024-08-08)


### Bug Fixes

* Small update to Manage SDK test ([#297](https://github.com/rdkcentral/firebolt-apis/issues/297)) ([95e3b0f](https://github.com/rdkcentral/firebolt-apis/commit/95e3b0f211f4a80d4573adc9c1b35d2e74a78777))

# [1.3.0-next.2](https://github.com/rdkcentral/firebolt-apis/compare/v1.3.0-next.1...v1.3.0-next.2) (2024-08-02)


### Features

* Add Metrics.appInfo API ([#294](https://github.com/rdkcentral/firebolt-apis/issues/294)) ([47264b5](https://github.com/rdkcentral/firebolt-apis/commit/47264b5c5c71fd117a52ca50f2e57315932905ad))

# [1.3.0-next.1](https://github.com/rdkcentral/firebolt-apis/compare/v1.2.1-next.4...v1.3.0-next.1) (2024-07-29)


### Features

* CPP App-Passthrough Logic ([#286](https://github.com/rdkcentral/firebolt-apis/issues/286)) ([4eb84ee](https://github.com/rdkcentral/firebolt-apis/commit/4eb84ee08c463915e3b13afec6603541ea0b1ae4))

## [1.2.1-next.4](https://github.com/rdkcentral/firebolt-apis/compare/v1.2.1-next.3...v1.2.1-next.4) (2024-07-29)


### Bug Fixes

* Added Static Metrics template in CPP ([#293](https://github.com/rdkcentral/firebolt-apis/issues/293)) ([a1f75cb](https://github.com/rdkcentral/firebolt-apis/commit/a1f75cb22577c3eded0968ca51ca656336a88506))

## [1.2.1-next.3](https://github.com/rdkcentral/firebolt-apis/compare/v1.2.1-next.2...v1.2.1-next.3) (2024-07-29)


### Bug Fixes

* Added Lifecycle template in cpp ([#292](https://github.com/rdkcentral/firebolt-apis/issues/292)) ([046adc1](https://github.com/rdkcentral/firebolt-apis/commit/046adc18ca7f2d35d02b9ce597be6f330c3b1972))

## [1.2.1-next.2](https://github.com/rdkcentral/firebolt-apis/compare/v1.2.1-next.1...v1.2.1-next.2) (2024-07-01)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@firebolt-js/sdks",
"version": "1.2.1-next.2",
"version": "1.3.0-next.3",
"description": "The Firebolt JS SDK",
"type": "module",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion src/openrpc/discovery.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@
"name": "identifiers",
"summary": "A set of content identifiers for this call to action",
"schema": {
"$ref": "https://meta.comcast.com/firebolt/entity#/definitions/Entity"
"$ref": "https://meta.comcast.com/firebolt/entertainment#/definitions/ContentIdentifiers"
},
"required": true
},
Expand Down
45 changes: 44 additions & 1 deletion src/openrpc/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,50 @@
}
}
]
}
},
{
"name": "appInfo",
"tags": [
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:metrics:general"
]
}
],
"summary": "Inform the platform about an app's build info.",
"params": [
{
"name": "build",
"summary": "The build / version of this app.",
"schema": {
"type": "string"
},
"required": true
}
],
"result": {
"name": "result",
"schema": {
"type": "null"
}
},
"examples": [
{
"name": "Send appInfo metric",
"params": [
{
"name": "build",
"value": "1.2.2"
}
],
"result": {
"name": "result",
"value": null
}
}
]
}
],
"components": {
"schemas": {
Expand Down
2 changes: 1 addition & 1 deletion src/sdks/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@firebolt-js/sdk",
"version": "1.2.1-next.2",
"version": "1.3.0-next.3",
"description": "The Firebolt JS SDK",
"main": "./dist/lib/firebolt.mjs",
"types": "./dist/lib/firebolt.d.ts",
Expand Down
125 changes: 117 additions & 8 deletions src/sdks/core/src/cpp/sdk/cpptest/CoreSDKTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <string>
#include "CoreSDKTest.h"


using namespace std;
bool CoreSDKTest::_connected;
CoreSDKTest::OnPolicyChangedNotification CoreSDKTest::_policyChangedNotification;
Expand Down Expand Up @@ -234,6 +235,18 @@ void CoreSDKTest::GetDeviceName()
}
}

void CoreSDKTest::GetDeviceVersion()
{
Firebolt::Error error = Firebolt::Error::None;
const std::string version = Firebolt::IFireboltAccessor::Instance().DeviceInterface().version(&error);

if (error == Firebolt::Error::None) {
cout << "Get Device Version = " << version.c_str() << endl;
} else {
cout << "Get Device Version status = " << static_cast<int>(error) << endl;
}
}

void CoreSDKTest::OnDeviceNameChangedNotification::onDeviceNameChanged(const std::string& name)
{
cout << "Name changed, new name --> " << name << endl;
Expand Down Expand Up @@ -715,7 +728,41 @@ EnumMap<Firebolt::Lifecycle::LifecycleEventSource> lifecycleEventSourceMap = {
{ Firebolt::Lifecycle::LifecycleEventSource::REMOTE, "remote" }
};

void CoreSDKTest::OnBackgroundNotification::onBackground(const Firebolt::Lifecycle::LifecycleEvent& lifecycleEvent)
void CoreSDKTest::LifecycleReady()
{
Firebolt::Error error = Firebolt::Error::None;
Firebolt::IFireboltAccessor::Instance().LifecycleInterface().ready(&error);
if (error == Firebolt::Error::None) {
cout << "Lifecycle ready is success" << endl;
} else {
cout << "Lifecycle ready status = " << static_cast<int>(error) << endl;
}
}

void CoreSDKTest::LifecycleFinished()
{
Firebolt::Error error = Firebolt::Error::None;
Firebolt::IFireboltAccessor::Instance().LifecycleInterface().finished(&error);
if (error == Firebolt::Error::None) {
cout << "Lifecycle finished is success" << endl;
} else {
cout << "Lifecycle finished status = " << static_cast<int>(error) << endl;
}
}

void CoreSDKTest::LifecycleState()
{
Firebolt::Error error = Firebolt::Error::None;
const std::string state = Firebolt::IFireboltAccessor::Instance().LifecycleInterface().state(&error);

if (error == Firebolt::Error::None) {
cout << "State of the App = " << state.c_str() << endl;
} else {
cout << "State of the App throws an error = " << static_cast<int>(error) << endl;
}
}

void CoreSDKTest::OnBackgroundNotification::onBackground( const Firebolt::Lifecycle::LifecycleEvent& lifecycleEvent)
{
cout <<"onBackground event is triggered" << endl;
cout <<"\tstate: " << ConvertFromEnum<Firebolt::Lifecycle::LifecycleState>(lifecycleStateMap, lifecycleEvent.state) << endl;
Expand Down Expand Up @@ -1026,6 +1073,45 @@ void CoreSDKTest::MetricsStopContent()
}
}

void CoreSDKTest::MetricsReady()
{
Firebolt::Error error = Firebolt::Error::None;
std::optional<std::string> entityId;
bool status = Firebolt::IFireboltAccessor::Instance().MetricsInterface().ready(&error);

if (error == Firebolt::Error::None) {
cout << "Metrics Ready status = " << (status ? "true" : "false") << endl;
} else {
cout << "Metrics Ready status = " << static_cast<int>(error) << endl;
}
}

void CoreSDKTest::MetricsSignIn()
{
Firebolt::Error error = Firebolt::Error::None;
std::optional<std::string> entityId;
bool status = Firebolt::IFireboltAccessor::Instance().MetricsInterface().signIn(&error);

if (error == Firebolt::Error::None) {
cout << "Metrics signIn status = " << (status ? "true" : "false") << endl;
} else {
cout << "Metrics signIn status = " << static_cast<int>(error) << endl;
}
}

void CoreSDKTest::MetricsSignOut()
{
Firebolt::Error error = Firebolt::Error::None;
std::optional<std::string> entityId;
bool status = Firebolt::IFireboltAccessor::Instance().MetricsInterface().signOut(&error);

if (error == Firebolt::Error::None) {
cout << "Metrics signOut status = " << (status ? "true" : "false") << endl;
} else {
cout << "Metrics signOut status = " << static_cast<int>(error) << endl;
}
}

void CoreSDKTest::GetSecondScreenDevice()
{
Firebolt::Error error = Firebolt::Error::None;
Expand Down Expand Up @@ -1242,6 +1328,32 @@ void CoreSDKTest::DiscoveryWatchNext()
}
}

void CoreSDKTest::DiscoveryUserInterest()
{
Firebolt::Error error = Firebolt::Error::None;
Firebolt::Discovery::InterestType type = Firebolt::Discovery::InterestType::INTEREST;
Firebolt::Discovery::InterestReason reason = Firebolt::Discovery::InterestReason::PLAYLIST;

// Set up the entity details
Firebolt::Entity::EntityDetails entity;

// Identifiers
entity.identifiers = "{\"entityId\": \"123\"}";

// Optional Info Metadata
entity.info = Firebolt::Entity::Metadata();
entity.info->title = "A Cool Show";
entity.info->synopsis = "A cool show synopsis";

Firebolt::IFireboltAccessor::Instance().DiscoveryInterface().userInterest(type, reason, entity, &error);

if (error == Firebolt::Error::None) {
cout << "Discovery User Interest is success" << endl;
} else {
cout << "Discovery User Interest status = " << static_cast<int>(error) << endl;
}
}

void CoreSDKTest::DiscoveryPolicy()
{
Firebolt::Error error = Firebolt::Error::None;
Expand Down Expand Up @@ -1399,15 +1511,12 @@ void CoreSDKTest::DiscoveryPurchasedContent()
void CoreSDKTest::DiscoveryLaunch()
{
Firebolt::Error error = Firebolt::Error::None;
cout << "Enter appId :";
getchar();
std::string appId;
getline(cin, appId);
std::string appId = "123";
{
std::optional<Firebolt::Intents::TuneIntent> intent = std::make_optional<Firebolt::Intents::TuneIntent>();
intent.value().action = "tune";
intent.value().data.entity.entityType = "channel";
intent.value().data.entity.channelType = Firebolt::Intents::ChannelEntityChannelType::STREAMING;
intent.value().data.entity.channelType = Firebolt::Entity::ChannelEntityChannelType::STREAMING;
intent.value().data.entity.entityId = "an-ott-channel";
std::string entityId;
std::optional<std::string> appContentData;
Expand All @@ -1416,6 +1525,7 @@ void CoreSDKTest::DiscoveryLaunch()
intent.value().context.source = "voice";
cout << "Calling Discovery Launch TuneIntent method " << endl;
bool status = Firebolt::IFireboltAccessor::Instance().DiscoveryInterface().launch(appId, intent, &error);

if (error == Firebolt::Error::None) {
cout << "Discovery Launch TuneIntent is " << (status ? "true" : "false") << endl;
} else {
Expand Down Expand Up @@ -1453,7 +1563,6 @@ void CoreSDKTest::DiscoveryLaunch()
throw std::runtime_error("DiscoveryLaunch failed. " + errorMessage);
}
}
cin.putback('\n');
}
#ifdef POLYMORPHICS_REDUCER_METHODS
void CoreSDKTest::DiscoveryWatched()
Expand Down Expand Up @@ -1567,4 +1676,4 @@ void CoreSDKTest::OnNavigateToEntityIntentNotification::onNavigateTo(const Fireb
void CoreSDKTest::OnNavigateToTuneIntentNotification::onNavigateTo(const Firebolt::Intents::TuneIntent& intent)
{
cout << "onNavigateTo for action : " << intent.action << endl;
}
}
9 changes: 8 additions & 1 deletion src/sdks/core/src/cpp/sdk/cpptest/CoreSDKTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class CoreSDKTest {
static void GetAccountUid();

static void GetDeviceName();
static void GetDeviceVersion();
static void SubscribeDeviceNameChanged();
static void UnsubscribeDeviceNameChanged();
static void GetDeviceModel();
Expand Down Expand Up @@ -131,6 +132,9 @@ class CoreSDKTest {
static void GetProfileFlags();

static void LifecycleClose();
static void LifecycleFinished();
static void LifecycleReady();
static void LifecycleState();
static void SubscribeLifecycleBackgroundNotification();
static void UnsubscribeLifecycleBackgroundNotification();
static void SubscribeLifecycleForegroundNotification();
Expand All @@ -151,6 +155,9 @@ class CoreSDKTest {

static void MetricsStartContent();
static void MetricsStopContent();
static void MetricsReady();
static void MetricsSignIn();
static void MetricsSignOut();

static void GetSecondScreenDevice();
static void GetSecondScreenProtocols();
Expand All @@ -174,6 +181,7 @@ class CoreSDKTest {
static void SubscribeDiscoveryOnNavigateToLaunchNotification();
static void UnsubscribeDiscoveryOnNavigateToLaunchNotification();
static void DiscoveryWatchNext();
static void DiscoveryUserInterest();

static void ParametersInitialization();

Expand All @@ -199,4 +207,3 @@ class CoreSDKTest {
static KeyboardPasswordAsyncResponse _keyboardPasswordAsyncResponse;
static KeyboardStandardAsyncResponse _keyboardStandardAsyncResponse;
};

Loading

0 comments on commit c34305f

Please sign in to comment.