MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / getCapability

Function getCapability

src/hdhr.go:39–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37}
38
39func getCapability() (xmlContent []byte, err error) {
40
41 var capability Capability
42 var buffer bytes.Buffer
43
44 capability.Xmlns = "urn:schemas-upnp-org:device-1-0"
45 capability.URLBase = System.ServerProtocol.WEB + "://" + System.Domain
46
47 capability.SpecVersion.Major = 1
48 capability.SpecVersion.Minor = 0
49
50 capability.Device.DeviceType = "urn:schemas-upnp-org:device:MediaServer:1"
51 capability.Device.FriendlyName = System.Name
52 capability.Device.Manufacturer = "Silicondust"
53 capability.Device.ModelName = "HDTC-2US"
54 capability.Device.ModelNumber = "HDTC-2US"
55 capability.Device.SerialNumber = ""
56 capability.Device.UDN = "uuid:" + System.DeviceID
57
58 output, err := xml.MarshalIndent(capability, " ", " ")
59 if err != nil {
60 ShowError(err, 1003)
61 }
62
63 buffer.Write([]byte(xml.Header))
64 buffer.Write([]byte(output))
65 xmlContent = buffer.Bytes()
66
67 return
68}
69
70func getDiscover() (jsonContent []byte, err error) {
71

Callers 1

IndexFunction · 0.85

Calls 1

ShowErrorFunction · 0.85

Tested by

no test coverage detected