UPnP交互网络包示例

转载文章,原文链接

1 概况

1.1 基础协议

  • SOAP(Simple Object Access Protocol)
  • SSDP(Simple Service Discovery Protocol)
  • GENA(Generic Event Notification Architecture)
  • SCPD/DDD(Service Control Protocol Description)

1.2 UPnP Device Architecture (UDA)

  1. Addressing : IP assignment on any network (AutoIP)
  2. Discovery : Of services/devices (SSDP)
  3. Description : Syntax for devices/services (SCPD/DDD)
  4. Control : Of device services (SOAP)
  5. Eventing : Updates of variables (GENA)
  6. Presentation : Access to device HTML page

1.3 Device Control Protocols (DCPs)

  • APIs for various device functionality
  • Described using SCPD syntax and UDA protocols

1.4 UPnP Architecture Diagram

Standard Services           Device Control Protocols

Common Architecture         3.Control; 4.Eventing; 5.Presentation
                            2.Description
                            1.Discovery
                            0.Addressing

Base                        HTTP, XML, TCP, UDP, IP

2 协议

2.1 术语

  • NT (Notification Type)
  • NTS (Notification Sub Type)
  • USN (Unique Service Name)
  • UDN (Unique Device Name)
  • SID (Subscription IDentifier)

2.2 发现(Discovery)

2.2.1 Advertising

多播内容:

  • 1 time / service type with NT == service type
  • 1 time / device type with NT == device type
  • 1 time / device with NT == device UUID
  • 1 time with NT == upnp:rootdevice

如:

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age = seconds until advertisement expires
LOCATION: URL for UPnP description for root device
NT: search target
NTS: ssdp:alive
USN: advertisement UUID

2.2.2 Searching

多播内容:

  • ST one of:
    • Service type, Device type, Device UUID
    • upnp:rootdevice
    • ssdp:all

如:

M-SEARCH * HTTP/1.1
MX: 3
MAN: "ssdp:discover"
HOST: 239.255.255.250:1900
ST: ssdp:all

2.2.3 Responding

单播内容:

  • 1 time for each NT that matches
  • Simple service name matching

如:

HTTP/1.1 200 OK
Location: http://172.16.5.92:1074/
Cache-Control: max-age=1800
Server: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.11
EXT:
USN: uuid:2b82a0e2-27b0-b245-80bd-8922a9494b47::upnp:rootdevice
ST: upnp:rootdevice
Date: Wed, 17 Feb 2016 09:41:57 GMT

2.3 描述

2.3.1 设备描述


    
        1
        1
    
     
        
        miketest platinum upnp media server
        plutinosoft
        http://www.plutinosoft.com/
        platinum file media server
        platinum file media server
        1.0
        http://www.plutinosoft.com/
        xxx
        uuid:9081d7c5-7b76-a146-613c-b5188bc1bcb4
        universal product product code 
        
        urn:schemas-upnp-org:device:mediaserver:1
        dms-1.50
        
            
                urn:schemas-upnp-org:service:contentdirectory:1
                urn:upnp-org:serviceid:contentdirectory
                /contentdirectory/9081d7c5-7b76-a146-613c-b5188bc1bcb4/scpd.xml
                /contentdirectory/9081d7c5-7b76-a146-613c-b5188bc1bcb4/control.xml
                
                /contentdirectory/9081d7c5-7b76-a146-613c-b5188bc1bcb4/event.xml
                
            
            
                urn:schemas-upnp-org:service:connectionmanager:1
                urn:upnp-org:serviceid:connectionmanager
                /connectionmanager/9081d7c5-7b76-a146-613c-b5188bc1bcb4/scpd.xml
                /connectionmanager/9081d7c5-7b76-a146-613c-b5188bc1bcb4/control.xml
                
                /connectionmanager/9081d7c5-7b76-a146-613c-b5188bc1bcb4/event.xml
                
            
         
        
        
            
                image/png
                72
                72
                32
                /dev/9081d7c5-7b76-a146-613c-b5188bc1bcb4/icon.png
            
        
        url for presentation
    

上面是MediaServer, 所以serviceList中包括ContentDirectory, ConnectionManager两种服务. 如果是MediaRenderer, 则包括: AVTransport, ConnectionManager, RenderingControl几种服务.

2.3.2 服务描述



    
        1
        0
     
    
    
        
            browse
            
                
                    objectid
                    in
                    a_arg_type_objectid
                
                ...
                
                    result
                    out
                    a_arg_type_result
                
                ...
            
        
        
            getsortcapabilities
            
                
                    sortcaps
                    out
                    sortcapabilities
                
            
        
        ...
     
    
    
        
            a_arg_type_browseflag
            string
            
                browsemetadata
                browsedirectchildren
            
        
        
            systemupdateid
            ui4
        
        ...
    

2.4 控制

2.4.1 通用协议格式

命令:

POST path of control URL HTTP/1.1
HOST: host of control URL:port of control URL
CONTENT-LENGTH: bytes in body
CONTENT-TYPE: text/xml; charset="utf-8"
SOAPACTION: "urn:schemas-upnp-org:service:serviceType:v#actionName"


    
        
            in arg value
            other in args and their values go here, if any
        
    

响应:

HTTP/1.1 200 OK
CONTENT-LENGTH: bytes in body
CONTENT-TYPE: text/xml; charset="utf-8"
DATE: when response was generated
EXT:
SERVER: OS/version UPnP/1.0 product/version


    
        
            out arg value
            other out args and their values go here, if any
        
    

2.4.2 Browse

2.4.2.1 浏览目录

Action:

POST /ContentDirectory/f1062579-d833-971e-8db8-76b28da5dc2d/control.xml HTTP/1.1
SOAPAction: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
User-Agent: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.5.13
Host: 172.16.5.92:1873
Content-Length: 571
Content-Type: text/xml; charset="utf-8"


    
        
            0
            BrowseDirectChildren
            dc:date,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,\
                upnp:album,upnp:artist,upnp:author,searchable,childCount
            
            0
            30
            
        
    

Response:

HTTP/1.1 200 OK
Ext:
Date: Thu, 01 Jan 1970 16:56:28 GMT
Content-Length: 1083
Content-Type: text/xml; charset="utf-8"
Server: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.11


    
        
            
                
                    
                        usb
                        Unknown
                        object.container.storageFolder
                    
                    
                        LiveProgram
                        Unknown
                        object.container.storageFolder
                    
                
            
            2
            2
            1
        
    

2.4.2.2 浏览文件

Action:

POST /ContentDirectory/260ae85c-6cc5-4734-86ff-9f5753971493/control.xml HTTP/1.1
SOAPAction: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
User-Agent: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.5.13
Host: 172.16.5.92:1135
Content-Length: 585
Content-Type: text/xml; charset="utf-8"


    
        
            0/usb/media/mp4
            BrowseDirectChildren
            dc:date,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,\
                upnp:album,upnp:artist,upnp:author,searchable,childCount
            
            0
            30
            
        
    

Response:

HTTP/1.1 200 OK
Ext:
Date: Thu, 01 Jan 1970 19:39:07 GMT
Content-Length: 1567
Content-Type: text/xml; charset="utf-8"
Server: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.11


    
        
            
                
                    
                        alan
                        Unknown
                        
                            http://172.16.5.92:1135/usb/%25/media/mp4/alan.mp4
                        
                        object.item.videoItem
                    
                    
                        avenger
                        Unknown
                        
                            http://172.16.5.92:1135/usb/%25/media/mp4/avenger.mp4
                        
                        object.item.videoItem
                    
                
            
            2
            2
            1
        
    

2.4.3 SetAVTransportURI

Action:

POST /AVTransport/a9e91358-f1d3-8081-6700-657b903a4cdf/control.xml HTTP/1.1
SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"
User-Agent: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.5.13
Host: 172.16.5.92:1146
Content-Length: 1318
Content-Type: text/xml; charset="utf-8"


    
        
            0
            
                http://172.16.5.90:1191/%25/F378CB0AC0D9CF6C47F2E8675FF24DEF/buildings_alan.mp4
            
            
                
                    
                        buildings_alan
                        Unknown
                        2015-05-20T00:00:00Z
                        Unknown
                        
                            http://172.16.5.90:1191/%25/F378CB0AC0D9CF6C47F2E8675FF24DEF/buildings_alan.mp4
                        
                        object.item.videoItem
                    
                
            
        
    

Response:

HTTP/1.1 200 OK
Ext:
Date: Thu, 01 Jan 1970 21:03:21 GMT
Content-Length: 277
Content-Type: text/xml; charset="utf-8"
Server: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.11


    
        
    

2.4.4 Play

如下: i3/i21: ... 等行表示包发送的方向. 本例中172.16.5.90为CP, 172.16.5.92为Renderer,.

  • CP(.90)向Renderer(.92)发送Play命令:

    i3 : 172.16.5.90:52172 > 172.16.5.92:1146, len:594

POST /AVTransport/a9e91358-f1d3-8081-6700-657b903a4cdf/control.xml HTTP/1.1
SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#Play"
User-Agent: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.5.13
Host: 172.16.5.92:1146
Content-Length: 306
Content-Type: text/xml; charset="utf-8"


    
        
            0
            1
        
    

  • Renderer(.92)告知TRANSITIONING:

    i21 : 172.16.5.92:40036 > 172.16.5.90:1334, len:603

NOTIFY /a9e91358-f1d3-8081-6700-657b903a4cdf/urn:upnp-org:serviceId:AVTransport HTTP/1.1
NT: upnp:event
NTS: upnp:propchange
SID: uuid:db690087-714d-0ba5-fec8-7d19a4dbf60d
SEQ: 2
User-Agent: Neptune/1.1.3
Host: 172.16.5.90:1334
Content-Length: 324
Content-Type: text/xml; charset="utf-8"


    
        
            
                
                    
                
            
        
    

i23   : 172.16.5.90:1334 > 172.16.5.92:40036, len:111
HTTP/1.1 200 OK
Date: Fri, 08 Apr 2016 03:55:19 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Kodi
  • Renderer(.92)获取流内容:

    i487 : 172.16.5.92:43241 > 172.16.5.90:1191, len:191

GET /%25/F378CB0AC0D9CF6C47F2E8675FF24DEF/buildings_alan.mp4 HTTP/1.1
User-Agent: Lavf/57.25.100
Accept: */*
Range: bytes=0-
Connection: close
Host: 172.16.5.90:1191
Icy-MetaData: 1


GET /%25/F378CB0AC0D9CF6C47F2E8675FF24DEF/buildings_alan.mp4 HTTP/1.1
...
  • Renderer(.92)回复Play命令OK:

    i1550 : 172.16.5.92:1146 > 172.16.5.90:52172, len:442

HTTP/1.1 200 OK
Ext:
Date: Thu, 01 Jan 1970 21:03:38 GMT
Content-Length: 264
Content-Type: text/xml; charset="utf-8"
Server: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.11


    
        
    

  • Renderer(.92)告知PLAYING:

    i1892 : 172.16.5.92:40036 > 172.16.5.90:1334, len:597

NOTIFY /a9e91358-f1d3-8081-6700-657b903a4cdf/urn:upnp-org:serviceId:AVTransport HTTP/1.1
NT: upnp:event
NTS: upnp:propchange
SID: uuid:db690087-714d-0ba5-fec8-7d19a4dbf60d
SEQ: 3
User-Agent: Neptune/1.1.3
Host: 172.16.5.90:1334
Content-Length: 318
Content-Type: text/xml; charset="utf-8"


    
        
            
                
                    
                
            
        
    

i1896 : 172.16.5.90:1334 > 172.16.5.92:40036, len:111
HTTP/1.1 200 OK
Date: Fri, 08 Apr 2016 03:55:20 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Kodi
  • Renderer(.92)告知播放信息(时间等):

    i6976 : 172.16.5.92:40036 > 172.16.5.90:1334, len:693

NOTIFY /a9e91358-f1d3-8081-6700-657b903a4cdf/urn:upnp-org:serviceId:AVTransport HTTP/1.1
NT: upnp:event
NTS: upnp:propchange
SID: uuid:db690087-714d-0ba5-fec8-7d19a4dbf60d
SEQ: 4
User-Agent: Neptune/1.1.3
Host: 172.16.5.90:1334
Content-Length: 429
Content-Type: text/xml; charset="utf-8"


    
        
            
                
                    
                        
                            
                                
                            
                        
                    
                
            
        
    

i6980 : 172.16.5.90:1334 > 172.16.5.92:40036, len:111
HTTP/1.1 200 OK
Date: Fri, 08 Apr 2016 03:55:21 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Kodi
...

2.5 事件

2.5.1 通用协议格式

订阅(Subscribing):

SUBSCRIBE publisher path HTTP/1.1
HOST: publisher host:publisher port
CALLBACK: 
NT: upnp:event
TIMEOUT: Second-requested subscription duration

响应Response:

HTTP/1.1 200 OK
DATE: when response was generated
SERVER: OS/version UPnP/1.0 product/version
SID: uuid:subscription-UUID
TIMEOUT: Second-actual subscription duration
  • SID: Required. Subscription identifier. Must be the subscription identifier assigned by publisher in response to subscription request. Must be universally unique. Must begin with uuid:. Defined by UPnP vendor. Single URI.

事件通知(Eventing):

NOTIFY delivery path HTTP/1.1
HOST: delivery host:delivery port
CONTENT-TYPE: text/xml
CONTENT-LENGTH: Bytes in body
NT: upnp:event
NTS: upnp:propchange
SID: uuid:subscription-UUID
SEQ: event key


    
        new value
    
    Other variable names and values (if any) go here.

  • NT: Required. Notification Type. Must be upnp:event.
  • NTS: Required. Notification Sub Type. Must be upnp:propchange.
  • SEQ: Required. Event key. Must be 0 for initial event message. Must be incremented by 1 for each event message sent to a particular subscriber. To prevent overflow, must be wrapped from 4294967295to 1. 32-bit unsigned value represented as a single decimal integer without leading zeroes (some implementations may include leading zeroes, which should be ignored by the recipient).

取消订阅:

UNSUBSCRIBE publisher path HTTP/1.1
HOST: publisher host:publisher port
SID: uuid:subscription UUID

2.5.2 订阅(Subscribing)/事件通知(Eventing)示例

2.5.2.1 AVTransport

Subscribing:

SUBSCRIBE /AVTransport/a44792d5-e283-2b1c-d4b7-0a1d06f5df27/event.xml HTTP/1.1
NT: upnp:event
CALLBACK: 
TIMEOUT: Second-1800
User-Agent: UPnP/1.0 DLNADOC/1.50 Kodi
Host: 172.16.5.92:1153

Response:

HTTP/1.1 200 OK
SID: uuid:fb5c0474-782f-b216-3cdd-c161d69d8dc6
TIMEOUT: Second-1800
Date: Wed, 13 Apr 2016 06:09:58 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.11

Eventing(起始播放时):

NOTIFY /a44792d5-e283-2b1c-d4b7-0a1d06f5df27/urn:upnp-org:serviceId:AVTransport HTTP/1.1
NT: upnp:event
NTS: upnp:propchange
SID: uuid:fb5c0474-782f-b216-3cdd-c161d69d8dc6
SEQ: 0
User-Agent: Neptune/1.1.3
Host: 172.16.5.90:1306
Content-Length: 3500
Content-Type: text/xml; charset="utf-8"


    
        
            
                
                    
                        
                            
                                
                                    
                                        
                                            
                                                
                                                    
                                                        
                                                            
                                                                
                                                                    
                                                                        
                                                                            
                                                                                
                                                                                    
                                                                                        
                                                                                            
                                                                                                
                                                                                                    
                                                                                                        
                                                                                                    
                                                                                                
                                                                                            
                                                                                        
                                                                                    
                                                                                
                                                                            
                                                                        
                                                                    
                                                                
                                                            
                                                        
                                                    
                                                
                                            
                                        
                                    
                                
                            
                        
                    
                
            
        
    

Response:

HTTP/1.1 200 OK
Date: Wed, 13 Apr 2016 06:09:43 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Kodi

Eventing(TRANSITIONING):

NOTIFY /a44792d5-e283-2b1c-d4b7-0a1d06f5df27/urn:upnp-org:serviceId:AVTransport HTTP/1.1
NT: upnp:event
NTS: upnp:propchange
SID: uuid:fb5c0474-782f-b216-3cdd-c161d69d8dc6
SEQ: 1
User-Agent: Neptune/1.1.3
Host: 172.16.5.90:1306
Content-Length: 2534
Content-Type: text/xml; charset="utf-8"


    
        
            
                
                    
                        
                            
                        
                    
                
            
        
    

Response:

HTTP/1.1 200 OK
Date: Wed, 13 Apr 2016 06:09:59 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Kodi

Eventing(PLAYING):

NOTIFY /a44792d5-e283-2b1c-d4b7-0a1d06f5df27/urn:upnp-org:serviceId:AVTransport HTTP/1.1
NT: upnp:event
NTS: upnp:propchange
SID: uuid:fb5c0474-782f-b216-3cdd-c161d69d8dc6
SEQ: 2
User-Agent: Neptune/1.1.3
Host: 172.16.5.90:1306
Content-Length: 318
Content-Type: text/xml; charset="utf-8"


    
        
            
                
                    
                
            
        
    

Response:

HTTP/1.1 200 OK
Date: Wed, 13 Apr 2016 06:10:00 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Kodi

Eventing(STOPPED):

NOTIFY /a44792d5-e283-2b1c-d4b7-0a1d06f5df27/urn:upnp-org:serviceId:AVTransport HTTP/1.1
NT: upnp:event
NTS: upnp:propchange
SID: uuid:fb5c0474-782f-b216-3cdd-c161d69d8dc6
SEQ: 4
User-Agent: Neptune/1.1.3
Host: 172.16.5.90:1306
Content-Length: 466
Content-Type: text/xml; charset="utf-8"


    
        
            
                
                    
                        
                            
                                
                                    
                                
                            
                        
                    
                
            
        
    

Response:

2.5.2.2 ConnectionManager

Subscribing:

SUBSCRIBE /ConnectionManager/a44792d5-e283-2b1c-d4b7-0a1d06f5df27/event.xml HTTP/1.1
NT: upnp:event
CALLBACK: 
TIMEOUT: Second-1800
User-Agent: UPnP/1.0 DLNADOC/1.50 Kodi
Host: 172.16.5.92:1153

Response:

HTTP/1.1 200 OK
SID: uuid:0c8245e4-a6b8-5a5d-d7f3-e2004bca123f
TIMEOUT: Second-1800
Date: Wed, 13 Apr 2016 06:09:58 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.11

Eventing:

NOTIFY /a44792d5-e283-2b1c-d4b7-0a1d06f5df27/urn:upnp-org:serviceId:ConnectionManager HTTP/1.1
NT: upnp:event
NTS: upnp:propchange
SID: uuid:0c8245e4-a6b8-5a5d-d7f3-e2004bca123f
SEQ: 0
User-Agent: Neptune/1.1.3
Host: 172.16.5.90:1306
Content-Length: 2929
Content-Type: text/xml; charset="utf-8"


    
        
        
    
    
        http-get:*:video/mp4:DLNA.ORG_PN=MPEG4_P2_SP_AAC,
                http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_BL_L3L_SD_AAC,
                http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_ASP_L4_SO_G726,
                http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO,
                http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN,
                http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL,
                http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA,
                http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM,
                http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM,
                http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE,
                http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_MP3,
                http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE,
                http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL,
                http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL,
                http-get:*:image/png:DLNA.ORG_PN=PNG_LRG,
                http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL_XAC3,
                http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_HD_1080i_AAC,
                http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED,
                http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_SP_G726,
                http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM,
                http-get:*:audio/mpeg:DLNA.ORG_PN=MP3,
                http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO,
                http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_HP_HD_AAC,
                http-get:*:audio/mpeg:DLNA.ORG_PN=MP3X,
                http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_ASP_L5_SO_G726,
                http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPLL_BASE,
                http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC,
                http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1,
                http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_BASE,
                http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL,
                http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAPRO,
                http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG,
                http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC_XAC3,
                http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM,
                http-get:*:image/x-ycbcr-yuv420:*,
                http-get:*:video/x-ms-wmv:*,
                http-get:*:audio/x-ms-wma:*,
                http-get:*:video/mp4:*,
                http-get:*:video/avi:*,
                http-get:*:video/quicktime:*,
                http-get:*:video/wtv:*,
                rtsp-rtp-udp:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_SP_G726,
                rtsp-rtp-udp:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO,
                rtsp-rtp-udp:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_ASP_L5_SO_G726,
                rtsp-rtp-udp:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_ASP_L4_SO_G726,
                rtsp-rtp-udp:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPLL_BASE,
                rtsp-rtp-udp:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_BASE,
                rtsp-rtp-udp:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO,
                rtsp-rtp-udp:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL,
                rtsp-rtp-udp:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA,
                rtsp-rtp-udp:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE,
                rtsp-rtp-udp:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL,
                rtsp-rtp-udp:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_MP3,
                rtsp-rtp-udp:*:video/x-ms-wmv:*
    
    
        0
    

i112  : 172.16.5.92:1153 > 172.16.5.90:51264, len:194
HTTP/1.1 200 OK
SID: uuid:57b029f1-db42-1aa4-d9a4-d8275d513f18
TIMEOUT: Second-1800
Date: Wed, 13 Apr 2016 06:09:58 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.11

Response:

HTTP/1.1 200 OK
Date: Wed, 13 Apr 2016 06:09:43 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Kodi

2.5.2.3 RenderingControl

Subscribing:

SUBSCRIBE /RenderingControl/a44792d5-e283-2b1c-d4b7-0a1d06f5df27/event.xml HTTP/1.1
NT: upnp:event
CALLBACK: 
TIMEOUT: Second-1800
User-Agent: UPnP/1.0 DLNADOC/1.50 Kodi
Host: 172.16.5.92:1153

Response:

HTTP/1.1 200 OK
SID: uuid:57b029f1-db42-1aa4-d9a4-d8275d513f18
TIMEOUT: Second-1800
Date: Wed, 13 Apr 2016 06:09:58 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.11

Eventing:

NOTIFY /a44792d5-e283-2b1c-d4b7-0a1d06f5df27/urn:upnp-org:serviceId:RenderingControl HTTP/1.1
NT: upnp:event
NTS: upnp:propchange
SID: uuid:57b029f1-db42-1aa4-d9a4-d8275d513f18
SEQ: 0
User-Agent: Neptune/1.1.3
Host: 172.16.5.90:1306
Content-Length: 448
Content-Type: text/xml; charset="utf-8"


    
        
            
                
                    
                        
                            
                                
                            
                        
                    
                
            
        
    

Response:

HTTP/1.1 200 OK
Date: Wed, 13 Apr 2016 06:09:43 GMT
Content-Length: 0
Server: UPnP/1.0 DLNADOC/1.50 Kodi

你可能感兴趣的:(UPnP交互网络包示例)