dom/system/gonk/nfc_consts.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/system/gonk/nfc_consts.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,75 @@
     1.4 +/* Copyright 2012 Mozilla Foundation and Mozilla contributors
     1.5 + *
     1.6 + * Licensed under the Apache License, Version 2.0 (the "License");
     1.7 + * you may not use this file except in compliance with the License.
     1.8 + * You may obtain a copy of the License at
     1.9 + *
    1.10 + *     http://www.apache.org/licenses/LICENSE-2.0
    1.11 + *
    1.12 + * Unless required by applicable law or agreed to in writing, software
    1.13 + * distributed under the License is distributed on an "AS IS" BASIS,
    1.14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    1.15 + * See the License for the specific language governing permissions and
    1.16 + * limitations under the License.
    1.17 + */
    1.18 +
    1.19 +/* Copyright © 2013, Deutsche Telekom, Inc. */
    1.20 +
    1.21 +// Set to true to debug all NFC layers
    1.22 +this.DEBUG_ALL = false;
    1.23 +
    1.24 +// Set individually to debug specific layers
    1.25 +this.DEBUG_WORKER = false || DEBUG_ALL;
    1.26 +this.DEBUG_CONTENT_HELPER = false || DEBUG_ALL;
    1.27 +this.DEBUG_NFC = false || DEBUG_ALL;
    1.28 +
    1.29 +// Current version
    1.30 +this.NFC_MAJOR_VERSION = 1;
    1.31 +this.NFC_MINOR_VERSION = 7;
    1.32 +
    1.33 +this.NFC_REQUEST_CONFIG = 0;
    1.34 +this.NFC_REQUEST_CONNECT = 1;
    1.35 +this.NFC_REQUEST_CLOSE = 2;
    1.36 +this.NFC_REQUEST_GET_DETAILS = 3;
    1.37 +this.NFC_REQUEST_READ_NDEF = 4;
    1.38 +this.NFC_REQUEST_WRITE_NDEF = 5;
    1.39 +this.NFC_REQUEST_MAKE_NDEF_READ_ONLY = 6;
    1.40 +
    1.41 +this.NFC_RESPONSE_GENERAL = 1000;
    1.42 +this.NFC_RESPONSE_CONFIG = 1001;
    1.43 +this.NFC_RESPONSE_READ_NDEF_DETAILS = 1002;
    1.44 +this.NFC_RESPONSE_READ_NDEF = 1003;
    1.45 +
    1.46 +this.NFC_NOTIFICATION_INITIALIZED = 2000;
    1.47 +this.NFC_NOTIFICATION_TECH_DISCOVERED = 2001;
    1.48 +this.NFC_NOTIFICATION_TECH_LOST = 2002;
    1.49 +
    1.50 +this.NFC_TECHS = {
    1.51 +  0:"NDEF",
    1.52 +  1:"NDEF_WRITEABLE",
    1.53 +  2:"NDEF_FORMATABLE",
    1.54 +  3:"P2P",
    1.55 +  4:"NFC_A",
    1.56 +  5:"NFC_B",
    1.57 +  6:"NFC_F",
    1.58 +  7:"NFC_V",
    1.59 +  8:"NFC_ISO_DEP"
    1.60 +};
    1.61 +
    1.62 +// TODO: Bug 933595. Fill-in all error codes for Gonk/nfcd protocol
    1.63 +this.GECKO_NFC_ERROR_SUCCESS             = 0;
    1.64 +this.GECKO_NFC_ERROR_GENERIC_FAILURE     = 1;
    1.65 +
    1.66 +// NFC powerlevels must match config PDUs.
    1.67 +this.NFC_POWER_LEVEL_UNKNOWN        = -1;
    1.68 +this.NFC_POWER_LEVEL_DISABLED       = 0;
    1.69 +this.NFC_POWER_LEVEL_LOW            = 1;
    1.70 +this.NFC_POWER_LEVEL_ENABLED        = 2;
    1.71 +
    1.72 +this.TOPIC_XPCOM_SHUTDOWN           = "xpcom-shutdown";
    1.73 +
    1.74 +this.NFC_PEER_EVENT_READY = 0x01;
    1.75 +this.NFC_PEER_EVENT_LOST  = 0x02;
    1.76 +
    1.77 +// Allow this file to be imported via Components.utils.import().
    1.78 +this.EXPORTED_SYMBOLS = Object.keys(this);

mercurial