</li>
<li>1.4. <a href="#SecureElementType">SecureElementType</a>
</li>
+<li>1.5. <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a>
+</li>
+<li>1.6. <a href="#HCEEventType">HCEEventType</a>
+</li>
+<li>1.7. <a href="#AID">AID</a>
+</li>
</ul>
</li>
<li>2. <a href="#interfaces-section">Interfaces</a><ul class="toc">
</li>
<li>2.10. <a href="#NDEFRecordMedia">NDEFRecordMedia</a>
</li>
-<li>2.11. <a href="#NFCTagDetectCallback">NFCTagDetectCallback</a>
+<li>2.11. <a href="#HCEEventData">HCEEventData</a>
+</li>
+<li>2.12. <a href="#AIDData">AIDData</a>
</li>
-<li>2.12. <a href="#NFCPeerDetectCallback">NFCPeerDetectCallback</a>
+<li>2.13. <a href="#NFCTagDetectCallback">NFCTagDetectCallback</a>
</li>
-<li>2.13. <a href="#NDEFMessageReadCallback">NDEFMessageReadCallback</a>
+<li>2.14. <a href="#NFCPeerDetectCallback">NFCPeerDetectCallback</a>
</li>
-<li>2.14. <a href="#ByteArraySuccessCallback">ByteArraySuccessCallback</a>
+<li>2.15. <a href="#NDEFMessageReadCallback">NDEFMessageReadCallback</a>
</li>
-<li>2.15. <a href="#CardEmulationModeChangeCallback">CardEmulationModeChangeCallback</a>
+<li>2.16. <a href="#ByteArraySuccessCallback">ByteArraySuccessCallback</a>
</li>
-<li>2.16. <a href="#TransactionEventCallback">TransactionEventCallback</a>
+<li>2.17. <a href="#CardEmulationModeChangeCallback">CardEmulationModeChangeCallback</a>
</li>
-<li>2.17. <a href="#ActiveSecureElementChangeCallback">ActiveSecureElementChangeCallback</a>
+<li>2.18. <a href="#TransactionEventCallback">TransactionEventCallback</a>
+</li>
+<li>2.19. <a href="#ActiveSecureElementChangeCallback">ActiveSecureElementChangeCallback</a>
+</li>
+<li>2.20. <a href="#HCEEventReceiveCallback">HCEEventReceiveCallback</a>
+</li>
+<li>2.21. <a href="#AIDArraySuccessCallback">AIDArraySuccessCallback</a>
</li>
</ul>
</li>
long <a href="#NFCAdapter::addActiveSecureElementChangeListener">addActiveSecureElementChangeListener</a> (<a href="#ActiveSecureElementChangeCallback">ActiveSecureElementChangeCallback</a> changeCallback)<br>
void <a href="#NFCAdapter::removeActiveSecureElementChangeListener">removeActiveSecureElementChangeListener</a> (long watchId)<br>
<a href="#NDEFMessage">NDEFMessage</a>? <a href="#NFCAdapter::getCachedMessage">getCachedMessage</a> ()<br>
- void <a href="#NFCAdapter::setExclusiveModeForTransaction">setExclusiveModeForTransaction</a> (boolean mode)</td>
+ void <a href="#NFCAdapter::setExclusiveModeForTransaction">setExclusiveModeForTransaction</a> (boolean mode)<br>
+ long <a href="#NFCAdapter::addHCEEventListener">addHCEEventListener</a> (<a href="#HCEEventReceiveCallback">HCEEventReceiveCallback</a> eventCallback)<br>
+ void <a href="#NFCAdapter::removeHCEEventListener">removeHCEEventListener</a> (long watchId)<br>
+ void <a href="#NFCAdapter::sendHostAPDUResponse">sendHostAPDUResponse</a> (byte[] apdu, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)<br>
+ boolean <a href="#NFCAdapter::isActivatedHandlerForAID">isActivatedHandlerForAID</a> (<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid)<br>
+ boolean <a href="#NFCAdapter::isActivatedHandlerForCategory">isActivatedHandlerForCategory</a> (<a href="#SecureElementType">SecureElementType</a> type, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category)<br>
+ void <a href="#NFCAdapter::registerAID">registerAID</a> (<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category)<br>
+ void <a href="#NFCAdapter::unregisterAID">unregisterAID</a> (<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category)<br>
+ void <a href="#NFCAdapter::getAIDsForCategory">getAIDsForCategory</a> (<a href="#SecureElementType">SecureElementType</a> type, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category, <a href="#AIDArraySuccessCallback">AIDArraySuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</td>
</tr>
<tr>
<td><a href="#NFCTag">NFCTag</a></td>
<td></td>
</tr>
<tr>
+<td><a href="#HCEEventData">HCEEventData</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#AIDData">AIDData</a></td>
+<td></td>
+</tr>
+<tr>
<td><a href="#NFCTagDetectCallback">NFCTagDetectCallback</a></td>
<td>void <a href="#NFCTagDetectCallback::onattach">onattach</a> (<a href="#NFCTag">NFCTag</a> nfcTag)<br>
void <a href="#NFCTagDetectCallback::ondetach">ondetach</a> ()</td>
<td><a href="#ActiveSecureElementChangeCallback">ActiveSecureElementChangeCallback</a></td>
<td>void <a href="#ActiveSecureElementChangeCallback::onchanged">onchanged</a> (<a href="#SecureElementType">SecureElementType</a> type)</td>
</tr>
+<tr>
+<td><a href="#HCEEventReceiveCallback">HCEEventReceiveCallback</a></td>
+<td>void <a href="#HCEEventReceiveCallback::ondetected">ondetected</a> (<a href="#HCEEventData">HCEEventData</a> data)</td>
+</tr>
+<tr>
+<td><a href="#AIDArraySuccessCallback">AIDArraySuccessCallback</a></td>
+<td>void <a href="#AIDArraySuccessCallback::onsuccess">onsuccess</a> (<a href="#AIDData">AIDData</a>[] aids)</td>
+</tr>
</tbody>
</table>
<div class="typedefs" id="typedefs-section">
<div class="brief">
Specifies the secure element types.
</div>
-<pre class="webidl prettyprint"> enum SecureElementType { "ESE", "UICC" };</pre>
+<pre class="webidl prettyprint"> enum SecureElementType { "ESE", "UICC", "HCE" };</pre>
<p><span class="version">
Since: </span>
2.3
ESE - The eSE (Embedded Secure Element) secure element type </li>
<li>
UICC - The UICC (Universal Integrated Circuit Card) secure element type </li>
+ <li>
+HCE - The HCE (Host Card Emulation) type. This allows a card to be emulated without secure element </li>
+ </ul>
+ </div>
+<p><span class="remark"> Remark : </span>
+ <em>HCE</em> is supported since Tizen 2.3.1
+ </p>
+</div>
+<div class="enum" id="CardEmulationCategoryType">
+<a class="backward-compatibility-anchor" name="::NFC::CardEmulationCategoryType"></a><h3>1.5. CardEmulationCategoryType</h3>
+<div class="brief">
+ Specifies the card emulation category types.
+ </div>
+<pre class="webidl prettyprint"> enum CardEmulationCategoryType { "PAYMENT", "OTHER" };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The following values are supported:
+ </p>
+ <ul>
+ <li>
+PAYMENT - Category used for NFC payment services </li>
+ <li>
+OTHER - Category that can be used for all other cards </li>
+ </ul>
+ </div>
+</div>
+<div class="enum" id="HCEEventType">
+<a class="backward-compatibility-anchor" name="::NFC::HCEEventType"></a><h3>1.6. HCEEventType</h3>
+<div class="brief">
+ Specifies the HCE event types.
+ </div>
+<pre class="webidl prettyprint"> enum HCEEventType { "DEACTIVATED", "ACTIVATED", "APDU_RECEIVED" };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The following values are supported:
+ </p>
+ <ul>
+ <li>
+DEACTIVATED - HCE deactivated </li>
+ <li>
+ACTIVATED - HCE activated </li>
+ <li>
+APDU_RECEIVED - APDU (Application Protocol Data Unit) received </li>
</ul>
</div>
</div>
+<div class="typedef" id="AID">
+<a class="backward-compatibility-anchor" name="::NFC::AID"></a><h3>1.7. AID</h3>
+<div class="brief">
+ AID (Application ID) as specified in ISO/IEC 7816-4.
+ </div>
+<pre class="webidl prettyprint"> typedef DOMString AID;</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</div>
</div>
<div class="interfaces" id="interfaces-section">
<h2>2. Interfaces</h2>
void setExclusiveModeForTransaction(boolean mode) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ long addHCEEventListener(<a href="#HCEEventReceiveCallback">HCEEventReceiveCallback</a> eventCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void removeHCEEventListener(long watchId) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void sendHostAPDUResponse(byte[] apdu, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ boolean isActivatedHandlerForAID(<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ boolean isActivatedHandlerForCategory(<a href="#SecureElementType">SecureElementType</a> type, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void registerAID(<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void unregisterAID(<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void getAIDsForCategory(<a href="#SecureElementType">SecureElementType</a> type, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category, <a href="#AIDArraySuccessCallback">AIDArraySuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
};</pre>
<p><span class="version">
Since: </span>
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">watchId</span>:
- Subscription identifier to remove
+<span class="name">watchId</span>:
+ Subscription identifier to remove
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type NotSupportedError, if NFC card emulation is not supported.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> try {
+ adapter.removeActiveSecureElementChangeListener(listenerId) ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="NFCAdapter::getCachedMessage">
+<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::getCachedMessage"></a><code><b><span class="methodName">getCachedMessage</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets the NDEF message cached when the tag is detected.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="#NDEFMessage">NDEFMessage</a>? getCachedMessage();
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 1.0
+ </p>
+<div class="description">
+ <p>
+If the operation completes successfully, the NDEF Message that is last read
+should be returned.
+ </p>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/nfc.common
+ </p>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ NDEFMessage The NDEF Message that was last read.
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Gets the cached message
+ var cachedMessage = tizen.nfc.getDefaultAdapter().getCachedMessage();
+ </pre>
+</div>
+</dd>
+<dt class="method" id="NFCAdapter::setExclusiveModeForTransaction">
+<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::setExclusiveModeForTransaction"></a><code><b><span class="methodName">setExclusiveModeForTransaction</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gives priority to the current application for NFC transaction events.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void setExclusiveModeForTransaction(boolean mode);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3
+ </p>
+<div class="description">
+ <p>
+If the current application has priority, and is in the foreground, the system will not generate
+application control requests to pick an application to handle a transaction event request.
+ </p>
+ <p>
+When the current application moves to the background, it loses priority.
+ </p>
+ <p>
+An application is allowed to get priority only when it is in the foreground.
+Losing priority is always allowed regardless of an application's status.
+ </p>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/nfc.cardemulation
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">mode</span>:
+ Value of the exclusive mode
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method or a valid certificate to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type ServiceNotAvailableError, if the application is not in the foreground and is trying to get priority.
+ </p></li>
+<li class="list"><p>
+ with error type NotSupportedError, if NFC card emulation is not supported.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> try {
+ adapter.setExclusiveModeForTransaction(true) ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="NFCAdapter::addHCEEventListener">
+<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::addHCEEventListener"></a><code><b><span class="methodName">addHCEEventListener</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Registers a callback function for receiving HCE event.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">long addHCEEventListener(<a href="#HCEEventReceiveCallback">HCEEventReceiveCallback</a> eventCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/nfc.cardemulation
+ </p>
+<p><span class="remark"> Remark : </span>
+ To check if NFC HCE is supported on this device, use <var>tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce")</var>.
+<br>If it is not supported, <var>NotSupportedError</var> is thrown.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">eventCallback</span>:
+ Callback method to be invoked when host device receives an APDU that is defined in the ISO/IEC 7816-4 specification
+ </li>
+ </ul>
+</div>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ long Subscription identifier
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type NotSupportedError, if NFC HCE is not supported.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> try {
+ var onDetectedCB = function(event_data) {
+ console.log("HCE event type is " + event_data.eventType);
+ console.log("APDU is " + event_data.apdu);
+ };
+ var listenerId = adapter.addHCEEventListener(onDetectedCB) ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="NFCAdapter::removeHCEEventListener">
+<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::removeHCEEventListener"></a><code><b><span class="methodName">removeHCEEventListener</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Unsubscribes from receiving notification of a HCE event.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void removeHCEEventListener(long watchId);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/nfc.cardemulation
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">watchId</span>:
+ Subscription identifier to remove
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type NotSupportedError, if NFC HCE is not supported.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> try {
+ adapter.removeHCEEventListener(listenerId) ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="NFCAdapter::sendHostAPDUResponse">
+<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::sendHostAPDUResponse"></a><code><b><span class="methodName">sendHostAPDUResponse</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ send host APDU response to CLF (Contactless Front-end).
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void sendHostAPDUResponse(byte[] apdu, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The ErrorCallback is launched with these error types:
+ </p>
+ <ul>
+ <li>
+ ServiceNotAvailableError - If the NFC service is not available. </li>
+ <li>
+ UnknownError - If any other error occurs. </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/nfc.cardemulation
+ </p>
+<p><span class="remark"> Remark : </span>
+ To check if NFC HCE is supported on this device, use <var>tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce")</var>.
+<br>If it is not supported, <var>NotSupportedError</var> is thrown.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">apdu</span>:
+ The APDU data to send. APDU is defined in the ISO/IEC 7816-4 specification.
+ </li>
+ <li class="param">
+<span class="name">successCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Invoked when an APDU is successfully sent to the NFC reader.
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Invoked in case any error occurs while sending.
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type NotSupportedError, if NFC HCE is not supported.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> try {
+ var successCB = function() {
+ console.log("Sending APDU reponse was successful.");
+ };
+
+ var errorCB = function() {
+ console.log("Sending APDU reponse failed.");
+ };
+
+ var apdu_response= [0x00,0xA4,0x04,0x00,0x04,0x11,0x12, 0x13, 0x14]; //set apdu response.
+ adapter.sendHostAPDUResponse(apdu_response, successCB, errorCB) ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="NFCAdapter::isActivatedHandlerForAID">
+<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::isActivatedHandlerForAID"></a><code><b><span class="methodName">isActivatedHandlerForAID</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Allows an application to query whether an application is currently the activated handler for a specific AID and secure element type.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">boolean isActivatedHandlerForAID(<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/nfc.cardemulation
+ </p>
+<p><span class="remark"> Remark : </span>
+ To check if NFC HCE is supported on this device, use <var>tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce")</var>.
+<br>If it is not supported, <var>NotSupportedError</var> is thrown.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">type</span>:
+ The secure element type
+ </li>
+ <li class="param">
+<span class="name">aid</span>:
+ Application ID, specified in ISO/IEC 7816-4
+ </li>
+ </ul>
+</div>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ boolean <em>true</em> if current application is activated handler for the AID
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type NotSupportedError, if NFC HCE is not supported.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> try {
+ var aid = "ABC0012345";
+ var isActiveHandler = adapter.isActivatedHandlerForAID("HCE", aid);
+ if(isActiveHandler){
+ console.log("current application is activated handler for the AID");
+ }
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="NFCAdapter::isActivatedHandlerForCategory">
+<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::isActivatedHandlerForCategory"></a><code><b><span class="methodName">isActivatedHandlerForCategory</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Allows an application to query whether an application is currently the activated handler for a specific card emulation category and secure element type.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">boolean isActivatedHandlerForCategory(<a href="#SecureElementType">SecureElementType</a> type, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/nfc.cardemulation
+ </p>
+<p><span class="remark"> Remark : </span>
+ To check if NFC HCE is supported on this device, use <var>tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce")</var>.
+<br>If it is not supported, <var>NotSupportedError</var> is thrown.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">type</span>:
+ The secure element type
+ </li>
+ <li class="param">
+<span class="name">category</span>:
+ The card emulation category type
+ </li>
+ </ul>
+</div>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ boolean <em>true</em> if current application is activated handler for the category
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type NotSupportedError, if NFC HCE is not supported.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> try {
+ var isActiveHandler = adapter.isActivatedHandlerForCategory("ESE", "PAYMENT") ;
+ if(isActiveHandler){
+ console.log("current application is activated handler for the category");
+ }
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="NFCAdapter::registerAID">
+<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::registerAID"></a><code><b><span class="methodName">registerAID</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Registers an AID for a specific category and secure element type.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void registerAID(<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/nfc.cardemulation
+ </p>
+<p><span class="remark"> Remark : </span>
+ To check if NFC HCE is supported on this device, use <var>tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce")</var>.
+<br>If it is not supported, <var>NotSupportedError</var> is thrown.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">type</span>:
+ The secure element type
+ </li>
+ <li class="param">
+<span class="name">aid</span>:
+ Application Id, specified in ISO/IEC 7816-4
+ </li>
+ <li class="param">
+<span class="name">category</span>:
+ The card emulation category type
</li>
</ul>
</div>
<p><span class="except">Exceptions:</span></p>
<ul class="exception"><li>WebAPIException<ul>
<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
with error type SecurityError, if the application does not have the privilege to call this method.
</p></li>
<li class="list"><p>
- with error type NotSupportedError, if NFC card emulation is not supported.
+ with error type NotSupportedError, if NFC HCE is not supported.
</p></li>
<li class="list"><p>
with error type UnknownError, in any other error case.
</div>
<div class="example">
<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> try {
- adapter.removeActiveSecureElementChangeListener(listenerId) ;
+
+ var aid = "ABC0012345";
+ adapter.registerAID("HCE", aid, "PAYMENT") ;
} catch (err) {
console.log(err.name + ": " + err.message);
}
</pre>
</div>
</dd>
-<dt class="method" id="NFCAdapter::getCachedMessage">
-<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::getCachedMessage"></a><code><b><span class="methodName">getCachedMessage</span></b></code>
+<dt class="method" id="NFCAdapter::unregisterAID">
+<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::unregisterAID"></a><code><b><span class="methodName">unregisterAID</span></b></code>
</dt>
<dd>
<div class="brief">
- Gets the NDEF message cached when the tag is detected.
+ Unregisters an AID that was previously registered for a specific card emulation category and secure element type. An application can only remove the AIDs which it registered.
</div>
-<div class="synopsis"><pre class="signature prettyprint"><a href="#NDEFMessage">NDEFMessage</a>? getCachedMessage();
+<div class="synopsis"><pre class="signature prettyprint">void unregisterAID(<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category);
</pre></div>
<p><span class="version">
Since: </span>
- 1.0
- </p>
-<div class="description">
- <p>
-If the operation completes successfully, the NDEF Message that is last read
-should be returned.
+ 2.3.1
</p>
- </div>
<p><span class="privilegelevel">
Privilege level: </span>
public
</p>
<p><span class="privilege">
Privilege: </span>
- http://tizen.org/privilege/nfc.common
+ http://tizen.org/privilege/nfc.cardemulation
</p>
-<div class="returntype">
-<p><span class="return">Return value:</span></p>
- NDEFMessage The NDEF Message that was last read.
- </div>
+<p><span class="remark"> Remark : </span>
+ To check if NFC HCE is supported on this device, use <var>tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce")</var>.
+<br>If it is not supported, <var>NotSupportedError</var> is thrown.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">type</span>:
+ The secure element type
+ </li>
+ <li class="param">
+<span class="name">aid</span>:
+ Application Id, specified in ISO/IEC 7816-4
+ </li>
+ <li class="param">
+<span class="name">category</span>:
+ The card emulation category type
+ </li>
+ </ul>
+</div>
<div class="exceptionlist">
<p><span class="except">Exceptions:</span></p>
<ul class="exception"><li>WebAPIException<ul>
<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
with error type SecurityError, if the application does not have the privilege to call this method.
</p></li>
<li class="list"><p>
+ with error type NotSupportedError, if NFC HCE is not supported.
+ </p></li>
+<li class="list"><p>
with error type UnknownError, in any other error case.
</p></li>
</ul>
</li></ul>
</div>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // Gets the cached message
- var cachedMessage = tizen.nfc.getDefaultAdapter().getCachedMessage();
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> try {
+
+ var aid = "ABC0012345";
+ adapter.unregisterAID("HCE", aid, "PAYMENT") ;
+ } catch (err) {
+ console.log(err.name + ": " + err.message);
+ }
</pre>
</div>
</dd>
-<dt class="method" id="NFCAdapter::setExclusiveModeForTransaction">
-<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::setExclusiveModeForTransaction"></a><code><b><span class="methodName">setExclusiveModeForTransaction</span></b></code>
+<dt class="method" id="NFCAdapter::getAIDsForCategory">
+<a class="backward-compatibility-anchor" name="::NFC::NFCAdapter::getAIDsForCategory"></a><code><b><span class="methodName">getAIDsForCategory</span></b></code>
</dt>
<dd>
<div class="brief">
- Gives priority to the current application for NFC transaction events.
+ Retrieves AIDs that were previously registered for a specific card emulation category and secure element type. An application can only retrieve the AIDs which it registered.
</div>
-<div class="synopsis"><pre class="signature prettyprint">void setExclusiveModeForTransaction(boolean mode);
+<div class="synopsis"><pre class="signature prettyprint">void getAIDsForCategory(<a href="#SecureElementType">SecureElementType</a> type, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category, <a href="#AIDArraySuccessCallback">AIDArraySuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
</pre></div>
<p><span class="version">
Since: </span>
- 2.3
+ 2.3.1
</p>
<div class="description">
<p>
-If the current application has priority, and is in the foreground, the system will not generate
-application control requests to pick an application to handle a transaction event request.
- </p>
- <p>
-When the current application moves to the background, it loses priority.
- </p>
- <p>
-An application is allowed to get priority only when it is in the foreground.
-Losing priority is always allowed regardless of an application's status.
+The ErrorCallback is launched with these error types:
</p>
+ <ul>
+ <li>
+ ServiceNotAvailableError - If the NFC service is not available. </li>
+ <li>
+ UnknownError - If any other error occurs. </li>
+ </ul>
</div>
<p><span class="privilegelevel">
Privilege level: </span>
Privilege: </span>
http://tizen.org/privilege/nfc.cardemulation
</p>
+<p><span class="remark"> Remark : </span>
+ To check if NFC HCE is supported on this device, use <var>tizen.systeminfo.getCapability("http://tizen.org/feature/network.nfc.card_emulation.hce")</var>.
+<br>If it is not supported, <var>NotSupportedError</var> is thrown.
+ </p>
<div class="parameters">
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
-<span class="name">mode</span>:
- Value of the exclusive mode
+<span class="name">type</span>:
+ The secure element type
+ </li>
+ <li class="param">
+<span class="name">category</span>:
+ The card emulation category type
+ </li>
+ <li class="param">
+<span class="name">successCallback</span>:
+ Invoked when the AIDs are retrieved successfully.
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Invoked in case any error occurs while retrieving.
</li>
</ul>
</div>
<p><span class="except">Exceptions:</span></p>
<ul class="exception"><li>WebAPIException<ul>
<li class="list"><p>
- with error type SecurityError, if the application does not have the privilege to call this method or a valid certificate to call this method.
- </p></li>
-<li class="list"><p>
- with error type ServiceNotAvailableError, if the application is not in the foreground and is trying to get priority.
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
</p></li>
<li class="list"><p>
- with error type NotSupportedError, if NFC card emulation is not supported.
+ with error type SecurityError, if the application does not have the privilege to call this method.
</p></li>
<li class="list"><p>
- with error type UnknownError, in any other error case.
+ with error type NotSupportedError, if NFC HCE is not supported.
</p></li>
</ul>
</li></ul>
</div>
-<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> try {
- adapter.setExclusiveModeForTransaction(true) ;
- } catch (err) {
- console.log(err.name + ": " + err.message);
- }
- </pre>
-</div>
</dd>
</dl>
</div>
</li></ul>
</div>
</div>
+<div class="interface" id="HCEEventData">
+<a class="backward-compatibility-anchor" name="::NFC::HCEEventData"></a><h3>2.11. HCEEventData</h3>
+<div class="brief">
+ The HCEEventData interface represents HCE event data.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface HCEEventData {
+ readonly attribute <a href="#HCEEventType">HCEEventType</a> eventType;
+
+ readonly attribute byte[] apdu;
+
+ readonly attribute long length;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="HCEEventData::eventType">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">HCEEventType </span><span class="name">eventType</span></span><div class="brief">
+ HCE event type.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="HCEEventData::apdu">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">byte[]
+ </span><span class="name">apdu</span></span><div class="brief">
+ The bytes array of APDU
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="HCEEventData::length">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">long </span><span class="name">length</span></span><div class="brief">
+ The length of APDU
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+</ul>
+</div>
+</div>
+<div class="interface" id="AIDData">
+<a class="backward-compatibility-anchor" name="::NFC::AIDData"></a><h3>2.12. AIDData</h3>
+<div class="brief">
+ The AID data interface represents registerd AID data
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface AIDData{
+ readonly attribute <a href="#SecureElementType">SecureElementType</a> type;
+
+ readonly attribute <a href="#AID">AID</a> aid;
+
+ readonly attribute boolean readOnly;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="AIDData::type">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">SecureElementType </span><span class="name">type</span></span><div class="brief">
+ Secure Element type.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="AIDData::aid">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">AID </span><span class="name">aid</span></span><div class="brief">
+ The AID (Application ID) data, specified in ISO/IEC 7816-4
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="AIDData::readOnly">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">readOnly</span></span><div class="brief">
+ An attribute to indicate whether the registered AID is read-only or not
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+</ul>
+</div>
+</div>
<div class="interface" id="NFCTagDetectCallback">
-<a class="backward-compatibility-anchor" name="::NFC::NFCTagDetectCallback"></a><h3>2.11. NFCTagDetectCallback</h3>
+<a class="backward-compatibility-anchor" name="::NFC::NFCTagDetectCallback"></a><h3>2.13. NFCTagDetectCallback</h3>
<div class="brief">
The NFCTagDetectCallback interface specifies a success callback to be invoked when an NFC tag is detected or lost.
</div>
</div>
</div>
<div class="interface" id="NFCPeerDetectCallback">
-<a class="backward-compatibility-anchor" name="::NFC::NFCPeerDetectCallback"></a><h3>2.12. NFCPeerDetectCallback</h3>
+<a class="backward-compatibility-anchor" name="::NFC::NFCPeerDetectCallback"></a><h3>2.14. NFCPeerDetectCallback</h3>
<div class="brief">
The NFCPeerDetectCallback interface specifies a success callback to be invoked when an NFC peer-to-peer target is detected or lost.
</div>
</div>
</div>
<div class="interface" id="NDEFMessageReadCallback">
-<a class="backward-compatibility-anchor" name="::NFC::NDEFMessageReadCallback"></a><h3>2.13. NDEFMessageReadCallback</h3>
+<a class="backward-compatibility-anchor" name="::NFC::NDEFMessageReadCallback"></a><h3>2.15. NDEFMessageReadCallback</h3>
<div class="brief">
The NDEFMessageReadCallback interface specifies a success callback to be invoked when data has been read successfully from the NFC tag or target.
</div>
</div>
</div>
<div class="interface" id="ByteArraySuccessCallback">
-<a class="backward-compatibility-anchor" name="::NFC::ByteArraySuccessCallback"></a><h3>2.14. ByteArraySuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::NFC::ByteArraySuccessCallback"></a><h3>2.16. ByteArraySuccessCallback</h3>
<div class="brief">
The ByteArraySuccessCallback interface specifies a success callback to be invoked when NFCTag.transceive() completes successfully.
</div>
</div>
</div>
<div class="interface" id="CardEmulationModeChangeCallback">
-<a class="backward-compatibility-anchor" name="::NFC::CardEmulationModeChangeCallback"></a><h3>2.15. CardEmulationModeChangeCallback</h3>
+<a class="backward-compatibility-anchor" name="::NFC::CardEmulationModeChangeCallback"></a><h3>2.17. CardEmulationModeChangeCallback</h3>
<div class="brief">
The CardEmulationModeChangeCallback interface specifies a success callback to be invoked when the card emulation mode is changed.
</div>
</div>
</div>
<div class="interface" id="TransactionEventCallback">
-<a class="backward-compatibility-anchor" name="::NFC::TransactionEventCallback"></a><h3>2.16. TransactionEventCallback</h3>
+<a class="backward-compatibility-anchor" name="::NFC::TransactionEventCallback"></a><h3>2.18. TransactionEventCallback</h3>
<div class="brief">
The TransactionEventCallback interface specifies a success callback to be invoked when an external reader tries to access a secure element.
</div>
</div>
</div>
<div class="interface" id="ActiveSecureElementChangeCallback">
-<a class="backward-compatibility-anchor" name="::NFC::ActiveSecureElementChangeCallback"></a><h3>2.17. ActiveSecureElementChangeCallback</h3>
+<a class="backward-compatibility-anchor" name="::NFC::ActiveSecureElementChangeCallback"></a><h3>2.19. ActiveSecureElementChangeCallback</h3>
<div class="brief">
The ActiveSecureElementChangeCallback interface specifies a success callback to be invoked when an active secure element is changed.
</div>
</dl>
</div>
</div>
+<div class="interface" id="HCEEventReceiveCallback">
+<a class="backward-compatibility-anchor" name="::NFC::HCEEventReceiveCallback"></a><h3>2.20. HCEEventReceiveCallback</h3>
+<div class="brief">
+ The HCEEventReceiveCallback interface specifies a success callback to be invoked when an HCE event is detected.
+ </div>
+<pre class="webidl prettyprint">[Callback=FunctionOnly, NoInterfaceObject] interface HCEEventReceiveCallback {
+ void ondetected(<a href="#HCEEventData">HCEEventData</a> data);
+};</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="HCEEventReceiveCallback::ondetected">
+<a class="backward-compatibility-anchor" name="::NFC::HCEEventReceiveCallback::ondetected"></a><code><b><span class="methodName">ondetected</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called when HCE event is detected.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void ondetected(<a href="#HCEEventData">HCEEventData</a> data);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">data</span>:
+ HCE event data
+ </li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+<div class="interface" id="AIDArraySuccessCallback">
+<a class="backward-compatibility-anchor" name="::NFC::AIDArraySuccessCallback"></a><h3>2.21. AIDArraySuccessCallback</h3>
+<div class="brief">
+ The AIDArraySuccessCallback interface specifies a success callback to be invoked when an NFCAdaptor.getAIDsForCategory() completes successfully.
+ </div>
+<pre class="webidl prettyprint">[Callback=FunctionOnly, NoInterfaceObject] interface AIDArraySuccessCallback {
+ void onsuccess(<a href="#AIDData">AIDData</a>[] aids);
+};</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="AIDArraySuccessCallback::onsuccess">
+<a class="backward-compatibility-anchor" name="::NFC::AIDArraySuccessCallback::onsuccess"></a><code><b><span class="methodName">onsuccess</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ The method invoked when the asynchronous call completes successfully.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void onsuccess(<a href="#AIDData">AIDData</a>[] aids);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">aids</span>:
+ The list of AIDs
+ </li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
</div>
<h2 id="api-features">3. Related Feature</h2>
<div id="def-api-features" class="def-api-features">
</div></p>
<li class="feature">http://tizen.org/feature/network.nfc.card_emulation</li>
</div>
+<div class="def-api-feature">
+<p><div class="description">
+ <p>
+To guarantee that the NFC host-based card emulation application runs on a device with the NFC host-based card emulation feature, declare the following feature requirements in the config file:
+ </p>
+ </div></p>
+<li class="feature">http://tizen.org/feature/network.nfc.card_emulation.hce</li>
+</div>
<p></p>
For more information, see <a href="../../../../../org.tizen.gettingstarted/html/details/app_filtering.htm#web">Application Filtering</a>.
</div>
enum CardEmulationMode { "ALWAYS_ON", "OFF" };
- enum SecureElementType { "ESE", "UICC" };
+ enum SecureElementType { "ESE", "UICC", "HCE" };
+
+ enum CardEmulationCategoryType { "PAYMENT", "OTHER" };
+
+ enum HCEEventType { "DEACTIVATED", "ACTIVATED", "APDU_RECEIVED" };
+
+ typedef DOMString AID;
[NoInterfaceObject] interface NFCManagerObject {
readonly attribute <a href="#NFCManager">NFCManager</a> nfc;
void setExclusiveModeForTransaction(boolean mode) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ long addHCEEventListener(<a href="#HCEEventReceiveCallback">HCEEventReceiveCallback</a> eventCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void removeHCEEventListener(long watchId) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void sendHostAPDUResponse(byte[] apdu, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ boolean isActivatedHandlerForAID(<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ boolean isActivatedHandlerForCategory(<a href="#SecureElementType">SecureElementType</a> type, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void registerAID(<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void unregisterAID(<a href="#SecureElementType">SecureElementType</a> type, <a href="#AID">AID</a> aid, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void getAIDsForCategory(<a href="#SecureElementType">SecureElementType</a> type, <a href="#CardEmulationCategoryType">CardEmulationCategoryType</a> category, <a href="#AIDArraySuccessCallback">AIDArraySuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
};
readonly attribute DOMString mimeType;
};
+ [NoInterfaceObject] interface HCEEventData {
+ readonly attribute <a href="#HCEEventType">HCEEventType</a> eventType;
+
+ readonly attribute byte[] apdu;
+
+ readonly attribute long length;
+ };
+
+ [NoInterfaceObject] interface AIDData{
+ readonly attribute <a href="#SecureElementType">SecureElementType</a> type;
+
+ readonly attribute <a href="#AID">AID</a> aid;
+
+ readonly attribute boolean readOnly;
+ };
[Callback, NoInterfaceObject] interface NFCTagDetectCallback {
void onattach(<a href="#NFCTag">NFCTag</a> nfcTag);
void onchanged(<a href="#SecureElementType">SecureElementType</a> type);
};
+[Callback=FunctionOnly, NoInterfaceObject] interface HCEEventReceiveCallback {
+ void ondetected(<a href="#HCEEventData">HCEEventData</a> data);
+};
+
+[Callback=FunctionOnly, NoInterfaceObject] interface AIDArraySuccessCallback {
+ void onsuccess(<a href="#AIDData">AIDData</a>[] aids);
+};
+
};</pre>
</div>
<div id="page-footer">
</li>
<li>2.8. <a href="#UltravioletSensor">UltravioletSensor</a>
</li>
-<li>2.9. <a href="#SensorData">SensorData</a>
+<li>2.9. <a href="#HRMRawSensor">HRMRawSensor</a>
</li>
-<li>2.10. <a href="#SensorLightData">SensorLightData</a>
+<li>2.10. <a href="#SensorData">SensorData</a>
</li>
-<li>2.11. <a href="#SensorMagneticData">SensorMagneticData</a>
+<li>2.11. <a href="#SensorLightData">SensorLightData</a>
</li>
-<li>2.12. <a href="#SensorPressureData">SensorPressureData</a>
+<li>2.12. <a href="#SensorMagneticData">SensorMagneticData</a>
</li>
-<li>2.13. <a href="#SensorProximityData">SensorProximityData</a>
+<li>2.13. <a href="#SensorPressureData">SensorPressureData</a>
</li>
-<li>2.14. <a href="#SensorUltravioletData">SensorUltravioletData</a>
+<li>2.14. <a href="#SensorProximityData">SensorProximityData</a>
</li>
-<li>2.15. <a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a>
+<li>2.15. <a href="#SensorUltravioletData">SensorUltravioletData</a>
+</li>
+<li>2.16. <a href="#SensorHRMRawData">SensorHRMRawData</a>
+</li>
+<li>2.17. <a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a>
</li>
</ul>
</li>
<td>void <a href="#UltravioletSensor::getUltravioletSensorData">getUltravioletSensorData</a> (<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</td>
</tr>
<tr>
+<td><a href="#HRMRawSensor">HRMRawSensor</a></td>
+<td>void <a href="#HRMRawSensor::getHRMRawSensorData">getHRMRawSensorData</a> (<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</td>
+</tr>
+<tr>
<td><a href="#SensorData">SensorData</a></td>
<td></td>
</tr>
<td></td>
</tr>
<tr>
+<td><a href="#SensorHRMRawData">SensorHRMRawData</a></td>
+<td></td>
+</tr>
+<tr>
<td><a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a></td>
<td>void <a href="#SensorDataSuccessCallback::onsuccess">onsuccess</a> (optional <a href="#SensorData">SensorData</a>? sensorData)</td>
</tr>
<div class="brief">
Specifies the sensor type available to the API.
</div>
-<pre class="webidl prettyprint"> enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE", "PROXIMITY", "ULTRAVIOLET" };</pre>
+<pre class="webidl prettyprint"> enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE", "PROXIMITY", "ULTRAVIOLET", "HRM_RAW" };</pre>
<p><span class="version">
Since: </span>
2.3
PROXIMITY - Proximity sensor </li>
<li>
ULTRAVIOLET - Ultraviolet sensor </li>
+ <li>
+HRM_RAW - HRM sensor </li>
</ul>
</div>
+<p><span class="remark"> Remark : </span>
+ <em>HRM_RAW</em> is supported since Tizen 2.3.1
+ </p>
</div>
<div class="enum" id="ProximityState">
<a class="backward-compatibility-anchor" name="::Sensor::ProximityState"></a><h3>1.2. ProximityState</h3>
PROXIMITY - tizen.systeminfo.getCapability(<em>"http://tizen.org/feature/sensor.proximity"</em>) </li>
<li>
ULTRAVIOLET - tizen.systeminfo.getCapability(<em>"http://tizen.org/feature/sensor.ultraviolet"</em>) </li>
+ <li>
+ HRM_RAW - tizen.systeminfo.getCapability(<em>"http://tizen.org/feature/sensor.heart_rate_monitor"</em>) </li>
</ul>
</div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/healthinfo
+ </p>
+<p><span class="remark"> Remark : </span>
+ <b>http://tizen.org/privilege/healthinfo</b> is required only for <a href="#SensorType">HRM_RAW </a> type. <em>HRM_RAW</em> is supported since Tizen 2.3.1
+ </p>
<div class="parameters">
<p><span class="param">Parameters:</span></p>
<ul>
<li class="list"><p>
with error type NotSupportedError, if the given <var>type</var> is not supported on the device.
</p></li>
+<li class="list"><p>
+ with error type SecurityError, this error is only thrown for <em> HRM_RAW </em> sensor type when an application does not have http://tizen.org/privilege/healthinfo privilege in config.xml.
+ </p></li>
</ul>
</li></ul>
</div>
</dl>
</div>
</div>
+<div class="interface" id="HRMRawSensor">
+<a class="backward-compatibility-anchor" name="::Sensor::HRMRawSensor"></a><h3>2.9. HRMRawSensor</h3>
+<div class="brief">
+ The HRMRawSensor interface provides methods to access HRM sensor raw data.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface HRMRawSensor : <a href="#Sensor">Sensor</a> {
+
+ void getHRMRawSensorData(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+
+ <div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="HRMRawSensor::getHRMRawSensorData">
+<a class="backward-compatibility-anchor" name="::Sensor::HRMRawSensor::getHRMRawSensorData"></a><code><b><span class="methodName">getHRMRawSensorData</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets the current sensor data.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void getHRMRawSensorData(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+Note that before calling the getHRMRawSensorData() method, the start() method should be called to turn on the sensor.
+ </p>
+ <p>
+The <em>ErrorCallback</em> method is launched with these error types:
+ </p>
+ <ul>
+ <li>
+ ServiceNotAvailableError : If the getHRMRawSensorData method is called without calling the start method. </li>
+ <li>
+ UnknownError : An unknown error has occurred. </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/healthinfo
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span>:
+ Callback method to be invoked when the sensor data has been read
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback method to be invoked when an error occurs
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, if retrieving the sensor data fails because of an unknown error.
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to use this function.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var HRMrawsensor = tizen.sensorservice.getDefaultSensor("HRM_RAW");
+
+ function onGetSuccessCB(sensorData) {
+ console.log("HRMRaw light intensity : " + sensorData.lightIntensity);
+ }
+
+ function onerrorCB(error) {
+ console.log("error occurs");
+ }
+
+ function onsuccessCB() {
+ console.log("HRMRaw sensor start");
+ HRMrawsensor.getHRMRawSensorData(onGetSuccessCB, onerrorCB);
+ }
+
+ HRMrawsensor.start(onsuccessCB);
+
+ </pre>
+</div>
+</dd>
+</dl>
+</div>
+</div>
<div class="interface" id="SensorData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorData"></a><h3>2.9. SensorData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorData"></a><h3>2.10. SensorData</h3>
<div class="brief">
The SensorData interface is a common abstract interface used by different types of sensor data objects.
</div>
</p>
</div>
<div class="interface" id="SensorLightData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorLightData"></a><h3>2.10. SensorLightData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorLightData"></a><h3>2.11. SensorLightData</h3>
<div class="brief">
The SensorLightData interface represents light sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorMagneticData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorMagneticData"></a><h3>2.11. SensorMagneticData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorMagneticData"></a><h3>2.12. SensorMagneticData</h3>
<div class="brief">
The SensorMagneticData interface represents magnetic sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorPressureData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorPressureData"></a><h3>2.12. SensorPressureData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorPressureData"></a><h3>2.13. SensorPressureData</h3>
<div class="brief">
The SensorPressureData interface represents pressure sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorProximityData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorProximityData"></a><h3>2.13. SensorProximityData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorProximityData"></a><h3>2.14. SensorProximityData</h3>
<div class="brief">
The SensorProximityData interface represents proximity sensor data.
</div>
</div>
</div>
<div class="interface" id="SensorUltravioletData">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorUltravioletData"></a><h3>2.14. SensorUltravioletData</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorUltravioletData"></a><h3>2.15. SensorUltravioletData</h3>
<div class="brief">
The SensorUltravioletData interface represents ultraviolet sensor data.
</div>
</li></ul>
</div>
</div>
+<div class="interface" id="SensorHRMRawData">
+<a class="backward-compatibility-anchor" name="::Sensor::SensorHRMRawData"></a><h3>2.16. SensorHRMRawData</h3>
+<div class="brief">
+ The SensorHRMRawData interface represents HRM sensor raw data.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface SensorHRMRawData : <a href="#SensorData">SensorData</a> {
+
+ readonly attribute DOMString lightType;
+
+ readonly attribute unsigned long lightIntensity;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+
+ <div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="SensorHRMRawData::lightType">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">DOMString </span><span class="name">lightType</span></span><div class="brief">
+ HRM sensor light type.
+ </div>
+<div class="description">
+ <p>
+The following values are supported:
+ </p>
+ <ul>
+ <li>
+LED_IR - The infrared spectrum </li>
+ <li>
+LED_RED - The red light spectrum </li>
+ <li>
+LED_GREEN - The green light spectrum </li>
+ </ul>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="SensorHRMRawData::lightIntensity">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">unsigned long </span><span class="name">lightIntensity</span></span><div class="brief">
+ HRM sensor light intensity measures the light intensity that is reflected from a blood vessel. The changes in the reported value represent blood volume changes in the microvascular bed of the tissue, and can be used to estimate heart rate.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+</ul>
+</div>
+</div>
<div class="interface" id="SensorDataSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Sensor::SensorDataSuccessCallback"></a><h3>2.15. SensorDataSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Sensor::SensorDataSuccessCallback"></a><h3>2.17. SensorDataSuccessCallback</h3>
<div class="brief">
The SensorDataSuccessCallback interface is a callback interface that is invoked when the sensor data has changed. For example, see the Sensor interface.
</div>
</div></p>
<li class="feature">http://tizen.org/feature/sensor.ultraviolet</li>
</div>
+<div class="def-api-feature">
+<p><div class="description">
+ <p>
+To guarantee that the Heart Rate Monitor application runs on a device with a heart rate monitor, declare the following feature requirements in the config file:
+ </p>
+ </div></p>
+<li class="feature">http://tizen.org/feature/sensor.heart_rate_monitor</li>
+</div>
<p></p>
For more information, see <a href="../../../../../org.tizen.gettingstarted/html/details/app_filtering.htm#web">Application Filtering</a>.
</div>
<h2 id="full-webidl">4. Full WebIDL</h2>
<pre class="webidl prettyprint">module Sensor {
- enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE", "PROXIMITY", "ULTRAVIOLET" };
+ enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE", "PROXIMITY", "ULTRAVIOLET", "HRM_RAW" };
enum ProximityState { "FAR", "NEAR" };
optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};
+ [NoInterfaceObject] interface HRMRawSensor : <a href="#Sensor">Sensor</a> {
+
+ void getHRMRawSensorData(<a href="#SensorDataSuccessCallback">SensorDataSuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };
+
[NoInterfaceObject] interface SensorData {
};
readonly attribute long ultravioletLevel;
};
+ [NoInterfaceObject] interface SensorHRMRawData : <a href="#SensorData">SensorData</a> {
+
+ readonly attribute DOMString lightType;
+
+ readonly attribute unsigned long lightIntensity;
+ };
+
[Callback=FunctionOnly, NoInterfaceObject] interface SensorDataSuccessCallback {
void onsuccess(optional <a href="#SensorData">SensorData</a>? sensorData);
};
<div class="supported-platforms"><img class="mobile-mandatory emulator" title="Mandatory, Supported by Tizen Mobile emulator" src="mw_icon.png"></div>
<div class="title"><h1>Sound API</h1></div>
<div class="brief">
- The Sound API provides functions to control volume level for several sound types.
+ The Sound API provides functions to control the volume level for several sound types and to check whether a specified sound device type is connected.
</div>
<div class="description">
<p>
</li>
<li>1.2. <a href="#SoundModeType">SoundModeType</a>
</li>
+<li>1.3. <a href="#SoundDeviceType">SoundDeviceType</a>
+</li>
+<li>1.4. <a href="#SoundIOType">SoundIOType</a>
+</li>
</ul>
</li>
<li>2. <a href="#interfaces-section">Interfaces</a><ul class="toc">
</li>
<li>2.2. <a href="#SoundManager">SoundManager</a>
</li>
-<li>2.3. <a href="#SoundModeChangeCallback">SoundModeChangeCallback</a>
+<li>2.3. <a href="#SoundDeviceInfo">SoundDeviceInfo</a>
+</li>
+<li>2.4. <a href="#SoundModeChangeCallback">SoundModeChangeCallback</a>
+</li>
+<li>2.5. <a href="#SoundVolumeChangeCallback">SoundVolumeChangeCallback</a>
</li>
-<li>2.4. <a href="#SoundVolumeChangeCallback">SoundVolumeChangeCallback</a>
+<li>2.6. <a href="#SoundDeviceStateChangeCallback">SoundDeviceStateChangeCallback</a>
</li>
</ul>
</li>
void <a href="#SoundManager::setSoundModeChangeListener">setSoundModeChangeListener</a> (<a href="#SoundModeChangeCallback">SoundModeChangeCallback</a> callback)<br>
void <a href="#SoundManager::unsetSoundModeChangeListener">unsetSoundModeChangeListener</a> ()<br>
void <a href="#SoundManager::setVolumeChangeListener">setVolumeChangeListener</a> (<a href="#SoundVolumeChangeCallback">SoundVolumeChangeCallback</a> callback)<br>
- void <a href="#SoundManager::unsetVolumeChangeListener">unsetVolumeChangeListener</a> ()</td>
+ void <a href="#SoundManager::unsetVolumeChangeListener">unsetVolumeChangeListener</a> ()<br>
+ <a href="#SoundDeviceInfo">SoundDeviceInfo</a>[] <a href="#SoundManager::getConnectedDeviceList">getConnectedDeviceList</a> ()<br>
+ <a href="#SoundDeviceInfo">SoundDeviceInfo</a>[] <a href="#SoundManager::getActivatedDeviceList">getActivatedDeviceList</a> ()<br>
+ long <a href="#SoundManager::addDeviceStateChangeListener">addDeviceStateChangeListener</a> (<a href="#SoundDeviceStateChangeCallback">SoundDeviceStateChangeCallback</a> callback)<br>
+ void <a href="#SoundManager::removeDeviceStateChangeListener">removeDeviceStateChangeListener</a> (long id)</td>
+</tr>
+<tr>
+<td><a href="#SoundDeviceInfo">SoundDeviceInfo</a></td>
+<td></td>
</tr>
<tr>
<td><a href="#SoundModeChangeCallback">SoundModeChangeCallback</a></td>
<td><a href="#SoundVolumeChangeCallback">SoundVolumeChangeCallback</a></td>
<td>void <a href="#SoundVolumeChangeCallback::onsuccess">onsuccess</a> (<a href="#SoundType">SoundType</a> type, double volume)</td>
</tr>
+<tr>
+<td><a href="#SoundDeviceStateChangeCallback">SoundDeviceStateChangeCallback</a></td>
+<td>void <a href="#SoundDeviceStateChangeCallback::onchanged">onchanged</a> (<a href="#SoundDeviceInfo">SoundDeviceInfo</a> info)</td>
+</tr>
</tbody>
</table>
<div class="typedefs" id="typedefs-section">
</ul>
</div>
</div>
+<div class="enum" id="SoundDeviceType">
+<a class="backward-compatibility-anchor" name="::Sound::SoundDeviceType"></a><h3>1.3. SoundDeviceType</h3>
+<div class="brief">
+ Sound device type
+ </div>
+<pre class="webidl prettyprint"> enum SoundDeviceType {
+ "SPEAKER",
+ "RECEIVER",
+ "AUDIO_JACK",
+ "BLUETOOTH",
+ "HDMI",
+ "MIRRORING",
+ "USB_AUDIO",
+ "MIC"
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The possible types are:
+ </p>
+ <ul>
+ <li>
+ SPEAKER - For sound output using the built-in device speaker </li>
+ <li>
+ RECEIVER - For sound output using the built-in device receiver </li>
+ <li>
+ AUDIO_JACK - For sound input and/or output using the device audio jack which can be connected to a wired accessory such as a headset or headphone </li>
+ <li>
+ BLUETOOTH - For sound input and/or output through a device that is connected by Bluetooth </li>
+ <li>
+ HDMI - For sound output through a device that is connected by HDMI </li>
+ <li>
+ MIRRORING - For sound output through a device that is connected by mirroring </li>
+ <li>
+ USB_AUDIO - For sound output through a device that is connected by USB </li>
+ <li>
+ MICROPHONE - For sound input using the built-in device mic </li>
+ </ul>
+ </div>
+</div>
+<div class="enum" id="SoundIOType">
+<a class="backward-compatibility-anchor" name="::Sound::SoundIOType"></a><h3>1.4. SoundIOType</h3>
+<div class="brief">
+ Sound device I/O type
+ </div>
+<pre class="webidl prettyprint"> enum SoundIOType {
+ "IN",
+ "OUT",
+ "BOTH"
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The possible types are:
+ </p>
+ <ul>
+ <li>
+ IN - For sound device type which <em>only support input</em> </li>
+ <li>
+ OUT - For sound device type which <em>only support output</em> </li>
+ <li>
+ BOTH - For sound device type which <em>supports both input and output</em> </li>
+ </ul>
+ </div>
+</div>
</div>
<div class="interfaces" id="interfaces-section">
<h2>2. Interfaces</h2>
double getVolume(<a href="#SoundType">SoundType</a> type) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
-
void setSoundModeChangeListener(<a href="#SoundModeChangeCallback">SoundModeChangeCallback</a> callback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void unsetSoundModeChangeListener() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void setVolumeChangeListener(<a href="#SoundVolumeChangeCallback">SoundVolumeChangeCallback</a> callback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void unsetVolumeChangeListener() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ <a href="#SoundDeviceInfo">SoundDeviceInfo</a>[] getConnectedDeviceList() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ <a href="#SoundDeviceInfo">SoundDeviceInfo</a>[] getActivatedDeviceList() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ long addDeviceStateChangeListener(<a href="#SoundDeviceStateChangeCallback">SoundDeviceStateChangeCallback</a> callback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void removeDeviceStateChangeListener(long id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};</pre>
<p><span class="version">
Since: </span>
</li></ul>
</div>
</dd>
+<dt class="method" id="SoundManager::getConnectedDeviceList">
+<a class="backward-compatibility-anchor" name="::Sound::SoundManager::getConnectedDeviceList"></a><code><b><span class="methodName">getConnectedDeviceList</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets a list of connected sound devices.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="#SoundDeviceInfo">SoundDeviceInfo</a>[] getConnectedDeviceList();
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ The list of connected sound devices
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type UnknownError in any other error case.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var infoArr = tizen.sound.getConnectedDeviceList();
+
+ for (var i = 0; i < infoArr.length; i++) {
+ cosole.log( infoArr[i].device );
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="SoundManager::getActivatedDeviceList">
+<a class="backward-compatibility-anchor" name="::Sound::SoundManager::getActivatedDeviceList"></a><code><b><span class="methodName">getActivatedDeviceList</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets a list of activated sound devices.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="#SoundDeviceInfo">SoundDeviceInfo</a>[] getActivatedDeviceList();
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ The list of activated sound devices
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type UnknownError in any other error case.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var infoArr = tizen.sound.getActivatedDeviceList();
+
+ for (var i = 0; i < infoArr.length; i++) {
+ cosole.log( infoArr[i].device );
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="SoundManager::addDeviceStateChangeListener">
+<a class="backward-compatibility-anchor" name="::Sound::SoundManager::addDeviceStateChangeListener"></a><code><b><span class="methodName">addDeviceStateChangeListener</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Registers a listener that is to be called when the sound device state is changed.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">long addDeviceStateChangeListener(<a href="#SoundDeviceStateChangeCallback">SoundDeviceStateChangeCallback</a> callback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+There are two types of device state changes:
+ </p>
+ <ul>
+ <li>
+Connectivity: When a device changes from being connected to being disconnected or from being disconnected to being connected. </li>
+ <li>
+Activation: When a device chages from being activated to being deactivated or from being deactivated to being activated. </li>
+ </ul>
+ </div>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">callback</span>:
+ Callback method to be invoked when the sound device state is changed
+ </li>
+ </ul>
+</div>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ long ID of the listener that can be used to remove the listener later.
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError in any other error case.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // A callback
+ var onChanged = function(info) {
+ // Some code to execute when a sound device state is changed
+ if (info.isConnected) {
+ // Some code to execute if the device is connected.
+ console.log( info.device + " is connected" );
+ } else {
+ // Some code to execute if the device is not connected.
+ console.log( info.device + " is not connected" );
+ }
+
+ if (info.isActivated) {
+ // Some code to execute if the device is activated.
+ console.log( info.device + " is activated" );
+ } else {
+ // Some code to execute if the device is not activated.
+ console.log( info.device + " is not activated" );
+ }
+ }
+
+ var id = tizen.sound.addDeviceStateChangeListener(onChanged);
+ </pre>
+</div>
+</dd>
+<dt class="method" id="SoundManager::removeDeviceStateChangeListener">
+<a class="backward-compatibility-anchor" name="::Sound::SoundManager::removeDeviceStateChangeListener"></a><code><b><span class="methodName">removeDeviceStateChangeListener</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Unsubscribes from receiving notifications when the sound device state is changed.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void removeDeviceStateChangeListener(long id);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">id</span>:
+ An ID that identifies the listener
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type UnknownError in any error case.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> // If a listener to be called was registered previously.
+ tizen.sound.removeDeviceStateChangeListener(id);
+ </pre>
+</div>
+</dd>
</dl>
</div>
</div>
+<div class="interface" id="SoundDeviceInfo">
+<a class="backward-compatibility-anchor" name="::Sound::SoundDeviceInfo"></a><h3>2.3. SoundDeviceInfo</h3>
+<div class="brief">
+ The SoundDeviceInfo interface specifies the information about a sound device.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface SoundDeviceInfo {
+
+ readonly attribute long id;
+
+ readonly attribute DOMString name;
+
+ readonly attribute <a href="#SoundDeviceType">SoundDeviceType</a> device;
+
+ readonly attribute <a href="#SoundIOType">SoundIOType</a> direction;
+
+ readonly attribute boolean isConnected;
+
+ readonly attribute boolean isActivated;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="SoundDeviceInfo::id">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">long </span><span class="name">id</span></span><div class="brief">
+ The sound device ID
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="SoundDeviceInfo::name">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">DOMString </span><span class="name">name</span></span><div class="brief">
+ The sound device name
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="SoundDeviceInfo::device">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">SoundDeviceType </span><span class="name">device</span></span><div class="brief">
+ The sound device type
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="SoundDeviceInfo::direction">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">SoundIOType </span><span class="name">direction</span></span><div class="brief">
+ The sound device I/O type
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="SoundDeviceInfo::isConnected">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isConnected</span></span><div class="brief">
+ True if the sound device state is connected
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="SoundDeviceInfo::isActivated">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isActivated</span></span><div class="brief">
+ True if the sound device state is activated
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+</ul>
+</div>
+</div>
<div class="interface" id="SoundModeChangeCallback">
-<a class="backward-compatibility-anchor" name="::Sound::SoundModeChangeCallback"></a><h3>2.3. SoundModeChangeCallback</h3>
+<a class="backward-compatibility-anchor" name="::Sound::SoundModeChangeCallback"></a><h3>2.4. SoundModeChangeCallback</h3>
<div class="brief">
The SoundModeChangeCallback interface specifies a mode change callback for getting notified about the sound mode changes.
</div>
-<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject]
- interface SoundModeChangeCallback {
+<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface SoundModeChangeCallback {
+
void onsuccess(<a href="#SoundModeType">SoundModeType</a> mode);
};</pre>
<p><span class="version">
</div>
</div>
<div class="interface" id="SoundVolumeChangeCallback">
-<a class="backward-compatibility-anchor" name="::Sound::SoundVolumeChangeCallback"></a><h3>2.4. SoundVolumeChangeCallback</h3>
+<a class="backward-compatibility-anchor" name="::Sound::SoundVolumeChangeCallback"></a><h3>2.5. SoundVolumeChangeCallback</h3>
<div class="brief">
The SoundVolumeChangeCallback interface specifies a volume change callback for getting notified about the volume changes.
</div>
-<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject]
- interface SoundVolumeChangeCallback {
+<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface SoundVolumeChangeCallback {
+
void onsuccess(<a href="#SoundType">SoundType</a> type, double volume);
};</pre>
<p><span class="version">
</dl>
</div>
</div>
+<div class="interface" id="SoundDeviceStateChangeCallback">
+<a class="backward-compatibility-anchor" name="::Sound::SoundDeviceStateChangeCallback"></a><h3>2.6. SoundDeviceStateChangeCallback</h3>
+<div class="brief">
+ The SoundDeviceStateChangeCallback interface specifies a sound device type change callback for getting notified when the sound device state changes.
+ </div>
+<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface SoundDeviceStateChangeCallback {
+
+ void onchanged(<a href="#SoundDeviceInfo">SoundDeviceInfo</a> info);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="SoundDeviceStateChangeCallback::onchanged">
+<a class="backward-compatibility-anchor" name="::Sound::SoundDeviceStateChangeCallback::onchanged"></a><code><b><span class="methodName">onchanged</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Method invoked when the sound device state changes.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void onchanged(<a href="#SoundDeviceInfo">SoundDeviceInfo</a> info);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">info</span>:
+ The info to have changed
+ </li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
</div>
<h2 id="full-webidl">3. Full WebIDL</h2>
<pre class="webidl prettyprint">module Sound {
+
enum SoundType {
"SYSTEM",
"NOTIFICATION",
"MUTE"
};
+ enum SoundDeviceType {
+ "SPEAKER",
+ "RECEIVER",
+ "AUDIO_JACK",
+ "BLUETOOTH",
+ "HDMI",
+ "MIRRORING",
+ "USB_AUDIO",
+ "MIC"
+ };
+
+ enum SoundIOType {
+ "IN",
+ "OUT",
+ "BOTH"
+ };
+
[NoInterfaceObject] interface SoundManagerObject {
readonly attribute <a href="#SoundManager">SoundManager</a> sound;
};
double getVolume(<a href="#SoundType">SoundType</a> type) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
-
void setSoundModeChangeListener(<a href="#SoundModeChangeCallback">SoundModeChangeCallback</a> callback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void unsetSoundModeChangeListener() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void setVolumeChangeListener(<a href="#SoundVolumeChangeCallback">SoundVolumeChangeCallback</a> callback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void unsetVolumeChangeListener() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ <a href="#SoundDeviceInfo">SoundDeviceInfo</a>[] getConnectedDeviceList() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ <a href="#SoundDeviceInfo">SoundDeviceInfo</a>[] getActivatedDeviceList() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ long addDeviceStateChangeListener(<a href="#SoundDeviceStateChangeCallback">SoundDeviceStateChangeCallback</a> callback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void removeDeviceStateChangeListener(long id) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};
- [Callback=FunctionOnly, NoInterfaceObject]
- interface SoundModeChangeCallback {
+ [NoInterfaceObject] interface SoundDeviceInfo {
+
+ readonly attribute long id;
+
+ readonly attribute DOMString name;
+
+ readonly attribute <a href="#SoundDeviceType">SoundDeviceType</a> device;
+
+ readonly attribute <a href="#SoundIOType">SoundIOType</a> direction;
+
+ readonly attribute boolean isConnected;
+
+ readonly attribute boolean isActivated;
+ };
+
+ [Callback=FunctionOnly, NoInterfaceObject] interface SoundModeChangeCallback {
+
void onsuccess(<a href="#SoundModeType">SoundModeType</a> mode);
};
- [Callback=FunctionOnly, NoInterfaceObject]
- interface SoundVolumeChangeCallback {
+ [Callback=FunctionOnly, NoInterfaceObject] interface SoundVolumeChangeCallback {
+
void onsuccess(<a href="#SoundType">SoundType</a> type, double volume);
};
+
+ [Callback=FunctionOnly, NoInterfaceObject] interface SoundDeviceStateChangeCallback {
+
+ void onchanged(<a href="#SoundDeviceInfo">SoundDeviceInfo</a> info);
+ };
};</pre>
</div>
<div id="page-footer">
PERIPHERAL </li>
<li>
MEMORY </li>
+ <li>
+CAMERA_FLASH </li>
</ul>
<p>
Not all above properties may be available on every Tizen device. For instance, a device may not support the telephony feature. In that case, <var>CELLULAR_NETWORK</var> and <var>SIM</var> are not available.<br><br>To check the available <var>SystemInfoPropertyId</var>, <em>tizen.systeminfo.getCapability()</em> can be used.
</li>
<li>2.21. <a href="#SystemInfoMemory">SystemInfoMemory</a>
</li>
+<li>2.22. <a href="#SystemInfoCameraFlash">SystemInfoCameraFlash</a>
+</li>
</ul>
</li>
<li>3. <a href="#api-features">Related Feature</a>
<td><a href="#SystemInfoMemory">SystemInfoMemory</a></td>
<td></td>
</tr>
+<tr>
+<td><a href="#SystemInfoCameraFlash">SystemInfoCameraFlash</a></td>
+<td>void <a href="#SystemInfoCameraFlash::setBrightness">setBrightness</a> (double brightness)</td>
+</tr>
</tbody>
</table>
<div class="typedefs" id="typedefs-section">
<div class="brief">
The device property identifier.
</div>
-<pre class="webidl prettyprint"> enum SystemInfoPropertyId { "BATTERY", "CPU", "STORAGE", "DISPLAY", "DEVICE_ORIENTATION", "BUILD", "LOCALE", "NETWORK", "WIFI_NETWORK", "CELLULAR_NETWORK", "SIM", "PERIPHERAL", "MEMORY" };</pre>
+<pre class="webidl prettyprint"> enum SystemInfoPropertyId { "BATTERY" , "CPU", "STORAGE", "DISPLAY", "DEVICE_ORIENTATION", "BUILD", "LOCALE", "NETWORK", "WIFI_NETWORK", "CELLULAR_NETWORK", "SIM", "PERIPHERAL", "MEMORY", "CAMERA_FLASH" };</pre>
<p><span class="version">
Since: </span>
2.0
<p><span class="remark"> Remark : </span>
<em>MEMORY</em> is supported since Tizen 2.3
</p>
+<p><span class="remark"> Remark : </span>
+ <em>CAMERA_FLASH</em> is supported since Tizen 2.4
+ </p>
</div>
<div class="enum" id="SystemInfoNetworkType">
<a class="backward-compatibility-anchor" name="::SystemInfo::SystemInfoNetworkType"></a><h3>1.2. SystemInfoNetworkType</h3>
</li>
<li class="param">
<span class="name">options</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
- An object containing the various options for fetching the properties requested. See <a href="#SystemInfoOptions">details</a>.
+ An object containing the various options for fetching the properties requested. See <a href="./systeminfo.html#::SystemInfo::SystemInfoOptions">details</a>.
</li>
<li class="param">
<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
</li></ul>
</div>
</div>
+<div class="interface" id="SystemInfoCameraFlash">
+<a class="backward-compatibility-anchor" name="::SystemInfo::SystemInfoCameraFlash"></a><h3>2.22. SystemInfoCameraFlash</h3>
+<div class="brief">
+ The SystemInfoCameraFlash provides the way to control the attached the camera flash.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface SystemInfoCameraFlash : <a href="#SystemInfoProperty">SystemInfoProperty</a> {
+ readonly attribute double brightness raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ readonly attribute DOMString camera;
+
+ readonly attribute long levels raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void setBrightness(double brightness) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };</pre>
+
+ <div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="SystemInfoCameraFlash::brightness">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">double </span><span class="name">brightness</span></span><div class="brief">
+ Brightness level of the camera flash (0~1)
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/led
+ </p>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type SecurityError, if this attribute is not allowed.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> tizen.systeminfo.getPropertyValue("CAMERA_FLASH",
+ function (flash) {
+ console.log("Flash brightness is set to: " + (flash.brightness * 100).toFixed(0) + "%");
+ },
+ function (error) {
+ console.log("Error, name: " + error.name + ", message: " + error.message);
+ }
+ );
+ </pre>
+</div>
+</li>
+<li class="attribute" id="SystemInfoCameraFlash::camera">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">DOMString </span><span class="name">camera</span></span><div class="brief">
+ Specifies camera to which this flash belongs
+ </div>
+<div class="description">
+ <ul>
+ <li>
+BACK - back camera flash </li>
+ <li>
+FRONT - front camera flash </li>
+ <li>
+EXTERNAL - external camera flash </li>
+ <li>
+OTHER - a flash attached to any other camera </li>
+ </ul>
+ </div>
+<div class="description">
+ <p>
+The <em>getPropertyValue()</em> method retrieves the <var>SystemInfoCameraFlash</var> for <var>BACK</var> camera.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+</li>
+<li class="attribute" id="SystemInfoCameraFlash::levels">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">long </span><span class="name">levels</span></span><div class="brief">
+ Number of brightness levels supported by the flash (other than 0 brightness)
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/led
+ </p>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type SecurityError, if this attribute is not allowed.
+ </p></li></ul>
+</li></ul>
+ </div>
+</li>
+</ul>
+</div>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="SystemInfoCameraFlash::setBrightness">
+<a class="backward-compatibility-anchor" name="::SystemInfo::SystemInfoCameraFlash::setBrightness"></a><code><b><span class="methodName">setBrightness</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Sets the brightness value of the flash that is located next to the camera.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void setBrightness(double brightness);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.4
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/led
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">brightness</span>:
+ The brightness value of LED (0~1)
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type InvalidValuesError, if any of the input parameters contain an invalid value.
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method or if the author signature does not match that of the designated application.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, if the method cannot be completed because of an unknown error.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> tizen.systeminfo.getPropertyValue("CAMERA_FLASH",
+ function (flash) {
+ try {
+ flash.setBrightness(1);
+ } catch (error) {
+ console.log("Setting flash brightness failed: " + error.message);
+ }
+ },
+ function (error) {
+ console.log("Error, name: " + error.name + ", message: " + error.message);
+ }
+ );
+ </pre>
+</div>
+</dd>
+</dl>
+</div>
+</div>
</div>
<h2 id="api-features">3. Related Feature</h2>
<div id="def-api-features" class="def-api-features">
<h2 id="full-webidl">4. Full WebIDL</h2>
<pre class="webidl prettyprint">module SystemInfo {
- enum SystemInfoPropertyId { "BATTERY", "CPU", "STORAGE", "DISPLAY", "DEVICE_ORIENTATION", "BUILD", "LOCALE", "NETWORK", "WIFI_NETWORK", "CELLULAR_NETWORK", "SIM", "PERIPHERAL", "MEMORY" };
+ enum SystemInfoPropertyId { "BATTERY" , "CPU", "STORAGE", "DISPLAY", "DEVICE_ORIENTATION", "BUILD", "LOCALE", "NETWORK", "WIFI_NETWORK", "CELLULAR_NETWORK", "SIM", "PERIPHERAL", "MEMORY", "CAMERA_FLASH" };
enum SystemInfoNetworkType { "NONE", "2G", "2.5G", "3G", "4G", "WIFI", "ETHERNET", "UNKNOWN" };
};
+ [NoInterfaceObject] interface SystemInfoCameraFlash : <a href="#SystemInfoProperty">SystemInfoProperty</a> {
+ readonly attribute double brightness raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ readonly attribute DOMString camera;
+
+ readonly attribute long levels raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void setBrightness(double brightness) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };
+
};</pre>
</div>
<div id="page-footer">