title: Why does onCharacteristicRead read different characteristic that is set to readCharacteristic
body: <p>I am new with Java and OOP in general. But, I am reading one characteristic using notify and then multiple characteristics within the callback using read.</p>
  <p>I was wondering, why I can only get values from a single characteristic (additional to the notified characteristic) while using readCharacteristic(<em>my characteristic</em>). Bluetooth gatt callback states the following:</p>
  <blockquote>
  <p>public boolean readCharacteristic</p>
  </blockquote>
  <p>(BluetoothGattCharacteristic characteristic)
  Reads the requested characteristic from the associated remote device.</p>
  <p>This is an asynchronous operation. The result of the read operation is reported by the BluetoothGattCallback#onCharacteristicRead callback.&quot;</p>
  <p>I call readCharacteristic sequentially for each characteristic and wait always before requesting the next one that the onCrahacteristicRead callback is excecuted. But inside onCrahacteristicRead the characteristic that ends up to be read is every time the same on (not necessarily the one I requested on readCharacteristic).</p>
  <p>I read somewhere that I should make Priority Queue for characteristics. Why is this? Why is there an requested characteristic input in the readCharacteristic in the first place and how does the gatt reference state this.</p>
  <p>Thanks</p>
  <p><em>Edit</em></p>
  <p>After further testing, I now believe this happened because for some reason</p>
  <blockquote>
  <p>onCharacteristicRead()</p>
  </blockquote>
  <p>callback got stuck after reading the first requested (read) characteristic but the notifying characteristic kept on firing, causing the</p>
  <p>onCharacteristicChanged callback to restart -&gt; the first characteristic gets read again and gets stuck -&gt; new notification and so on.</p>
  <p>I disabled the notification during the onCharacteristicChanged callback, which leads to the program getting stuck after the first read to</p>
  <blockquote>
  <p>onCharacteristicRead()</p>
  </blockquote>
  <p>So the program never leaves <strong>onCharacteristicRead()</strong> callback. I tried with the priority queue, which ended up reading both (read) characteristics once, but again gets stuck and never leaves the <strong>onCharacteristicRead</strong> callback. Frustrating. Any ideas?</p>