public class SimpleRequest extends Request
callback or can't
have timeout for any other reason. This class defines the await() method.handler, requestHandler| Modifier and Type | Method and Description |
|---|---|
void |
await()
Synchronously waits until the request is done.
|
before, createBond, done, enqueue, fail, invalid, newConnectionPriorityRequest, newDisableBatteryLevelNotificationsRequest, newDisableIndicationsRequest, newDisableNotificationsRequest, newEnableBatteryLevelNotificationsRequest, newEnableIndicationsRequest, newEnableNotificationsRequest, newMtuRequest, newReadBatteryLevelRequest, newReadPhyRequest, newReadRequest, newReadRequest, newReadRssiRequest, newRefreshCacheRequest, newSetPreferredPhyRequest, newSleepRequest, newWaitForIndicationRequest, newWaitForNotificationRequest, newWriteRequest, newWriteRequest, newWriteRequest, newWriteRequest, newWriteRequest, newWriteRequest, removeBond, setHandlerpublic final void await()
throws RequestFailedException,
DeviceDisconnectedException,
BluetoothDisabledException,
InvalidRequestException
Callbacks set using Request.before(BeforeCallback), Request.done(SuccessCallback) and
Request.fail(FailCallback) will be ignored.
This method may not be called from the main (UI) thread.
RequestFailedException - thrown when the BLE request finished with status other
than BluetoothGatt.GATT_SUCCESS.java.lang.IllegalStateException - thrown when you try to call this method from the main
(UI) thread.DeviceDisconnectedException - thrown when the device disconnected before the request
was completed.BluetoothDisabledException - thrown when the Bluetooth adapter has been disabled.InvalidRequestException - thrown when the request was called before the device was
connected at least once (unknown device).