RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
...
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 } |
10. <PluginName>HAL.cpp: Used to communicate to driver layer in order to get some information or to set some properties.
Please refer to any existing plugins in https://github.com/WebPlatformForEmbedded/ThunderNanoServices/
...
for further clarifications
bitbake wpeframework-plugins
will generate <PluginName>.json and libWPEFrameworkPlugin.so
Copy the plugin library (libWPEFrameworkPlugin.so) to “/usr/lib/wpeframework/plugins”
Copy the Plugin.json file to “/etc/WPEFramework/plugins” so that the controller plugin identify it and list it in the WebUI (controller UI )
Restart the service
systemctl restart wpeframework
Using the command “$ journalctl – u wpeframework | grep <plug-in name>” we can identify, if the newly added plug-in got activated or not
If the plug-in got activated, it will be listed in the WebUI and using Controller plug-in we can control (activate / deactivate) the newly added plugin
Request:
$ curl --request GET http://127.0.0.1:9998/Service/<pluginName>/<function>
eg: $ curl --request GET http://127.0.0.1:9998/Service/Picture/Brightness
Response:
{"brightness":100}
Request:
$ curl --data-binary '{"jsonrpc": "2.0", "id": 3, "method": "Picture.1.brightness"}' http://127.0.0.1:9998/jsonrpc
Response:
{"jsonrpc":"2.0","id":3,"result":{"brightness":100},"success"}