RDK Documentation (Open Sourced RDK Components)
ThunderAccess.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2018 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**
21  * @file ThunderAccess.h
22  * @brief shim for dispatching UVE HDMI input playback
23  */
24 
25 #ifndef THUNDERACCESS_H_
26 #define THUNDERACCESS_H_
27 
28 #include <Module.h>
29 #include <core/core.h>
30 #include <websocket/websocket.h>
31 
32 using namespace std;
33 using namespace WPEFramework;
34 
35 #define THUNDER_RPC_TIMEOUT 5000
36 
37 /**
38  * @class ThunderAccessAAMP
39  * @brief Support Thunder Plugin Access from AAMP
40  */
42 {
43 public:
44  /**
45  * @fn ThunderAccessAAMP
46  * @note Security tocken accusition, controller object creation
47  */
48  ThunderAccessAAMP(std::string callsign, AampLogManager *logObj=NULL);
49 
50  /**
51  * @fn ~ThunderAccessAAMP
52  * @note clean up
53  */
55 
56  /**
57  * @brief ThunderAccessAAMP copy constructor disabled
58  */
59  ThunderAccessAAMP(const ThunderAccessAAMP&) = delete;
60 
61  /**
62  * @brief ThunderAccessAAMP assignment disabled
63  */
64  ThunderAccessAAMP& operator=(const ThunderAccessAAMP&) = delete;
65 
66  /**
67  * @brief ActivatePlugin
68  * @note Plugin activation and Remote object creation
69  * @param Plugin Callsign
70  * @retval true on success
71  * @retval false on failure
72  */
73  bool ActivatePlugin();
74 
75  /**
76  * @fn InvokeJSONRPC
77  * @note Invoke JSONRPC call for the plugin
78  * @param method,param,result, method,waitTime reference to input param, result and waitTime (default = THUNDER_RPC_TIMEOUT)
79  * @retval true on success
80  * @retval false on failure
81  */
82  bool InvokeJSONRPC(std::string method, const JsonObject &param, JsonObject &result, const uint32_t waitTime = THUNDER_RPC_TIMEOUT);
83 
84  /**
85  * @fn SubscribeEvent
86  * @note Subscribe event data for the specific plugin
87  * @param eventName,functionHandler Event name, Event handler
88  * @retval true on success
89  * @retval false on failure
90  */
91  bool SubscribeEvent (string eventName, std::function<void(const WPEFramework::Core::JSON::VariantContainer&)> functionHandler);
92 
93  /**
94  * @fn UnSubscribeEvent
95  * @note unSubscribe event data for the specific plugin
96  * @param eventName Event name
97  * @retval true on success
98  * @retval false on failure
99  */
100  bool UnSubscribeEvent (string eventName);
101 
102 private:
103  /**< The Remote object connected to specific Plugin*/
104  JSONRPC::LinkType<Core::JSON::IElement> *remoteObject;
105  /**< The Remote object connected to controller Plugin*/
106  JSONRPC::LinkType<Core::JSON::IElement> *controllerObject;
107  std::string pluginCallsign;
108  AampLogManager *mLogObj;
109 };
110 #endif // THUNDERACCESS_H_
ThunderAccessAAMP::remoteObject
JSONRPC::LinkType< Core::JSON::IElement > * remoteObject
Definition: ThunderAccess.h:104
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
ThunderAccessAAMP
Support Thunder Plugin Access from AAMP.
Definition: ThunderAccess.h:41
Module.h
Declaration of module name aamp.