mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 20:25:44 +00:00
2ef55ccc43
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(-)
73 lines
1.2 KiB
Plaintext
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;
|
|
};
|