Skip to content

Commit

Permalink
feat(java): notify golang that we get new conn
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Froment <sfroment42@gmail.com>
  • Loading branch information
sfroment committed Nov 9, 2018
1 parent e62865f commit c2536b9
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -264,7 +264,17 @@ public void onCharacteristicWriteRequest(BluetoothDevice device, int requestId,
} else if (charID.equals(CLOSER_UUID)) {
// TODO
} else if (charID.equals(IS_READY_UUID)) {
// dispatch sema
new Thread(new Runnable() {
@Override
public void run() {
try {
bDevice.waitReady.await();
Core.addToPeerStore(bDevice.peerID, bDevice.ma);
} catch (InterruptedException e) {
Log.e(TAG, "error waiting/writing new peer " + e.getMessage());
}
}
}).start();
Log.e(TAG, "OTHER DEVICE IS RDY");
mBluetoothGattServer.sendResponse(device, requestId, GATT_SUCCESS, offset, null);
} else {
Expand Down

0 comments on commit c2536b9

Please sign in to comment.