1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" /> 7<title>GetTemporaryId</title> 8 </head> 9 <body> 10<h1><CODE><a href="../../../../nn/Overview.html">nn</a>::<a href="../../../../nn/uds/Overview.html">uds</a>::<a href="../../../../nn/uds/CTR/Overview.html">CTR</a>::<a href="../../../../nn/uds/CTR/NetworkDescription/Overview.html">NetworkDescription</a>::GetTemporaryId</CODE> Member Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14<a href="../../../../nn_types/u32.html">u32</a> GetTemporaryId() const; 15</pre> 16 </div> 17<h2>Arguments</h2> 18 <div class="section"> 19<p>None.</p> 20 </div> 21<h2>Return Values</h2> 22<div class="section">Returns the <CODE>TemporaryId</CODE>. </div> 23<h2>Description</h2> 24 <div class="section"> 25<p>Gets the temporary ID. This ID can be used to identify the network, but instead we recommend that you use the BSSID or the master's <a href="../../../../nn/uds/CTR/NodeInformation/Overview.html"><CODE>NodeInformation</CODE></a>.</p><p>When a device builds a network and operates as the master, usually a random number is generated and used as the <CODE>TemporaryID</CODE> for that network so the network can be distinguished from a network built by the same device and on which local communications have taken place, but on which communications have been broken and resumed.<br /><br /> However, if a <CODE>TemporaryID</CODE> is generated every single time a network is built, consider what happens when you implement an algorithm like the one shown below in order to build networks without the end user being aware of whether they are master or client:<br /><br /> 1: Become a master (build a network).<br /> 2: If cannot find peer to connect with after set period of time, destroy the network.<br /> 3: Search for nearby networks, and if a network for the same application exists, connect to that network as a client. <br />4. If cannot find peer to connect with, repeat these steps.<br /><br /> With this kind of algorithm, devices try to connect based on their search results, but because a <CODE>TemporaryID</CODE> is generated every single time a network is built, there are frequent times when peers cannot connect because the master device has rebuilt its network. The upshot is that the implementer is not able to realize the expected behavior.<br /><br />UDS communication provides for the following exception:<br /><br /> Do not update the <CODE>TemporaryID</CODE> when rebuilding the network if no clients are connected and communication between devices has not been established.<br />(However, if it takes more than 60 seconds to rebuild the network, assume the network being built has no relation to the previous network and go ahead and update the <CODE>TemporaryID</CODE>.)<br /><br /> <br /> Contact Nintendo if there is a problem implementing this specification in your application.<br /></p><!-- write here --></div> 26<h2>Revision History</h2> 27 <div class="section"> 28 <dl class="history"> 29 <dt>2012/03/13</dt> 30<dd>Added description of time before re-issuing ID to the specification for the <CODE>TemporaryId</CODE>.<br /> 31 </dd> 32 <dt>2012/02/13</dt> 33<dd>Added a specification for <CODE>TemporaryId</CODE>.<br /> 34 </dd> 35 <dt>2011/03/08</dt> 36<dd>Added description of the return value.<br /> 37 </dd> 38 <dt>2010/06/14</dt> 39<dd>Initial version.<br /> 40 </dd> 41 </dl> 42 </div> 43 <hr><p>CONFIDENTIAL</p></body> 44</html>