title: Chrome : Bluetooth L2CAP protocal is not supported
body: <p>I want to connect my bluetooth remote control using chrome application, but i get folowwing error "Bluetooth L2CAP protocal is not supported"
  I want to connect my bluetooth remote or mobile with chrome app without using windows support.
  Pls help
  regards</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var main = (function() {
    // GATT Device Information Service UUIDs
    var DEVICE_INFO_SERVICE_UUID      = '0000180a-0000-1000-8000-00805f9b34fb';
    var MANUFACTURER_NAME_STRING_UUID = '00002a29-0000-1000-8000-00805f9b34fb';
    var SERIAL_NUMBER_STRING_UUID     = '00002a25-0000-1000-8000-00805f9b34fb';
    var HARDWARE_REVISION_STRING_UUID = '00002a27-0000-1000-8000-00805f9b34fb';
    var FIRMWARE_REVISION_STRING_UUID = '00002a26-0000-1000-8000-00805f9b34fb';
    var SOFTWARE_REVISION_STRING_UUID = '00002a28-0000-1000-8000-00805f9b34fb';
    var PNP_ID_UUID                   = '00002a50-0000-1000-8000-00805f9b34fb';
  
    function DeviceInfoDemo() {
      // A mapping from device addresses to device names for found devices that
      // expose a Battery service.
      this.deviceMap_ = {};
  
      // The currently selected service and its characteristics.
      this.service_ = null;
      this.chrcMap_ = {};
      this.discovering_ = false;
    }
  
    /**
     * Sets up the UI for the given service.
     */
    DeviceInfoDemo.prototype.selectService = function(service) {
      // Hide or show the appropriate elements based on whether or not
      // |serviceId| is undefined.
      UI.getInstance().resetState(!service);
  
      this.service_ = service;
      this.chrcMap_ = {};
  
      if (!service) {
        console.log('No service selected.');
        return;
      }
  
      console.log('GATT service selected: ' + service.instanceId);
  
      // Get the characteristics of the selected service.
      var self = this;
      chrome.bluetoothLowEnergy.getCharacteristics(service.instanceId,
                                                   function (chrcs) {
        if (chrome.runtime.lastError) {
          console.log(chrome.runtime.lastError.message);
          return;
        }
  
        // Make sure that the same service is still selected.
        if (service.instanceId != self.service_.instanceId)
          return;
  
        if (chrcs.length == 0) {
          console.log('Service has no characteristics: ' + service.instanceId);
          return;
        }
  
        chrcs.forEach(function (chrc) {
          var fieldId;
          var valueDisplayFunction = UI.getInstance().setStringValue;
  
          if (chrc.uuid == MANUFACTURER_NAME_STRING_UUID) {
            console.log('Setting Manufacturer Name String Characteristic: ' +
                        chrc.instanceId);
            fieldId = 'manufacturer-name-string';
          } else if (chrc.uuid == SERIAL_NUMBER_STRING_UUID) {
            console.log('Setting Serial Number String Characteristic: ' +
                        chrc.instanceId);
            fieldId = 'serial-number-string';
          } else if (chrc.uuid == HARDWARE_REVISION_STRING_UUID) {
            console.log('Setting Hardware Revision String Characteristic: ' +
                        chrc.instanceId);
            fieldId = 'hardware-revision-string';
          } else if (chrc.uuid == FIRMWARE_REVISION_STRING_UUID) {
            console.log('Setting Firmware Revision String Characteristic: ' +
                        chrc.instanceId);
            fieldId = 'firmware-revision-string';
          } else if (chrc.uuid == SOFTWARE_REVISION_STRING_UUID) {
            console.log('Setting Software Revision String Characteristic: ' +
                        chrc.instanceId);
            fieldId = 'software-revision-string';
          } else if (chrc.uuid == PNP_ID_UUID) {
            console.log('Setting PnP ID Characteristic: ' + chrc.instanceId);
            fieldId = 'pnp-id';
            valueDisplayFunction = UI.getInstance().setPnpIdValue;
          }
  
          if (fieldId === undefined) {
            console.log('Ignoring characteristic "' + chrc.instanceId +
                        '" with UUID ' + chrc.uuid);
            return;
          }
  
          self.chrcMap_[fieldId] = chrc;
  
          // Read the value of the characteristic and store it.
          chrome.bluetoothLowEnergy.readCharacteristicValue(chrc.instanceId,
                                                            function (readChrc) {
            if (chrome.runtime.lastError) {
              console.log(chrome.runtime.lastError.message);
              return;
            }
  
            // Make sure that the same characteristic is still selected.
            if (!self.chrcMap_.hasOwnProperty(fieldId) ||
                self.chrcMap_[fieldId].instanceId != readChrc.instanceId)
              return;
  
            self.chrcMap_[fieldId] = readChrc;
            valueDisplayFunction(fieldId, readChrc.value);
          });
        });
      });
    };
  
    DeviceInfoDemo.prototype.updateDiscoveryToggleState = function(discovering) {
      if (this.discovering_ !== discovering) {
        this.discovering_ = discovering;
        UI.getInstance().setDiscoveryToggleState(this.discovering_);
      }
    };
  
    DeviceInfoDemo.prototype.init = function() {
      // Set up the UI to look like no device was initially selected.
      this.selectService(null);
  
      // Store the |this| to be used by API callbacks below.
      var self = this;
  
      // Request information about the local Bluetooth adapter to be displayed in
      // the UI.
      var updateAdapterState = function(adapterState) {
        UI.getInstance().setAdapterState(adapterState.address, adapterState.name);
        self.updateDiscoveryToggleState(adapterState.discovering);
      };
  
      chrome.bluetooth.getAdapterState(function (adapterState) {
        if (chrome.runtime.lastError)
          console.log(chrome.runtime.lastError.message);
  
        self.updateDiscoveryToggleState(adapterState.discovering);
        updateAdapterState(adapterState);
      });
  
      chrome.bluetooth.onAdapterStateChanged.addListener(updateAdapterState);
  
      // Helper functions used below.
      var isKnownDevice = function(deviceAddress) {
        return self.deviceMap_.hasOwnProperty(deviceAddress);
      };
  
      var storeDevice = function(deviceAddress, device) {
        var resetUI = false;
        if (device == null) {
          delete self.deviceMap_[deviceAddress];
          resetUI = true;
        } else {
          self.deviceMap_[deviceAddress] =
              (device.name ? device.name : device.address);
        }
  
        // Update the selector UI with the new device list.
        UI.getInstance().updateDeviceSelector(self.deviceMap_, resetUI);
      };
  
      // Initialize the device map.
   chrome.bluetooth.getDevices(function(devices) {
   for (var i = 0; i &lt; devices.length; i++) {
      //console.log(devices[i].address);
   //console.log(devices[i].name);
   }
   
  //-------------------------------------------------
  var device_names = {};
  var updateDeviceName = function(device) {
    device_names[device.address] = device.name;
   if(device.name == 'Advanced Touch REMOTE')
   {
    console.log(device.address);
    var uuid = '1124';
    var onConnectedCallback = function() {
    if (chrome.runtime.lastError) {
     console.log("Connection failed: " + chrome.runtime.lastError.message);
     console.log("Socket: " + JSON.stringify(device));
    } else {
     console.log('Connected to Remote');
     console.log("Socket: " + JSON.stringify(device));
  }
  
  };
   chrome.bluetoothSocket.create(function(createInfo) {
   chrome.bluetoothSocket.connect(createInfo.socketId,
      device.address, uuid, onConnectedCallback);
  }); 
   }
  
   console.log(device.address);
   console.log(device.name);
   storeDevice(device.address, device);
  };
  var removeDeviceName = function(device) {
    delete device_names[device.address];
  }
  
  // Add listeners to receive newly found devices and updates
  // to the previously known devices.
  chrome.bluetooth.onDeviceAdded.addListener(updateDeviceName);
  chrome.bluetooth.onDeviceChanged.addListener(updateDeviceName);
  chrome.bluetooth.onDeviceRemoved.addListener(removeDeviceName);
  
  // With the listeners in place, get the list of devices found in
  // previous discovery sessions, or any currently active ones,
  // along with paired devices.
  chrome.bluetooth.getDevices(function(devices) {
    for (var i = 0; i &lt; devices.length; i++) {
      updateDeviceName(devices[i]);
    }
  });
  
  
  // Now begin the discovery process.
  chrome.bluetooth.startDiscovery(function() {
    // Stop discovery after 30 seconds.
    setTimeout(function() {
      chrome.bluetooth.stopDiscovery(function() {});
    }, 25000);
  });
  //-------------------------------------------------
  });
  
    };
  
    return {
      DeviceInfoDemo: DeviceInfoDemo
    };
  })();
  
  document.addEventListener('DOMContentLoaded', function() {
    var demo = new main.DeviceInfoDemo();
    demo.init();
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    margin: 0;
    overflow: hidden;
  }
  
  #header {
    padding: 10px 15px 5px 15px;
    background: #fafafa;
    box-shadow: 0 0 5px #858585;
  }
  
  #header img {
    width: 50px;
  }
  
  #header h1 {
    font-family: 'DejaVu Sans Light', Verdana, sans-serif;
    font-weight: normal;
    vertical-align: top;
    display: inline-block;
    margin: 8px;
    white-space: nowrap;
    overflow: hidden;
  }
  
  #adapter-status {
    float: right;
    margin-top: 2px;
  }
  
  #adapter-address {
    font-weight: bold;
  }
  
  ul {
    padding-left: 0;
    margin: inherit;
  }
  
  ul li {
    list-style-type: none;
  }
  
  #device-selection-div {
    margin-top: 5px;
  }
  
  #device-selector {
    background: transparent;
    border: 1px solid #aaa;
    color: #454545;
    font-style: italic;
  }
  
  #discovery-toggle-button {
    background: transparent;
    border: 1px solid #aaa;
    color: #454545;
    font-style: italic;
  }
  
  hr {
    border: 0;
    height: 0;
    border-top: 1px solid rgba(0,0,0,0.12);
    border-bottom: 1px solid rgba(255,255,255,0.3);
  }
  
  #no-devices-error {
    font-size: 10pt;
    text-align: center;
    padding-top: 15%;
  }
  
  #info-div {
    height: 245px;
    box-sizing: border-box;
    margin: 10px;
    padding: 10px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.65);
    overflow-y: scroll;
    overflow-x: hidden;
    word-break: break-all;
    color: #333;
  }
  
  .device-info-field {
    margin-bottom: 6px;
    font-weight: bold;
  }
  
  div.device-info-field span {
    font-style: italic;
    font-weight: normal;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Bluetooth LE Device Information Service Demo&lt;/title&gt;
    &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
    &lt;script src="ui.js"&gt;&lt;/script&gt;
    &lt;script src="main.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="header"&gt;
      &lt;img src="bluetooth.png" alt="bluetooth icon"&gt;
      &lt;h1&gt;BLE Device Information Service&lt;/h1&gt;
      &lt;div id="adapter-status"&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;span id="adapter-name"&gt;&lt;/span&gt;&lt;/li&gt;
          &lt;li&gt;&lt;span id="adapter-address"&gt;&lt;/span&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;hr&gt;
      &lt;div id="device-selection-div"&gt;
        Select device with Device Information Service:
        &lt;select id="device-selector"&gt;
          &lt;option id="placeholder" value="" disabled selected&gt;
            No connected devices
          &lt;/option&gt;
        &lt;/select&gt;
        &lt;button type="button" id="discovery-toggle-button"&gt;
          start discovery
        &lt;/button&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div id="no-devices-error"&gt;
      No device with "Device Information Service" selected.
    &lt;/div&gt;
    &lt;div id="info-div"&gt;
      &lt;div class="device-info-field"&gt;
        Manufacturer Name: &lt;span id="manufacturer-name-string"&gt;-&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="device-info-field"&gt;
        Serial Number: &lt;span id="serial-number-string"&gt;-&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="device-info-field"&gt;
        Hardware Revision: &lt;span id="hardware-revision-string"&gt;-&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="device-info-field"&gt;
        Firmware Revision: &lt;span id="firmware-revision-string"&gt;-&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="device-info-field"&gt;
        Software Revision: &lt;span id="software-revision-string"&gt;-&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="device-info-field"&gt;
        Vendor ID Source: &lt;span id="vendor-id-source"&gt;-&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="device-info-field"&gt;
        Vendor ID: &lt;span id="vendor-id"&gt;-&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="device-info-field"&gt;
        Product ID: &lt;span id="product-id"&gt;-&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="device-info-field"&gt;
        Product Version: &lt;span id="product-version"&gt;-&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>regards</p>