michael@0: /* Copyright 2012 Mozilla Foundation and Mozilla contributors michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: michael@0: /* Copyright © 2013, Deutsche Telekom, Inc. */ michael@0: michael@0: // Set to true to debug all NFC layers michael@0: this.DEBUG_ALL = false; michael@0: michael@0: // Set individually to debug specific layers michael@0: this.DEBUG_WORKER = false || DEBUG_ALL; michael@0: this.DEBUG_CONTENT_HELPER = false || DEBUG_ALL; michael@0: this.DEBUG_NFC = false || DEBUG_ALL; michael@0: michael@0: // Current version michael@0: this.NFC_MAJOR_VERSION = 1; michael@0: this.NFC_MINOR_VERSION = 7; michael@0: michael@0: this.NFC_REQUEST_CONFIG = 0; michael@0: this.NFC_REQUEST_CONNECT = 1; michael@0: this.NFC_REQUEST_CLOSE = 2; michael@0: this.NFC_REQUEST_GET_DETAILS = 3; michael@0: this.NFC_REQUEST_READ_NDEF = 4; michael@0: this.NFC_REQUEST_WRITE_NDEF = 5; michael@0: this.NFC_REQUEST_MAKE_NDEF_READ_ONLY = 6; michael@0: michael@0: this.NFC_RESPONSE_GENERAL = 1000; michael@0: this.NFC_RESPONSE_CONFIG = 1001; michael@0: this.NFC_RESPONSE_READ_NDEF_DETAILS = 1002; michael@0: this.NFC_RESPONSE_READ_NDEF = 1003; michael@0: michael@0: this.NFC_NOTIFICATION_INITIALIZED = 2000; michael@0: this.NFC_NOTIFICATION_TECH_DISCOVERED = 2001; michael@0: this.NFC_NOTIFICATION_TECH_LOST = 2002; michael@0: michael@0: this.NFC_TECHS = { michael@0: 0:"NDEF", michael@0: 1:"NDEF_WRITEABLE", michael@0: 2:"NDEF_FORMATABLE", michael@0: 3:"P2P", michael@0: 4:"NFC_A", michael@0: 5:"NFC_B", michael@0: 6:"NFC_F", michael@0: 7:"NFC_V", michael@0: 8:"NFC_ISO_DEP" michael@0: }; michael@0: michael@0: // TODO: Bug 933595. Fill-in all error codes for Gonk/nfcd protocol michael@0: this.GECKO_NFC_ERROR_SUCCESS = 0; michael@0: this.GECKO_NFC_ERROR_GENERIC_FAILURE = 1; michael@0: michael@0: // NFC powerlevels must match config PDUs. michael@0: this.NFC_POWER_LEVEL_UNKNOWN = -1; michael@0: this.NFC_POWER_LEVEL_DISABLED = 0; michael@0: this.NFC_POWER_LEVEL_LOW = 1; michael@0: this.NFC_POWER_LEVEL_ENABLED = 2; michael@0: michael@0: this.TOPIC_XPCOM_SHUTDOWN = "xpcom-shutdown"; michael@0: michael@0: this.NFC_PEER_EVENT_READY = 0x01; michael@0: this.NFC_PEER_EVENT_LOST = 0x02; michael@0: michael@0: // Allow this file to be imported via Components.utils.import(). michael@0: this.EXPORTED_SYMBOLS = Object.keys(this);