title: C# Establishing stream from laptop internal bluetooth 4.0 to Bluetooth Low Energy (BLE) peripheral
body: <p>I am trying to write a program that connects to a Bluetooth Low Energy device (BLE), and then read a characteristic either on updates, or on a given interval.</p>
  
  <p>My Peripheral is a Texas instruments CC2540 BLE device.</p>
  
  <p>My starting point was looking at the example program from TI, that has a heart rate monitor:
  <a href="http://processors.wiki.ti.com/index.php/Category:HealthDemo" rel="noreferrer">http://processors.wiki.ti.com/index.php/Category:HealthDemo</a></p>
  
  <p>However, this uses the dongle, and I am tasked at using the internal bluetooth 4.0 modem (going to make it on android later on, but for now, I just use windows).</p>
  
  <p>Now my problem is that the dongle creates a COM port, but the internal modem does not. I still managed to use the 32feet API to scan and succesfully find the CC2540. However, from here I do not know what to do. I've tried calling the connect() method, but it always fails to connect, either by timeout or stating that there is a dead network.</p>
  
  <p>Any ideas why this happens? Am i supposed to do something else than calling my device.connect() ?</p>
  
  <p>Code snippet:</p>
  
  <pre><code>BluetoothClient cli;
  BluetoothDeviceInfo[] peers;
  BluetoothDeviceInfo device;
  BluetoothAddress adr;
  
  //... skipping code that finds the device and assigns the address to it.
  
  if (device.InstalledServices.Length != 0)
  {
       try
       {
            //MessageBox.Show("attempting to connect");
            cli.Connect(device.DeviceAddress, device.InstalledServices[2]);
            //tbDeviceInfo.AppendText("\n\nConnected " + device.Connected);
       }
       catch (Exception ex)
       {                        
            MessageBox.Show(ex.Message);
            // i always get this exception.
       }
  }
  </code></pre>