Arduino DLNA Server
Loading...
Searching...
No Matches
mr_control.h
Go to the documentation of this file.
1#pragma once
119#include "dlna/xml/XMLPrinter.h"
120
122static void mr_control_xml_printer(Print& out) {
124 XMLPrinter xml(out);
125 xml.printXMLHeader();
126 xml.printNodeBeginNl("scpd", "xmlns=\"urn:schemas-upnp-org:service-1-0\"");
127
128 xml.printNodeBeginNl("specVersion");
129 xml.printNode("major", 1);
130 xml.printNode("minor", 0);
131 xml.printNodeEnd("specVersion");
132
133 xml.printNodeBeginNl("actionList");
134
135 // use xml.printArgument(name, direction, relatedStateVariable)
136
137 xml.printNodeBeginNl("action");
138 xml.printNode("name", "GetVolume");
139 xml.printNodeBeginNl("argumentList");
140 xml.printArgument("InstanceID", "in", "A_ARG_TYPE_InstanceID");
141 xml.printArgument("Channel", "in", "A_ARG_TYPE_Channel");
142 xml.printArgument("CurrentVolume", "out", "Volume");
143 xml.printNodeEnd("argumentList");
144 xml.printNodeEnd("action");
145
146 xml.printNodeBeginNl("action");
147 xml.printNode("name", "SetVolume");
148 xml.printNodeBeginNl("argumentList");
149 xml.printArgument("InstanceID", "in", "A_ARG_TYPE_InstanceID");
150 xml.printArgument("Channel", "in", "A_ARG_TYPE_Channel");
151 xml.printArgument("DesiredVolume", "in", "Volume");
152 xml.printNodeEnd("argumentList");
153 xml.printNodeEnd("action");
154
155 xml.printNodeBeginNl("action");
156 xml.printNode("name", "GetMute");
157 xml.printNodeBeginNl("argumentList");
158 xml.printArgument("InstanceID", "in", "A_ARG_TYPE_InstanceID");
159 xml.printArgument("Channel", "in", "A_ARG_TYPE_Channel");
160 xml.printArgument("CurrentMute", "out", "Mute");
161 xml.printNodeEnd("argumentList");
162 xml.printNodeEnd("action");
163
164 xml.printNodeBeginNl("action");
165 xml.printNode("name", "SetMute");
166 xml.printNodeBeginNl("argumentList");
167 xml.printArgument("InstanceID", "in", "A_ARG_TYPE_InstanceID");
168 xml.printArgument("Channel", "in", "A_ARG_TYPE_Channel");
169 xml.printArgument("DesiredMute", "in", "Mute");
170 xml.printNodeEnd("argumentList");
171 xml.printNodeEnd("action");
172
173 xml.printNodeEnd("actionList");
174
175 xml.printNodeBeginNl("serviceStateTable");
176
177 xml.printNodeBeginNl("stateVariable", "sendEvents=\"no\"");
178 xml.printNode("name", "Volume");
179 xml.printNode("dataType", "ui2");
180 xml.printNodeBeginNl("allowedValueRange");
181 xml.printNode("minimum", 0);
182 xml.printNode("maximum", 100);
183 xml.printNode("step", 1);
184 xml.printNodeEnd("allowedValueRange");
185 xml.printNodeEnd("stateVariable");
186
187 xml.printNodeBeginNl("stateVariable", "sendEvents=\"no\"");
188 xml.printNode("name", "Mute");
189 xml.printNode("dataType", "boolean");
190 xml.printNodeEnd("stateVariable");
191
192 xml.printNodeBeginNl("stateVariable", "sendEvents=\"no\"");
193 xml.printNode("name", "A_ARG_TYPE_InstanceID");
194 xml.printNode("dataType", "ui4");
195 xml.printNodeEnd("stateVariable");
196
197 xml.printNodeBeginNl("stateVariable", "sendEvents=\"no\"");
198 xml.printNode("name", "A_ARG_TYPE_Channel");
199 xml.printNode("dataType", "string");
200 xml.printNodeBeginNl("allowedValueList");
201 xml.printNode("allowedValue", "Master");
202 xml.printNodeEnd("allowedValueList");
203 xml.printNodeEnd("stateVariable");
204
205 xml.printNodeEnd("serviceStateTable");
206
207 xml.printNodeEnd("scpd");
208}
Functions to efficiently output XML. XML data contains a lot of redundancy so it is more memory effic...
Definition: XMLPrinter.h:54