[Bluetooth] Use Object.defineProperties instead of multiple Object.defineProperty...
authorJesus Sanchez-Palencia <jesus.sanchez-palencia.fernandez.fil@intel.com>
Thu, 22 Aug 2013 21:08:47 +0000 (18:08 -0300)
committerJesus Sanchez-Palencia <jesus.sanchez-palencia.fernandez.fil@intel.com>
Thu, 22 Aug 2013 21:08:47 +0000 (18:08 -0300)
bluetooth/bluetooth_api.js

index 8c35f18..22b18ed 100644 (file)
@@ -194,128 +194,110 @@ exports.getDefaultAdapter = function() {
 
 exports.deviceMajor = {};
 var deviceMajor = {
-  "MISC": 0x00,
-  "COMPUTER": 0x01,
-  "PHONE": 0x02,
-  "NETWORK": 0x03,
-  "AUDIO_VIDEO": 0x04,
-  "PERIPHERAL": 0x05,
-  "IMAGING": 0x06,
-  "WEARABLE": 0x07,
-  "TOY": 0x08,
-  "HEALTH": 0x09,
-  "UNCATEGORIZED": 0x1F
-};
-for (var key in deviceMajor) {
-  Object.defineProperty(exports.deviceMajor, key, {
-    configurable: false,
-    writable: false,
-    value: deviceMajor[key]
-  });
-};
+  "MISC": { value: 0x00, configurable: false, writable: false },
+  "COMPUTER": { value: 0x01, configurable: false, writable: false },
+  "PHONE": { value: 0x02, configurable: false, writable: false },
+  "NETWORK": { value: 0x03, configurable: false, writable: false },
+  "AUDIO_VIDEO": { value: 0x04, configurable: false, writable: false },
+  "PERIPHERAL": { value: 0x05, configurable: false, writable: false },
+  "IMAGING": { value: 0x06, configurable: false, writable: false },
+  "WEARABLE": { value: 0x07, configurable: false, writable: false },
+  "TOY": { value: 0x08, configurable: false, writable: false },
+  "HEALTH": { value: 0x09, configurable: false, writable: false },
+  "UNCATEGORIZED": { value: 0x1F, configurable: false, writable: false }
+};
+Object.defineProperties(exports.deviceMajor, deviceMajor);
 
 exports.deviceMinor = {};
 var deviceMinor = {
-  "COMPUTER_UNCATEGORIZED": 0x00,
-  "COMPUTER_DESKTOP": 0x01,
-  "COMPUTER_SERVER": 0x02,
-  "COMPUTER_LAPTOP": 0x03,
-  "COMPUTER_HANDHELD_PC_OR_PDA": 0x04,
-  "COMPUTER_PALM_PC_OR_PDA": 0x05,
-  "COMPUTER_WEARABLE": 0x06,
-  "PHONE_UNCATEGORIZED": 0x00,
-  "PHONE_CELLULAR": 0x01,
-  "PHONE_CORDLESS": 0x02,
-  "PHONE_SMARTPHONE": 0x03,
-  "PHONE_MODEM_OR_GATEWAY": 0x04,
-  "PHONE_ISDN": 0x05,
-  "AV_UNRECOGNIZED": 0x00,
-  "AV_WEARABLE_HEADSET": 0x01,
-  "AV_HANDSFREE": 0x02,
-  "AV_MICROPHONE": 0x04,
-  "AV_LOUDSPEAKER": 0x05,
-  "AV_HEADPHONES": 0x06,
-  "AV_PORTABLE_AUDIO": 0x07,
-  "AV_CAR_AUDIO": 0x08,
-  "AV_SETTOP_BOX": 0x09,
-  "AV_HIFI": 0x0a,
-  "AV_VCR": 0x0b,
-  "AV_VIDEO_CAMERA": 0x0c,
-  "AV_CAMCORDER": 0x0d,
-  "AV_MONITOR": 0x0e,
-  "AV_DISPLAY_AND_LOUDSPEAKER": 0x0f,
-  "AV_VIDEO_CONFERENCING": 0x10,
-  "AV_GAMING_TOY": 0x12,
-  "PERIPHERAL_UNCATEGORIZED": 0,
-  "PERIPHERAL_KEYBOARD": 0x10,
-  "PERIPHERAL_POINTING_DEVICE": 0x20,
-  "PERIPHERAL_KEYBOARD_AND_POINTING_DEVICE": 0x30,
-  "PERIPHERAL_JOYSTICK": 0x01,
-  "PERIPHERAL_GAMEPAD": 0x02,
-  "PERIPHERAL_REMOTE_CONTROL": 0x03,
-  "PERIPHERAL_SENSING_DEVICE": 0x04,
-  "PERIPHERAL_DEGITIZER_TABLET": 0x05,
-  "PERIPHERAL_CARD_READER": 0x06,
-  "PERIPHERAL_DIGITAL_PEN": 0x07,
-  "PERIPHERAL_HANDHELD_SCANNER": 0x08,
-  "PERIPHERAL_HANDHELD_INPUT_DEVICE": 0x09,
-  "IMAGING_UNCATEGORIZED": 0x00,
-  "IMAGING_DISPLAY": 0x04,
-  "IMAGING_CAMERA": 0x08,
-  "IMAGING_SCANNER": 0x10,
-  "IMAGING_PRINTER": 0x20,
-  "WEARABLE_WRITST_WATCH": 0x01,
-  "WEARABLE_PAGER": 0x02,
-  "WEARABLE_JACKET": 0x03,
-  "WEARABLE_HELMET": 0x04,
-  "WEARABLE_GLASSES": 0x05,
-  "TOY_ROBOT": 0x01,
-  "TOY_VEHICLE": 0x02,
-  "TOY_DOLL": 0x03,
-  "TOY_CONTROLLER": 0x04,
-  "TOY_GAME": 0x05,
-  "HEALTH_UNDEFINED": 0x00,
-  "HEALTH_BLOOD_PRESSURE_MONITOR": 0x01,
-  "HEALTH_THERMOMETER": 0x02,
-  "HEALTH_WEIGHING_SCALE": 0x03,
-  "HEALTH_GLUCOSE_METER": 0x04,
-  "HEALTH_PULSE_OXIMETER": 0x05,
-  "HEALTH_PULSE_RATE_MONITOR": 0x06,
-  "HEALTH_DATA_DISPLAY": 0x07,
-  "HEALTH_STEP_COUNTER": 0x08,
-  "HEALTH_BODY_COMPOSITION_ANALYZER": 0x09,
-  "HEALTH_PEAK_FLOW_MONITOR": 0x0a,
-  "HEALTH_MEDICATION_MONITOR": 0x0b,
-  "HEALTH_KNEE_PROSTHESIS": 0x0c,
-  "HEALTH_ANKLE_PROSTHESIS": 0x0d
-};
-for (var key in deviceMinor) {
-  Object.defineProperty(exports.deviceMinor, key, {
-    configurable: false,
-    writable: false,
-    value: deviceMinor[key]
-  });
-};
+  "COMPUTER_UNCATEGORIZED": { value: 0x00, configurable: false, writable: false },
+  "COMPUTER_DESKTOP": { value: 0x01, configurable: false, writable: false },
+  "COMPUTER_SERVER": { value: 0x02, configurable: false, writable: false },
+  "COMPUTER_LAPTOP": { value: 0x03, configurable: false, writable: false },
+  "COMPUTER_HANDHELD_PC_OR_PDA": { value: 0x04, configurable: false, writable: false },
+  "COMPUTER_PALM_PC_OR_PDA": { value: 0x05, configurable: false, writable: false },
+  "COMPUTER_WEARABLE": { value: 0x06, configurable: false, writable: false },
+  "PHONE_UNCATEGORIZED": { value: 0x00, configurable: false, writable: false },
+  "PHONE_CELLULAR": { value: 0x01, configurable: false, writable: false },
+  "PHONE_CORDLESS": { value: 0x02, configurable: false, writable: false },
+  "PHONE_SMARTPHONE": { value: 0x03, configurable: false, writable: false },
+  "PHONE_MODEM_OR_GATEWAY": { value: 0x04, configurable: false, writable: false },
+  "PHONE_ISDN": { value: 0x05, configurable: false, writable: false },
+  "AV_UNRECOGNIZED": { value: 0x00, configurable: false, writable: false },
+  "AV_WEARABLE_HEADSET": { value: 0x01, configurable: false, writable: false },
+  "AV_HANDSFREE": { value: 0x02, configurable: false, writable: false },
+  "AV_MICROPHONE": { value: 0x04, configurable: false, writable: false },
+  "AV_LOUDSPEAKER": { value: 0x05, configurable: false, writable: false },
+  "AV_HEADPHONES": { value: 0x06, configurable: false, writable: false },
+  "AV_PORTABLE_AUDIO": { value: 0x07, configurable: false, writable: false },
+  "AV_CAR_AUDIO": { value: 0x08, configurable: false, writable: false },
+  "AV_SETTOP_BOX": { value: 0x09, configurable: false, writable: false },
+  "AV_HIFI": { value: 0x0a, configurable: false, writable: false },
+  "AV_VCR": { value: 0x0b, configurable: false, writable: false },
+  "AV_VIDEO_CAMERA": { value: 0x0c, configurable: false, writable: false },
+  "AV_CAMCORDER": { value: 0x0d, configurable: false, writable: false },
+  "AV_MONITOR": { value: 0x0e, configurable: false, writable: false },
+  "AV_DISPLAY_AND_LOUDSPEAKER": { value: 0x0f, configurable: false, writable: false },
+  "AV_VIDEO_CONFERENCING": { value: 0x10, configurable: false, writable: false },
+  "AV_GAMING_TOY": { value: 0x12, configurable: false, writable: false },
+  "PERIPHERAL_UNCATEGORIZED": { value: 0, configurable: false, writable: false },
+  "PERIPHERAL_KEYBOARD": { value: 0x10, configurable: false, writable: false },
+  "PERIPHERAL_POINTING_DEVICE": { value: 0x20, configurable: false, writable: false },
+  "PERIPHERAL_KEYBOARD_AND_POINTING_DEVICE": { value: 0x30, configurable: false, writable: false },
+  "PERIPHERAL_JOYSTICK": { value: 0x01, configurable: false, writable: false },
+  "PERIPHERAL_GAMEPAD": { value: 0x02, configurable: false, writable: false },
+  "PERIPHERAL_REMOTE_CONTROL": { value: 0x03, configurable: false, writable: false },
+  "PERIPHERAL_SENSING_DEVICE": { value: 0x04, configurable: false, writable: false },
+  "PERIPHERAL_DEGITIZER_TABLET": { value: 0x05, configurable: false, writable: false },
+  "PERIPHERAL_CARD_READER": { value: 0x06, configurable: false, writable: false },
+  "PERIPHERAL_DIGITAL_PEN": { value: 0x07, configurable: false, writable: false },
+  "PERIPHERAL_HANDHELD_SCANNER": { value: 0x08, configurable: false, writable: false },
+  "PERIPHERAL_HANDHELD_INPUT_DEVICE": { value: 0x09, configurable: false, writable: false },
+  "IMAGING_UNCATEGORIZED": { value: 0x00, configurable: false, writable: false },
+  "IMAGING_DISPLAY": { value: 0x04, configurable: false, writable: false },
+  "IMAGING_CAMERA": { value: 0x08, configurable: false, writable: false },
+  "IMAGING_SCANNER": { value: 0x10, configurable: false, writable: false },
+  "IMAGING_PRINTER": { value: 0x20, configurable: false, writable: false },
+  "WEARABLE_WRITST_WATCH": { value: 0x01, configurable: false, writable: false },
+  "WEARABLE_PAGER": { value: 0x02, configurable: false, writable: false },
+  "WEARABLE_JACKET": { value: 0x03, configurable: false, writable: false },
+  "WEARABLE_HELMET": { value: 0x04, configurable: false, writable: false },
+  "WEARABLE_GLASSES": { value: 0x05, configurable: false, writable: false },
+  "TOY_ROBOT": { value: 0x01, configurable: false, writable: false },
+  "TOY_VEHICLE": { value: 0x02, configurable: false, writable: false },
+  "TOY_DOLL": { value: 0x03, configurable: false, writable: false },
+  "TOY_CONTROLLER": { value: 0x04, configurable: false, writable: false },
+  "TOY_GAME": { value: 0x05, configurable: false, writable: false },
+  "HEALTH_UNDEFINED": { value: 0x00, configurable: false, writable: false },
+  "HEALTH_BLOOD_PRESSURE_MONITOR": { value: 0x01, configurable: false, writable: false },
+  "HEALTH_THERMOMETER": { value: 0x02, configurable: false, writable: false },
+  "HEALTH_WEIGHING_SCALE": { value: 0x03, configurable: false, writable: false },
+  "HEALTH_GLUCOSE_METER": { value: 0x04, configurable: false, writable: false },
+  "HEALTH_PULSE_OXIMETER": { value: 0x05, configurable: false, writable: false },
+  "HEALTH_PULSE_RATE_MONITOR": { value: 0x06, configurable: false, writable: false },
+  "HEALTH_DATA_DISPLAY": { value: 0x07, configurable: false, writable: false },
+  "HEALTH_STEP_COUNTER": { value: 0x08, configurable: false, writable: false },
+  "HEALTH_BODY_COMPOSITION_ANALYZER": { value: 0x09, configurable: false, writable: false },
+  "HEALTH_PEAK_FLOW_MONITOR": { value: 0x0a, configurable: false, writable: false },
+  "HEALTH_MEDICATION_MONITOR": { value: 0x0b, configurable: false, writable: false },
+  "HEALTH_KNEE_PROSTHESIS": { value: 0x0c, configurable: false, writable: false },
+  "HEALTH_ANKLE_PROSTHESIS": { value: 0x0d, configurable: false, writable: false }
+};
+Object.defineProperties(exports.deviceMinor, deviceMinor);
 
 exports.deviceService = {};
 var deviceService = {
-  "LIMITED_DISCOVERABILITY": 0x0001,
-  "POSITIONING": 0x0008,
-  "NETWORKING": 0x0010,
-  "RENDERING": 0x0020,
-  "CAPTURING": 0x0040,
-  "OBJECT_TRANSFER": 0x0080,
-  "AUDIO": 0x0100,
-  "TELEPHONY": 0x0200,
-  "INFORMATION": 0x0400
-};
-for (var key in deviceService) {
-  Object.defineProperty(exports.deviceService, key, {
-    configurable: false,
-    writable: false,
-    value: deviceService[key]
-  });
-};
+  "LIMITED_DISCOVERABILITY": { value: 0x0001, configurable: false, writable: false },
+  "POSITIONING": { value: 0x0008, configurable: false, writable: false },
+  "NETWORKING": { value: 0x0010, configurable: false, writable: false },
+  "RENDERING": { value: 0x0020, configurable: false, writable: false },
+  "CAPTURING": { value: 0x0040, configurable: false, writable: false },
+  "OBJECT_TRANSFER": { value: 0x0080, configurable: false, writable: false },
+  "AUDIO": { value: 0x0100, configurable: false, writable: false },
+  "TELEPHONY": { value: 0x0200, configurable: false, writable: false },
+  "INFORMATION": { value: 0x0400, configurable: false, writable: false }
+};
+Object.defineProperties(exports.deviceService, deviceService);
 
 function _addConstProperty(obj, propertyKey, propertyValue) {
   Object.defineProperty(obj, propertyKey, {