View Full Version : Plugin ideas

May 25th, 2016, 04:50 PM
I was thinking about working on a plugin to do simple HTTP GET or POST requests and organizing them similar to the simpleTransport plugin. My use case would be for DirecTV SHEF protocol control of a DirecTV DVR.

I wasn't sure if this should be written as a separate plugin or if it would be better to modify the simpleTransport plugin to reuse some of the structure that is already in place. The major difference from simpleTransport is that this would be a new connection for each command/response, with the connection closed immediately after that. I'm not certain if that could work as another connection method added to simpleTransport or if it would be incompatible with the code already in place.

This feature could also potentially be used for controlling Kodi via HTTP. However, I think having a preprocessor script for the data sent through simpleTransport would be even better for controlling Kodi over a simple TCP connection instead of via HTTP. But Kodi could be controlled with simpleTransport as it is now if the predefined commands contained properly encoded JSON and the transport type is set to PASSTHROUGH.

I have been looking at the code for simpleTransport to see if these changes would be possible. Adding a preprocessor for the data to be sent seems like it would be quite simple to accomplish. I have not delved deeply enough to know if simpleTransport could also work with the one connection per transaction model required by the SHEF protocol. Perhaps you have some ideas about the best way to accomplish these goals?

May 26th, 2016, 11:05 AM
though I am not a expert I am pretty sure this can be a separate plugin as the concepts seems quite similar to the one I did for TCP Lightbulbs. have a look at the code http://www.promixis.com/forums/showthread.php?21820-Plugin-for-TCP-Lighting-Gateways&highlight=tcp+lighting it is linked int he first post.

Hope this helps,

May 26th, 2016, 11:12 AM
Yonu is right, forcing HTTP requests on the simple transport plugin would not be ideal. We have network.get/put/post available in Lua...

May 31st, 2016, 01:10 PM
Fair enough. What about the other idea about adding the ability to add a lua preprocessor for outgoing data?