Autodetect the device type
Posted: Sun Jul 24, 2011 6:31 am
In version 1.10.1 - http://www.wildmediaserver.com/forum/vi ... &f=3#p6678, added setting for auto-detect the device type.
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. Scripts are three types.
1. Language: No Script; without specifying the score (score 100, if the string is present in RequestClientName)
Example:
2. Language: No Script; with specifying the score
Example:
3. Language: PascalScript | BasicScript | JScript | C++Script
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" 2. Script editing - Ok
3. click "Save settings for this type" 4. Save current settings as default settings for this device type ? - Yes
Maximum score 100, minimum 0.
Script to determine the score. 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
Example:
Code: Select all
75;INTEL_NMPR/2.1 DLNADOC/1.50 dma/3.0 alphanetworks
100;WDTV
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.
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" 2. Script editing - Ok
3. click "Save settings for this type" 4. Save current settings as default settings for this device type ? - Yes