gecko-dev/dom/webidl/NfcOptions.webidl
Yoshi Huang 2ef55ccc43 Bug 1137107 - Part 1: Add NfcRequestType. r=smaug, dimi
From 2c1e87a8e1018f2c1d9f8825e36d1478a8a409bc Mon Sep 17 00:00:00 2001
---
 dom/nfc/gonk/Nfc.js                | 22 ++++++---
 dom/nfc/gonk/NfcGonkMessage.h      |  9 ----
 dom/nfc/gonk/NfcMessageHandler.cpp | 91 +++++++++++++++++++-------------------
 dom/nfc/gonk/NfcOptions.h          |  2 +-
 dom/webidl/NfcOptions.webidl       | 16 ++++++-
 5 files changed, 76 insertions(+), 64 deletions(-)
2015-02-26 13:49:28 +08:00

73 lines
1.2 KiB
Plaintext

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
enum RFState {
"idle",
"listen",
"discovery"
};
/**
* Type of the Request used in NfcCommandOptions.
*/
enum NfcRequestType {
"changeRFState",
"readNDEF",
"writeNDEF",
"makeReadOnly",
"format",
"transceive"
};
dictionary NfcCommandOptions
{
required NfcRequestType type;
long sessionId;
required DOMString requestId;
RFState rfState;
long techType;
boolean isP2P;
sequence<MozNDEFRecordOptions> records;
NFCTechType technology;
Uint8Array command;
};
dictionary NfcEventOptions
{
DOMString type = "";
long status;
NfcErrorMessage errorMsg;
long sessionId;
DOMString requestId;
long majorVersion;
long minorVersion;
boolean isP2P;
sequence<NFCTechType> techList;
Uint8Array tagId;
sequence<MozNDEFRecordOptions> records;
NFCTagType tagType;
long maxNDEFSize;
boolean isReadOnly;
boolean isFormatable;
RFState rfState;
// HCI Event Transaction fields
DOMString origin;
Uint8Array aid;
Uint8Array payload;
// Tag transceive response data
Uint8Array response;
};