 |
RDK Documentation (Open Sourced RDK Components)
|
32 #include "ccec/Messages.hpp"
33 #include "ccec/Assert.hpp"
34 #include "ccec/Connection.hpp"
35 #include "ccec/host/RDK.hpp"
36 #include "ccec/MessageEncoder.hpp"
37 #include "ccec/LibCCEC.hpp"
38 #include "ccec/drivers/iarmbus/CecIARMBusMgr.h"
43 int main(
int argc,
char *argv[])
49 string delimiter =
":";
57 IARM_Result_t ret = IARM_RESULT_SUCCESS;
59 memset(&dataToSend, 0,
sizeof(dataToSend));
61 cout <<
"********Entered CECCmd tool***********\n";
62 cout <<
"Options : " << endl;
63 cout <<
"1 - To enable CEC\n2 - To disable CEC\n";
64 cout <<
"3 - Send CEC Command\n4 - Exit test application \n";
67 cout <<
"Please enter your selection : \n";
69 cout <<
"Please enter numbers only." << endl;
71 cin.ignore(10000,
'\n');
80 cout <<
"LibCCEC init....................\n";
88 cout <<
"LibCCEC term....................\n";
94 cout <<
"Please enter your CEC Command - eg: 3F:82:10:00" << endl;
96 cout <<
"Command is : " << command << endl;
98 while ((pos = command.find(delimiter)) != string::npos) {
99 token = command.substr(0, pos);
100 dataToSend.data[i++] = (int) strtol(token.c_str(), NULL, 16);
101 command.erase(0, pos + delimiter.length());
103 dataToSend.data[i++] = (int) strtol(command.c_str(), NULL, 16);
104 dataToSend.length = i;
106 if( IARM_RESULT_SUCCESS != ret)
108 cout <<
"Iarm call failed retval " << ret << endl;
118 cout <<
"Invalid Entry" << endl;
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
static LibCCEC & getInstance(void)
This function is used to create the instance for CEC.
IARM_Result_t IARM_Bus_Call(const char *ownerName, const char *methodName, void *arg, size_t argLen)
This API is used to Invoke RPC method by its application name and method name.
void init(const char *name=0)
This function is used to initialize CEC by starting the driver and doing host-specific initialization...
The connection class provides APIs that allows the application to access CEC Bus. A connection is a t...
#define IARM_BUS_CECMGR_NAME
IARM_Result_t IARM_Bus_Disconnect(void)
This API disconnect Application from IARM Bus so the application will not receive any IARM event or R...
RDK IARM-Bus API Declarations.
IARM_Result_t IARM_Bus_Connect(void)
This API is used to connect application to the IARM bus daemon. After connected, the application can ...
void term(void)
This function is used to stop CEC by terminating the connection and stoping the driver.
IARM_Result_t IARM_Bus_Init(const char *name)
This API is used to initialize the IARM-Bus library.