2025-06-08 13:25:01 +02:00
|
|
|
package upnp
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
)
|
|
|
|
|
|
2025-06-08 17:41:52 +02:00
|
|
|
func generateDeviceDescription(usn, ip string, port uint) string {
|
2025-06-08 13:25:01 +02:00
|
|
|
return fmt.Sprintf(`<?xml version="1.0"?>
|
|
|
|
|
<root xmlns="urn:schemas-upnp-org:device-1-0">
|
|
|
|
|
<specVersion>
|
|
|
|
|
<major>1</major>
|
|
|
|
|
<minor>0</minor>
|
|
|
|
|
</specVersion>
|
2025-06-08 17:41:52 +02:00
|
|
|
<URLBase>http://%s:%d/</URLBase>
|
2025-06-08 13:25:01 +02:00
|
|
|
<device>
|
|
|
|
|
<deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
|
|
|
|
|
<friendlyName>pmomusic Fake Renderer</friendlyName>
|
|
|
|
|
<manufacturer>GoDLNA</manufacturer>
|
|
|
|
|
<manufacturerURL>http://example.com</manufacturerURL>
|
|
|
|
|
<modelDescription>Fake DLNA Renderer</modelDescription>
|
|
|
|
|
<modelName>pmomusic</modelName>
|
|
|
|
|
<modelNumber>1.0</modelNumber>
|
|
|
|
|
<modelURL>http://example.com/model</modelURL>
|
|
|
|
|
<UDN>%s</UDN>
|
2025-06-08 17:41:52 +02:00
|
|
|
<presentationURL>http://%s:%d</presentationURL>
|
2025-06-08 13:25:01 +02:00
|
|
|
<serviceList>
|
|
|
|
|
<service>
|
|
|
|
|
<serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
|
|
|
|
|
<serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
|
|
|
|
|
<controlURL>/upnp/control/AVTransport</controlURL>
|
|
|
|
|
<eventSubURL>/upnp/event/AVTransport</eventSubURL>
|
|
|
|
|
<SCPDURL>/scpd/AVTransport.xml</SCPDURL>
|
|
|
|
|
</service>
|
|
|
|
|
<service>
|
|
|
|
|
<serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
|
|
|
|
|
<serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
|
|
|
|
|
<controlURL>/upnp/control/RenderingControl</controlURL>
|
|
|
|
|
<eventSubURL>/upnp/event/RenderingControl</eventSubURL>
|
|
|
|
|
<SCPDURL>/scpd/RenderingControl.xml</SCPDURL>
|
|
|
|
|
</service>
|
|
|
|
|
<service>
|
|
|
|
|
<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
|
|
|
|
|
<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
|
|
|
|
|
<controlURL>/upnp/control/ConnectionManager</controlURL>
|
|
|
|
|
<eventSubURL>/upnp/event/ConnectionManager</eventSubURL>
|
|
|
|
|
<SCPDURL>/scpd/ConnectionManager.xml</SCPDURL>
|
|
|
|
|
</service>
|
|
|
|
|
</serviceList>
|
|
|
|
|
</device>
|
2025-06-08 17:41:52 +02:00
|
|
|
</root>`, ip, port, usn, ip, port)
|
2025-06-08 13:25:01 +02:00
|
|
|
}
|