dom/system/gonk/nfc_consts.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* Copyright 2012 Mozilla Foundation and Mozilla contributors
michael@0 2 *
michael@0 3 * Licensed under the Apache License, Version 2.0 (the "License");
michael@0 4 * you may not use this file except in compliance with the License.
michael@0 5 * You may obtain a copy of the License at
michael@0 6 *
michael@0 7 * http://www.apache.org/licenses/LICENSE-2.0
michael@0 8 *
michael@0 9 * Unless required by applicable law or agreed to in writing, software
michael@0 10 * distributed under the License is distributed on an "AS IS" BASIS,
michael@0 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
michael@0 12 * See the License for the specific language governing permissions and
michael@0 13 * limitations under the License.
michael@0 14 */
michael@0 15
michael@0 16 /* Copyright © 2013, Deutsche Telekom, Inc. */
michael@0 17
michael@0 18 // Set to true to debug all NFC layers
michael@0 19 this.DEBUG_ALL = false;
michael@0 20
michael@0 21 // Set individually to debug specific layers
michael@0 22 this.DEBUG_WORKER = false || DEBUG_ALL;
michael@0 23 this.DEBUG_CONTENT_HELPER = false || DEBUG_ALL;
michael@0 24 this.DEBUG_NFC = false || DEBUG_ALL;
michael@0 25
michael@0 26 // Current version
michael@0 27 this.NFC_MAJOR_VERSION = 1;
michael@0 28 this.NFC_MINOR_VERSION = 7;
michael@0 29
michael@0 30 this.NFC_REQUEST_CONFIG = 0;
michael@0 31 this.NFC_REQUEST_CONNECT = 1;
michael@0 32 this.NFC_REQUEST_CLOSE = 2;
michael@0 33 this.NFC_REQUEST_GET_DETAILS = 3;
michael@0 34 this.NFC_REQUEST_READ_NDEF = 4;
michael@0 35 this.NFC_REQUEST_WRITE_NDEF = 5;
michael@0 36 this.NFC_REQUEST_MAKE_NDEF_READ_ONLY = 6;
michael@0 37
michael@0 38 this.NFC_RESPONSE_GENERAL = 1000;
michael@0 39 this.NFC_RESPONSE_CONFIG = 1001;
michael@0 40 this.NFC_RESPONSE_READ_NDEF_DETAILS = 1002;
michael@0 41 this.NFC_RESPONSE_READ_NDEF = 1003;
michael@0 42
michael@0 43 this.NFC_NOTIFICATION_INITIALIZED = 2000;
michael@0 44 this.NFC_NOTIFICATION_TECH_DISCOVERED = 2001;
michael@0 45 this.NFC_NOTIFICATION_TECH_LOST = 2002;
michael@0 46
michael@0 47 this.NFC_TECHS = {
michael@0 48 0:"NDEF",
michael@0 49 1:"NDEF_WRITEABLE",
michael@0 50 2:"NDEF_FORMATABLE",
michael@0 51 3:"P2P",
michael@0 52 4:"NFC_A",
michael@0 53 5:"NFC_B",
michael@0 54 6:"NFC_F",
michael@0 55 7:"NFC_V",
michael@0 56 8:"NFC_ISO_DEP"
michael@0 57 };
michael@0 58
michael@0 59 // TODO: Bug 933595. Fill-in all error codes for Gonk/nfcd protocol
michael@0 60 this.GECKO_NFC_ERROR_SUCCESS = 0;
michael@0 61 this.GECKO_NFC_ERROR_GENERIC_FAILURE = 1;
michael@0 62
michael@0 63 // NFC powerlevels must match config PDUs.
michael@0 64 this.NFC_POWER_LEVEL_UNKNOWN = -1;
michael@0 65 this.NFC_POWER_LEVEL_DISABLED = 0;
michael@0 66 this.NFC_POWER_LEVEL_LOW = 1;
michael@0 67 this.NFC_POWER_LEVEL_ENABLED = 2;
michael@0 68
michael@0 69 this.TOPIC_XPCOM_SHUTDOWN = "xpcom-shutdown";
michael@0 70
michael@0 71 this.NFC_PEER_EVENT_READY = 0x01;
michael@0 72 this.NFC_PEER_EVENT_LOST = 0x02;
michael@0 73
michael@0 74 // Allow this file to be imported via Components.utils.import().
michael@0 75 this.EXPORTED_SYMBOLS = Object.keys(this);

mercurial