title: How to send data over a Bluetooth Low Energy (BLE) link?
body: <p>I am able to discover, connect to bluetooth.</p>
  
  <p>Source Code---</p>
  
  <p><strong>Connect via bluetooth to Remote Device:</strong></p>
  
  <pre><code>//Get the device by its serial number
   bdDevice = mBluetoothAdapter.getRemoteDevice(blackBox);
  
   //for ble connection
   bdDevice.connectGatt(getApplicationContext(), true, mGattCallback);
  </code></pre>
  
  <p><strong>Gatt CallBack for Status:</strong></p>
  
  <pre><code> private BluetoothGattCallback mGattCallback = new BluetoothGattCallback() {
      @Override
      public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
      //Connection established
      if (status == BluetoothGatt.GATT_SUCCESS
          &amp;&amp; newState == BluetoothProfile.STATE_CONNECTED) {
  
          //Discover services
          gatt.discoverServices();
  
      } else if (status == BluetoothGatt.GATT_SUCCESS
          &amp;&amp; newState == BluetoothProfile.STATE_DISCONNECTED) {
  
          //Handle a disconnect event
  
      }
      }
  
      @Override
      public void onServicesDiscovered(BluetoothGatt gatt, int status) {
  
      //Now we can start reading/writing characteristics
  
      }
  };
  </code></pre>
  
  <p>Now I want to send commands to Remote BLE device but don't know how to do that.</p>
  
  <p>Once the command is sent to the BLE device, the BLE device will respond by broadcasting
  data which my application can receive.</p>