Skip to content

Commit

Permalink
Merge pull request rdkcentral#1405 from anand-ky/main
Browse files Browse the repository at this point in the history
RDK-32875: API getStoreDemoLink
  • Loading branch information
anand-ky authored Jun 17, 2021
2 parents 4af5905 + 9ef4fd7 commit 63ff286
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions SystemServices/SystemServices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ using namespace std;

#define OPTOUT_TELEMETRY_STATUS "/opt/tmtryoptout"

#define STORE_DEMO_FILE "/media/apps/store-mode-video/videoFile.mp4"
#define STORE_DEMO_LINK "http://127.0.0.1:50050/store-mode-video/videoFile.mp4"

/**
* @struct firmwareUpdate
* @brief This structure contains information of firmware update.
Expand Down Expand Up @@ -384,6 +387,9 @@ namespace WPEFramework {
registerMethod("fireFirmwarePendingReboot", &SystemServices::fireFirmwarePendingReboot, this, {2});
registerMethod("setFirmwareRebootDelay", &SystemServices::setFirmwareRebootDelay, this, {2});
registerMethod("setFirmwareAutoReboot", &SystemServices::setFirmwareAutoReboot, this, {2});
#ifdef ENABLE_SYSTEM_GET_STORE_DEMO_LINK
registerMethod("getStoreDemoLink", &SystemServices::getStoreDemoLink, this, {2});
#endif
}


Expand Down Expand Up @@ -3577,6 +3583,18 @@ namespace WPEFramework {
response["Opt-Out"] = optout;
returnResponse(result);
} //end of isOptOutTelemetry

uint32_t SystemServices::getStoreDemoLink(const JsonObject& parameters, JsonObject& response)
{
bool result = false;
if (Utils::fileExists(STORE_DEMO_FILE)) {
result = true;
response["fileURL"] = STORE_DEMO_LINK;
} else {
response["error"] = "missing";
}
returnResponse(result);
}
} /* namespace Plugin */
} /* namespace WPEFramework */

1 change: 1 addition & 0 deletions SystemServices/SystemServices.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ namespace WPEFramework {
uint32_t fireFirmwarePendingReboot(const JsonObject& parameters, JsonObject& response);
uint32_t setFirmwareRebootDelay(const JsonObject& parameters, JsonObject& response);
uint32_t setFirmwareAutoReboot(const JsonObject& parameters, JsonObject& response);
uint32_t getStoreDemoLink(const JsonObject& parameters, JsonObject& response);
}; /* end of system service class */
} /* end of plugin */
} /* end of wpeframework */
Expand Down
5 changes: 5 additions & 0 deletions services.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ if(BUILD_ENABLE_SYSTEM_UPLOAD_LOGS)
add_definitions (-DENABLE_SYSTEM_UPLOAD_LOGS)
endif()

if(ENABLE_SYSTEM_GET_STORE_DEMO_LINK)
message("Building with System Service getStoreDemoLink")
add_definitions (-DENABLE_SYSTEM_GET_STORE_DEMO_LINK)
endif()

if (BUILD_ENABLE_TELEMETRY_LOGGING)
message("Building with telemetry logging")
add_definitions (-DENABLE_TELEMETRY_LOGGING)
Expand Down

0 comments on commit 63ff286

Please sign in to comment.