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

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

mercurial