Accumulate Bluetooth MIDI packets until ready
Bluetooth MIDI uses a packet encoder to encode and send packets. When a caller calls send too quickly, the Bluetooth characteristic is not ready and BluetoothPacketEncoder waits for a packet that never arrives. With this change, if the sender sends a couple packets before the connection is ready, they will be added to a queue. Once the Bluetooth characteristic is avaliable, this queue will be sent with the next packet. This way, we can remove this infinite loop. Bug: 64598842 Test: Added code to Phil's MidiBtlePairing app to send data to a bluetooth MIDI device repeatedly after pairing. Verified that packets don't get sent correctly before the change and that packets do get sent correctly with this change. Change-Id: Ib261d871752e83a2150980cd50acb56ee318b034
Loading
Please register or sign in to comment