|
YAACC - UPNP Client and Server
|
Reads the UPnP device description of a device and finds its YXC service. More...

Static Public Member Functions | |
| static YxcDescriptionInfo | parse (String xml) |
Reads the UPnP device description of a device and finds its YXC service.
Verified on the owner's devices (2026-11-02): the YXC service is listed under <X_device> of the Yamaha namespace as a <X_service> with <X_specType>urn:schemas-yamaha-com:service:X_YamahaExtendedControl:1</X_specType>, <X_yxcControlURL> (a path) and <X_yxcVersion>; <X_URLBase> next to the service list is the host:port of the device. A device may also list an older service of another kind (X_controlURL, no X_yxcControlURL); that one is not a YXC service and is ignored, the YXC one beside it is found.
Parser choice: XmlPullParser. It is the parser the app already uses for UPnP documents on Android (the platform has it), and the unit tests have it on the classpath (kxml2 / xmlpull as test dependencies), whereas the Android stubs of android.util.Xml return null in unit tests. javax.xml.parsers exists on both, but the Android implementation does not support the hardening features (it rejects setFeature calls it does not know), so its XXE safety could not be tested on the JVM and relied upon on the phone.
Safety: a document with a document type declaration is refused before any parsing, so no entity and no external resource can be declared; the pull parser is also told not to process one. The text is capped (MAX_DESCRIPTION_CHARS), as are nesting depth and the length of each value; the control URL must be a plain path. Names are compared by their local part, so the prefix a device chooses does not matter, and a prefix that is not declared is not an error. A malformed document is "not a YXC device", never an exception.
|
static |
| xml | the text of the description |
null when the document is not a description of a device with a YXC service (also: too large, malformed, with a document type declaration)