mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-17 21:16:57 +08:00
103 lines
4.7 KiB
HTML
103 lines
4.7 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>Create a new root device</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.gupnp-root-device-new" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">gupnp_root_device_new</h1>
|
|
<p class="verinfo">(PECL gupnp >= 0.1.0)</p><p class="refpurpose"><span class="refname">gupnp_root_device_new</span> — <span class="dc-title">Create a new root device</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.gupnp-root-device-new-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>gupnp_root_device_new</strong></span>
|
|
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$context</code></span>
|
|
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$location</code></span>
|
|
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$description_dir</code></span>
|
|
) : <span class="type">resource</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
Create a new root device, automatically downloading and parsing location.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.gupnp-root-device-new-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">context</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
A context identifier, returned by <span class="function"><a href="gupnp_context_new.html" class="function">gupnp_context_new()</a></span>.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">location</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Location of the description file for this device, relative to the HTTP root
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.gupnp-root-device-new-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
A root device identifier.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.gupnp-root-device-new-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-5376">
|
|
<p><strong>Example #1 Create new UPnP context and get device info service</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /><br /></span><span style="color: #FF8000">/* Create the UPnP context */<br /></span><span style="color: #0000BB">$context </span><span style="color: #007700">= </span><span style="color: #0000BB">gupnp_context_new</span><span style="color: #007700">();<br /><br />if (!</span><span style="color: #0000BB">$context</span><span style="color: #007700">) {<br /> die(</span><span style="color: #DD0000">"Error creating the GUPnP context\n"</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #FF8000">/* Create root device */<br /></span><span style="color: #0000BB">$location </span><span style="color: #007700">= </span><span style="color: #DD0000">"/BinaryLight1.xml"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$dev </span><span style="color: #007700">= </span><span style="color: #0000BB">gupnp_root_device_new</span><span style="color: #007700">(</span><span style="color: #0000BB">$context</span><span style="color: #007700">, </span><span style="color: #0000BB">$location</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.gupnp-root-device-new-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="gupnp_root_device_set_available.html" class="function" rel="rdfs-seeAlso">gupnp_root_device_set_available()</a> - Set whether or not root_device is available</span></li>
|
|
<li class="member"><span class="function"><a href="gupnp_root_device_start.html" class="function" rel="rdfs-seeAlso">gupnp_root_device_start()</a> - Start main loop</span></li>
|
|
<li class="member"><span class="function"><a href="gupnp_root_device_stop.html" class="function" rel="rdfs-seeAlso">gupnp_root_device_stop()</a> - Stop main loop</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |