PDA

View Full Version : Squeezeplay hardware detection



indifference_engine
2010-05-10, 10:25
Hi,
Is it possible for a lua applet to determine which build of Squeezeplay it is running on please? I want to be able to detect whether the applet is running on the Duet Controller or desktop Squeezeplay and take different actions accordingly. I'm sure this has been asked before but I can't find the answer.

Any help would be much appreciated.

erland
2010-05-10, 11:31
Hi,
Is it possible for a lua applet to determine which build of Squeezeplay it is running on please? I want to be able to detect whether the applet is running on the Duet Controller or desktop Squeezeplay and take different actions accordingly. I'm sure this has been asked before but I can't find the answer.

Any help would be much appreciated.

I believe this will do it:
local model = System:getMachine()

Model will be filled with:
- "fab4" (Squeezebox Touch)
- "baby" (Squeezebox Radio)
- "jive" (Squeezebox Controller)
- "squeezeplay" (Squeezeplay Desktop)

To make this work, you will also need this line somewhere at the top of the file:
local System = require("jive.System")

If you like to know the firmware version, you can put a line like this at the top of the file:
local JIVE_VERSION = jive.JIVE_VERSION

The JIVE_VERSION variable will contain strings like "7.5.1 r8761M"

erland
2010-05-10, 11:31
indifference_engine;545224 Wrote:
> Hi,
> Is it possible for a lua applet to determine which build of Squeezeplay
> it is running on please? I want to be able to detect whether the applet
> is running on the Duet Controller or desktop Squeezeplay and take
> different actions accordingly. I'm sure this has been asked before but
> I can't find the answer.
>
> Any help would be much appreciated.
>
I believe this will do it:
local model = System:getMachine()

Model will be filled with:
- "fab4" (Squeezebox Touch)
- "baby" (Squeezebox Radio)
- "jive" (Squeezebox Controller)
- "squeezeplay" (Squeezeplay Desktop)

To make this work, you will also need this line somewhere at the top of
the file:
local System = require("jive.System")

If you like to know the firmware version, you can put a line like this
at the top of the file:
local JIVE_VERSION = jive.JIVE_VERSION

The JIVE_VERSION variable will contain strings like "7.5.1 r8761M"


--
erland

Erland Isaksson
'My homepage' (http://erland.isaksson.info) (Install my plugins through
Extension Downloader)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan, Custom Skip, Multi Library, Title Switcher and Database
Query plugins'
(http://wiki.erland.isaksson.info/index.php/Category:SlimServer))
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=78543

indifference_engine
2010-05-10, 15:59
Thanks Erland, that looks to be just what I'm looking for. I presume it will only work with v7.4+ as jive.system didn't exist in 7.3 and earlier. Do you happen to know what class exposes getmachine() before 7.4 (I'm guessing Framework)?

indifference_engine
2010-05-10, 15:59
Thanks Erland, that looks to be just what I'm looking for. I presume it
will only work with v7.4+ as jive.system didn't exist in 7.3 and
earlier. Do you happen to know what class exposes getmachine() before
7.4 (I'm guessing Framework)?


--
indifference_engine
------------------------------------------------------------------------
indifference_engine's Profile: http://forums.slimdevices.com/member.php?userid=20698
View this thread: http://forums.slimdevices.com/showthread.php?t=78543

erland
2010-05-10, 18:29
I presume it will only work with v7.4+ as jive.system didn't exist in 7.3 and earlier. Do you happen to know what class exposes getmachine() before 7.4 (I'm guessing Framework)?

Don't know, the Applet Installer in 7.3 seems to hard code "jive" in the source code, in 7.4 and later it uses System.getMachine().

There is a macToModel function in the jive/slim/Player.lua file, maybe that's something you could use if you could get access to the mac address of the local device ?

I'm only guessing now, there might be some better way to do this in 7.3.

erland
2010-05-10, 18:29
indifference_engine;545313 Wrote:
> I presume it will only work with v7.4+ as jive.system didn't exist in
> 7.3 and earlier. Do you happen to know what class exposes getmachine()
> before 7.4 (I'm guessing Framework)?
>
Don't know, the Applet Installer in 7.3 seems to hard code "jive" in
the source code, in 7.4 and later it uses System.getMachine().

There is a macToModel function in the jive/slim/Player.lua file, maybe
that's something you could use if you could get access to the mac
address of the local device ?

I'm only guessing now, there might be some better way to do this in
7.3.


--
erland

Erland Isaksson
'My homepage' (http://erland.isaksson.info) (Install my plugins through
Extension Downloader)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan, Custom Skip, Multi Library, Title Switcher and Database
Query plugins'
(http://wiki.erland.isaksson.info/index.php/Category:SlimServer))
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=78543

indifference_engine
2010-05-11, 01:41
Thanks, using the mac address might prove fruitful. Then again, I am considering dropping support for 7.3 which would make life alot easier.

indifference_engine
2010-05-11, 01:41
Thanks, using the mac address might prove fruitful. Then again, I am
considering dropping support for 7.3 which would make life alot easier.


--
indifference_engine
------------------------------------------------------------------------
indifference_engine's Profile: http://forums.slimdevices.com/member.php?userid=20698
View this thread: http://forums.slimdevices.com/showthread.php?t=78543