PDA

View Full Version : Any way to send a command from SBS plugin to an applet ?



erland
2010-03-02, 23:51
Is there any way to send a command from a SBS plugin that gets/writes data from a Squeezeplay applet ?

Usually the applet will call the plugin to get data, but I'd like to do it the reversed way, making the plugin request information from the applet. Is there any way to do this without needing to bundle dependencies like:
- Copas: http://www.keplerproject.org/copas/
or even
- Xavante: http://www.keplerproject.org/xavante/

The plan is to make it possible to view some files in the SqueezeOS file system through the Squeezebox Server web interface, for example the squeezeplay log and settings files.

A possible solution might be to make the plugin generate an event with "Slim::Request::notifyFromArray" and make the applet call a JSON command offered by the plugin and send it the data, but before going that route I like to know if there is any be a better way to do this.

For the log files it's probably possible to have a resident applet that just pushes the logs to the SBS plugin or maybe even somehow use syslog, but if possible I would prefer a solution that would work for other things than log files.

mherger
2010-03-03, 00:09
> Is there any way to send a command from a SBS plugin that gets/writes
> data from a Squeezeplay applet ?

This enhancement request might be related:
https://bugs.slimdevices.com/show_bug.cgi?id=9914

Without being a SP expert I'd say no, that's not yet possible.

--

Michael

pippin
2010-03-03, 00:30
I'd say: subscribe to a notification on the SP side and send that notification from SBS. Isn't that possible?

erland
2010-03-03, 00:59
I'd say: subscribe to a notification on the SP side and send that notification from SBS. Isn't that possible?

Yes, that's possible, it was the notifyFromArray solution I described in the sentence starting with "A possible solution might be..."

It just gets a bit more complex than a simple call similar to standard JSON command since I need to correlate a callback arriving later from the applet with the previously sent notification. Should be possible to solve though, I just want to make sure there isn't an easier solution available.