Skip to content
Open
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
13 changes: 12 additions & 1 deletion HdcpProfile/HdcpProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ namespace WPEFramework
SERVICE_REGISTRATION(HdcpProfile, API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH);

HdcpProfile::HdcpProfile()
: _service(nullptr)
: PluginHost::JSONRPCErrorAssessor<PluginHost::JSONRPCErrorAssessorTypes::FunctionCallbackType>(HdcpProfile::OnJSONRPCError)
,_service(nullptr)
, _connectionId(0)
, _hdcpProfile(nullptr)
, _hdcpProfileNotification(this)
Expand Down Expand Up @@ -163,6 +164,16 @@ namespace WPEFramework
return ("This HdcpProfile Plugin facilitates to persist event data for monitoring applications");
}

uint32_t HdcpProfile::OnJSONRPCError(const Core::JSONRPC::Context&, const string& method, const string& parameters, const uint32_t errorcode, string& errormessage) {
LOGINFO("DBG:OnJSONRPCERROR");
if(method == _T("getHDCPStatus") && (errorcode >= static_cast<uint32_t>(ERROR_BASE) && errorcode < static_cast<uint32_t>(MAX_ERROR_CODE) ))
{
LOGINFO("DBG-Inside If");
errormessage = ERROR_MESSAGE(errorcode);
}
return errorcode;
}

void HdcpProfile::Deactivated(RPC::IRemoteConnection *connection)
{
if (connection->Id() == _connectionId)
Expand Down
3 changes: 2 additions & 1 deletion HdcpProfile/HdcpProfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace WPEFramework {

namespace Plugin {

class HdcpProfile : public PluginHost::IPlugin, public PluginHost::JSONRPC
class HdcpProfile : public PluginHost::IPlugin, public PluginHost::JSONRPCErrorAssessor<PluginHost::JSONRPCErrorAssessorTypes::FunctionCallbackType>
{
private:
class Notification : public RPC::IRemoteConnection::INotification, public Exchange::IHdcpProfile::INotification
Expand Down Expand Up @@ -97,6 +97,7 @@ namespace WPEFramework {
const string Initialize(PluginHost::IShell* service) override;
void Deinitialize(PluginHost::IShell* service) override;
string Information() const override;
static uint32_t OnJSONRPCError(const Core::JSONRPC::Context& context, const string& method, const string& parameters, const uint32_t errorcode, string& errormessage);

private:
void Deactivated(RPC::IRemoteConnection* connection);
Expand Down
17 changes: 17 additions & 0 deletions HdcpProfile/HdcpProfileImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,23 @@
Core::hresult HdcpProfileImplementation::GetHDCPStatus(HDCPStatus& hdcpstatus,bool& success)
{
success = GetHDCPStatusInternal(hdcpstatus);
if(fopen("/opt/check1.txt","r")!=NULL)
{
return ERROR_FILE_IO;
Copy link
Contributor

Choose a reason for hiding this comment

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

}
else if(fopen("/opt/check2.txt","r")!=NULL)
{
return ERROR_PERMISSION_DENIED;
}
else if(fopen("/opt/check3.txt","r")!=NULL)
{
return ERROR_BASE;
}
else if(fopen("/opt/check4.txt","r")!=NULL)
{
return MAX_ERROR_CODE;
}
return Core::ERROR_NONE;
return Core::ERROR_NONE;
}

Expand Down
Loading