Bug 14668 - udev notification support
: udev notification support
Status: CLOSED FIXED
Product: SqueezePlay
Classification: Unclassified
Component: API
: unspecified
: PC Other
: P1 normal (vote)
: 7.5.0
Assigned To: Richard Titmuss
: TinySC
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-08 10:23 UTC by Richard Titmuss
Modified: 2010-04-08 17:24 UTC (History)
1 user (show)

See Also:
Category: Feature


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Titmuss 2009-10-08 10:23:04 UTC
Add api so when disks and cards are added a ui can be displayed and actions taken.
Comment 1 SVN Bot 2009-11-03 06:13:37 UTC
 == Auto-comment from SVN commit #8000 to the jive repo by richard ==
 == https://svn.slimdevices.com/jive?view=revision&revision=8000 ==

Fixed Bug #14668
Added udev notification in SqueezePlay, to detect device installation/removal. This will allow dialogs to be displayed when usb or sd cards are used.

An example of how this can be used to detect usb devices follows. The "usb" is a filter (lua regex) to used before calling the function. Using "" will show all events.

Index: share/applets/SqueezeboxFab4/SqueezeboxFab4Meta.lua
===================================================================
--- share/applets/SqueezeboxFab4/SqueezeboxFab4Meta.lua (revision 7980)
+++ share/applets/SqueezeboxFab4/SqueezeboxFab4Meta.lua (working copy)
@@ -92,6 +92,7 @@
        meta:registerService("poweroff")
        meta:registerService("reboot")
        meta:registerService("wasLastShutdownUnclean")
+       meta:registerService("addUeventListener")
 end
 
 
Index: share/applets/SBSSettings/SBSSettingsMeta.lua
===================================================================
--- share/applets/SBSSettings/SBSSettingsMeta.lua       (revision 7980)
+++ share/applets/SBSSettings/SBSSettingsMeta.lua       (working copy)
@@ -5,6 +5,8 @@
 
 local Framework     = require("jive.ui.Framework")
 
+local debug         = require("jive.utils.debug")
+
 local appletManager = appletManager
 local jiveMain      = jiveMain
 
@@ -23,6 +25,14 @@
 end
 
 
+function configureApplet(meta)
+       appletManager:callService("addUeventListener", "usb", function(evt, msg)
+               log:warn("UDEV: ", evt)
+               debug.dump(msg)
+       end)
+end
+
+
 --[[
 
 =head1 LICENSE
Comment 2 Chris Owens 2010-04-08 17:24:49 UTC
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release.

If you are still seeing this issue, please let us know!