Autodetect the device type

Post Reply
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Autodetect the device type

Post by Eugene »

In version 1.10.1 - http://www.wildmediaserver.com/forum/vi ... &f=3#p6678, added setting for auto-detect the device type.
autodetect1.JPG
autodetect1.JPG (55.04 KiB) Viewed 17356 times
The device type is determined by the score, which is gaining device configuration, depending on the parameters of the request or response from device.
Maximum score 100, minimum 0.

Script to determine the score.
autodetect2.JPG
autodetect2.JPG (84.98 KiB) Viewed 17356 times
Scripts are three types.
1. Language: No Script; without specifying the score (score 100, if the string is present in RequestClientName)
Example:

Code: Select all

PLAYSTATION
2. Language: No Script; with specifying the score
Example:

Code: Select all

75;INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks
100;WDTV
3. Language: PascalScript | BasicScript | JScript | C++Script

Code: Select all

begin
  if (Pos('LG DLNA DMC', RequestClientName) > 0) or (Pos('LG-HTTPCLIENT', RequestClientName) > 0) then  
    DeviceTypeScore := 100    
  else if (ResponseBody <> '') and (Pos('LG Digital Media Renderer TV', ResponseBody) > 0) then
    DeviceTypeScore := 100    
  else  
    DeviceTypeScore := 0
end.
Variables available in the script

DeviceTypeScore - the score

Request from the device to the server

RequestClientName - field User-Agent from request header or name of device, extracted from request header by the program (value in upper case)
RequestHeader - request header
RequestUserAgent - field User-Agent from request header

Response from the device to the server - UPnP description of device

ResponseBody - description of the device
ResponseHeader - response header
ResponseUserAgent - field User-Agent from response header

Editing scripts
1. Settings - Devices - choose a device - Settings - Type - click "Auto-detect the device type"
autodetect3.JPG
autodetect3.JPG (29.75 KiB) Viewed 17355 times
2. Script editing - Ok
3. click "Save settings for this type"
autodetect4.JPG
autodetect4.JPG (29.82 KiB) Viewed 17355 times
4. Save current settings as default settings for this device type ? - Yes
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: Autodetect the device type

Post by Eugene »

Editing scripts without the list of authorized clients

1. Settings - Devices - "Device type by default" - click "Settings"
autodetect5.JPG
autodetect5.JPG (28.89 KiB) Viewed 17354 times
2. Type - choose a type of device - click "Auto-detect the device type"
autodetect3.JPG
autodetect3.JPG (29.75 KiB) Viewed 17354 times
3. Script editing - Ok
4. click "Save settings for this type"
autodetect4.JPG
autodetect4.JPG (29.82 KiB) Viewed 17354 times
5. Save current settings as default settings for this device type ? - Yes
6. Cancel - Cancel
7. Save changes ? No
Post Reply