-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Panasonic Viera TV remote control #2137
Conversation
I agree with you. Would it be possible to review the DIAL PR and this one and if it looks good to you I will put them in separate repo, similar to Sming-UPnP and Sming-SSDP ? Note to myself - we are coming close to a recommended file structure for external Sming Libraries. I should spend some time to create a travis.yml template that can be reused in the different external Sming libraries to test / demo the code. Probably we should also create a |
@slaff I've pushed changes to SSDP and UPnP libraries (develop branch) to ensure consistent use of strong enums thoughout. |
Will do.
Also I think a template for such an external library with boiler plate stuff like
Good idea. |
This would be awesome 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slaff I've done a refactor of this and pushed it to my repo https://github.com/mikee47/Sming/tree/feature/panasonic-tv-remote.
Can't test it but it compiles.
I've changed the Client::Connected callback type from (1) to (2) below.
using Connected = Delegate<void(Client& client, HttpConnection& connection, const XML::Document& description)>; // (1)
using Connected = Delegate<void(HttpConnection& connection, const XML::Document& description)>; // (2)
I'm leaning towards (2) for a couple of reasons. First, it's simpler, and secondly for the client
parameter to be useful it may have to be up-cast. In practice it's easier to use a lambda to capture the required parameters instead. In your sample application client is a global so isn't required anyway, which supports my argument in that the application decides how to track it.
Another funny in your code is you've done (bool)node->getValue()
and (int)node->getValue()
which doesn't make sense; I've replaced these with calls to atoi()
assuming they're numeric strings.
Once PR #2154 is merged this PR should be reworked and turned into a sample-application-only targeting Panasonic Viera TVs and explaining in more details the different steps needed to
|
A library and sample application that allows you to control a Panasonic Viera TV directly from an embedded device using Sming.
This PR should be merged AFTER #2136.