我的三星电视不会响应一些描述其服务的 UPNP XML 请求

My Samsung TV won't respond to some UPNP XML requests to describe its service

我一直在阅读这个 UPNP PDF,它说当一个设备进入网络时,它会发送一个带有它的 LOCATION 的 SSDP 消息,这是一个描述它的服务的地址。当我打开 Samsung Smart TV 时,我收到大约 6 或 7 条 SSDP 消息。其中之一如下:

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=1800
LOCATION: http://192.168.1.107:7676/smp_7_
NT: upnp:rootdevice
NTS: ssdp:alive
SERVER: SHP, UPnP/1.0, Samsung UPnP SDK/1.0
USN: uuid:uuid_here::upnp:rootdevice

因此,当我尝试连接到此 SSDP 消息中的 LOCATION 时,我得到以下信息:

<?xml version="1.0"?>
<root xmlns='urn:schemas-upnp-org:device-1-0' xmlns:sec='http://www.sec.co.kr/dlna' xmlns:dlna='urn:schemas-dlna-org:device-1-0'>
 <specVersion>
  <major>1</major>
  <minor>0</minor>
 </specVersion>
 <device>
  <deviceType>urn:dial-multiscreen-org:device:dialreceiver:1</deviceType>
  <friendlyName>[TV]Samsung LED40</friendlyName>
  <manufacturer>Samsung Electronics</manufacturer>
  <manufacturerURL>http://www.samsung.com/sec</manufacturerURL>
  <modelDescription>Samsung TV NS</modelDescription>
  <modelName>UN40HU7000</modelName>
  <modelNumber>1.0</modelNumber>
  <modelURL>http://www.samsung.com/sec</modelURL>
  <serialNumber>serialNumberHere</serialNumber>
  <UDN>uuid:uuid_here</UDN>
  <sec:deviceID>EXCNHA5ILPT66</sec:deviceID>
  <sec:ProductCap>Resolution:1920X1080,Y2014</sec:ProductCap>
  <serviceList>
   <service>
    <serviceType>urn:dial-multiscreen-org:service:dial:1</serviceType>
    <serviceId>urn:dial-multiscreen-org:serviceId:dial</serviceId>
    <controlURL>/smp_9_</controlURL>
    <eventSubURL>/smp_10_</eventSubURL>
    <SCPDURL>/smp_8_</SCPDURL>
   </service>
  </serviceList>
  <sec:Capabilities>
   <sec:Capability name='samsung:multiscreen:1' port='8001' location='/ms/1.0/'></sec:Capability>
  </sec:Capabilities>
 </device>
</root>

UPNP PDF 说我必须连接到上述服务中的 controlURL,但是当我 GET http://192.168.1.107/smp_9_ I get no response. It simply does not respond. I though it was something related to the service being not activated at the moment, but for example, this post 教导如何向 RenderingControl1 服务发送 SOAP 消息以更改音量。当我用电视看东西时,这项服务应该是活跃的。所以我尝试响应与RenderingControl1相关的SSDP消息:

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=1800
LOCATION: http://192.168.1.107:7676/smp_3_
NT: urn:samsung.com:device:RemoteControlReceiver:1
NTS: ssdp:alive
SERVER: SHP, UPnP/1.0, Samsung UPnP SDK/1.0
USN: uuid:uuid_here::urn:samsung.com:device:RemoteControlReceiver:1

当我 GET 192.168.1.107:7676/smp_3_ 时,响应是:

<?xml version="1.0"?>
<root xmlns='urn:schemas-upnp-org:device-1-0' xmlns:sec='http://www.sec.co.kr/dlna' xmlns:dlna='urn:schemas-dlna-org:device-1-0'>
 <specVersion>
  <major>1</major>
  <minor>0</minor>
 </specVersion>
 <device>
  <deviceType>urn:samsung.com:device:RemoteControlReceiver:1</deviceType>
  <friendlyName>[TV]Samsung LED40</friendlyName>
  <manufacturer>Samsung Electronics</manufacturer>
  <manufacturerURL>http://www.samsung.com/sec</manufacturerURL>
  <modelDescription>Samsung TV RCR</modelDescription>
  <modelName>UN40HU7000</modelName>
  <modelNumber>1.0</modelNumber>
  <modelURL>http://www.samsung.com/sec</modelURL>
  <serialNumber>serialNumberHere</serialNumber>
  <UDN>uuid:uuid_here</UDN>
  <sec:deviceID>EXCNHA5ILPT66</sec:deviceID>
  <sec:ProductCap>Resolution:1920X1080,ImageZoom,ImageRotate,Y2014,ENC</sec:ProductCap>
  <serviceList>
   <service>
    <serviceType>urn:samsung.com:service:MultiScreenService:1</serviceType>
    <serviceId>urn:samsung.com:serviceId:MultiScreenService</serviceId>
    <controlURL>/smp_5_</controlURL>
    <eventSubURL>/smp_6_</eventSubURL>
    <SCPDURL>/smp_4_</SCPDURL>
   </service>
  </serviceList>
  <sec:Capabilities>
   <sec:Capability name='samsung:multiscreen:1' port='8001' location='/ms/1.0/'></sec:Capability>
  </sec:Capabilities>
 </device>
</root>

但是当我尝试 GET 192.168.1.107:7676/smp_5_ 时,我也没有得到任何回应。我也尝试 GET 192.168.1.107:7676/smp_3_/smp_5_ 因为 /smp_5_ 是 /smp_3_ 的 'subset' 我收到错误请求,它告诉我我的电视忽略了 /smp_5_ 但明确告诉 /smp_3_/smp_5_ 是错误的,所以 /smp_3_ 非常正确,但我不知道发生了什么。根据 UPNP PDF, GET 192.168.1.107:7676/smp_5_ 应该检索服务的描述...如何获取 RenderingControl 的描述?

根据 UPnP 规范,

来自 SSDP

http://192.168.1.107:7676/smp_7_ 称为 DeviceDescription URL,因此您可以通过 HTTP GET

获取 XML

而 URL 在

<controlURL>/smp_9_</controlURL>
<eventSubURL>/smp_10_</eventSubURL>
<SCPDURL>/smp_8_</SCPDURL>

http://192.168.1.107:7676/smp_9_ 是控件 URL,您需要使用 HTTP Post 和必要的参数执行 SOAP 操作。

http://192.168.1.107:7676/smp_10_ 是事件订阅 URL,但您需要使用必要的参数而不是 GET.

来执行 SUBSCRIBE

http://192.168.1.107:7676/smp_8_ServiceDescription URL,你可以做 GET 并得到 XML 文件。

更多内容:http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf

试一试。也许它会被证明是有用的。它是 Smart View windows 应用程序

的反编译源

https://drive.google.com/open?id=0B4rFn8xXaiKsZ3lCNFBpcklDRE0