1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/MozNFCTag.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,43 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + * 1.8 + * Part of this idl is from: 1.9 + * http://w3c.github.io/nfc/proposals/common/nfc.html#nfctag-interface 1.10 + * 1.11 + * Copyright © 2013 Deutsche Telekom, Inc. 1.12 + */ 1.13 + 1.14 +enum NFCTechType { 1.15 + "NFC_A", 1.16 + "NFC_B", 1.17 + "NFC_ISO_DEP", 1.18 + "NFC_F", 1.19 + "NFC_V", 1.20 + "NDEF", 1.21 + "NDEF_FORMATABLE", 1.22 + "MIFARE_CLASSIC", 1.23 + "MIFARE_ULTRALIGHT", 1.24 + "NFC_BARCODE", 1.25 + "P2P", 1.26 + "UNKNOWN_TECH" 1.27 +}; 1.28 + 1.29 +[JSImplementation="@mozilla.org/nfc/NFCTag;1"] 1.30 +interface MozNFCTag { 1.31 + DOMRequest getDetailsNDEF(); 1.32 + DOMRequest readNDEF(); 1.33 + DOMRequest writeNDEF(sequence<MozNDEFRecord> records); 1.34 + DOMRequest makeReadOnlyNDEF(); 1.35 + 1.36 + DOMRequest connect(NFCTechType techType); 1.37 + DOMRequest close(); 1.38 +}; 1.39 + 1.40 +// Mozilla Only 1.41 +partial interface MozNFCTag { 1.42 + [ChromeOnly] 1.43 + attribute DOMString session; 1.44 + [ChromeOnly] 1.45 + void setSessionToken(DOMString sessionToken); 1.46 +};