title: How to fix 'getting no response from write characteristic in bluetooth le'?
body: <p>I'm learning bluetooth le on Android and have run into the problem of not being able to get a response from a write characteristic. The hardware that I'm using is an HM-10 which has a service and characteristic which I'm able to write to - something that I'm sure is about the code i've written. </p>
  
  <p>I have followed the article on android developer for setting up bluetooth gatt. The callback contains onDescriptorRead/Write, onCharacteristicRead/Write, onServicesDiscovered, onCharacteristicChanged including the broadcast receiver for updating information from service to the activity. I've also tried to plug in the HM-10 to my computer and am using RealTerm to send data from my phone app. I confirm that the data that i'm sending is getting through. But when sending the data from the computer through the HM-10 i get no information back from my phone app. (on the onCharacteristicChanged, or onCharacteristicRead) Before doing the sending I am modifying the notification setting on the characteristic to enabled. </p>
  
  <p>The descriptor is CCCD (0x2902)
  The characteristic is a custom one that according to documentation handles READ, WRITE, NOTIFY. To be frank I do not know how to check this in code. </p>
  
  <p>The command to send to characteristic.</p>
  
  <pre><code>if (characteristic.equals("0000ffe1-0000-1000-8000-00805f9b34fb")) {
    characteristic.setValue("AT+CSQ?");
  }
  bluetoothGatt.writeCharacteristic(characteristic);
  
  </code></pre>
  
  <p>The callback for write</p>
  
  <pre><code>@Override
  public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
  if (status == BluetoothGatt.GATT_SUCCESS) {
  Log.w(TAG, "successfully wrote characteristic");
  
  broadcastWrite(ACTION_WRITE_AVAILABLE, characteristic);
  }
  }
  </code></pre>
  
  <p>The callback for read characteristic</p>
  
  <pre><code>@Override
  // Result of a characteristic read operation
  public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
  if (status == BluetoothGatt.GATT_SUCCESS) {
  broadcastUpdate(ACTION_DATA_AVAILABLE, characteristic);
  
  }
  }
  </code></pre>
  
  <p>the callback for characteristic changed</p>
  
  <pre><code>@Override
  public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
  Log.w(TAG, "successfully received new characteristic change");
  BroadcastUpdate(ACTION_DATA_AVAILABLE, characteristic);
  }
  </code></pre>
  
  <p>The command for enabling notification on characteristic</p>
  
  <pre><code>descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
   bluetoothGatt.writeDescriptor(descriptor);
  </code></pre>
  
  <p>I'm expecting that the bluetooth gatt is set up to handle characteristic changes. What actually happens is a big black hole with no responses.</p>