RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
...
...
In wpeframework-plugins workspace :
(cloned from https://github.com/WebPlatformForEmbedded/ThunderNanoServices/)
Create PluginName folderfolder
Inside PluginName directory:
12. Create “CmakeLists.txt” to compile the Plug-in code and to generate the shared library (“.so”)
This will handle all the dependencies as well
32. Module.h: This header file includes the support for JSON request, response, logging etc.,
43. Module.cpp: This file is used to declare the module name for the Plug-in
54. <PluginName>Plugin.json:
...
Code Block | ||
---|---|---|
| ||
{ "$schema": "plugin.schema.json", "info": { "title": "Plugin Name Plugin", "callsign": "PluginName", "locator": "libWPEFrameworkPluginName.so", "status": "production", "description": "The PluginName plugin allows retrieving of various plugin-related information.", "version": "1.0" }, "interface": { "$ref": "{interfacedir}/PluginName.json#" } } |
65. <PluginName>.config: This file is used to set configurations of the Plug-in
...
We can set some other parameters based on our need
76. <PluginName>.h
Declare the plugin class in this which should contains all the structures, variables and methods which are needed for plugin implementation. The interface header auto-generated earlier will be used here,
...
Code Block |
---|
virtual Core::ProxyType<Web::Response> Process(const Web::Request& request) override; |
8 7. <PluginName>.cpp: This class does contains all the definitions for the methods declared in the Plugin.h and those definitions should be defined inside the below namespace.
...
Code Block |
---|
namespace WPEFramework { namespace Plugin { SERVICE_REGISTRATION(Plugin, 1, 0); //All the methods declared in Plugin.h should be defined here } } |
9 8. <PluginName>JsonRpc.cpp: This class is used to register the methods with JSON RPC interface as below
...
Code Block | ||
---|---|---|
| ||
uint32_t Plugin::get_method(ClassName& response) const { //body of the method } uint32_t Plugin::set_method(ClassName& response) const { //body of the method } |
109. <PluginName>HAL.cpp: Used to communicate to driver layer in order to get some information or to set some properties.
...
for further clarifications
Enable the plugin in the main CMakeLists.txt of wpeframework-plugins
bitbake wpeframework-plugins
...