Skip to content

Commit

Permalink
Opening API (#55) (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
philips77 committed Feb 1, 2019
1 parent a27fed3 commit 3db87a8
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions ble/src/main/java/no/nordicsemi/android/ble/BleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ public void close() {
* @return The request.
*/
@NonNull
protected final Request createBond() {
protected Request createBond() {
return Request.createBond().setManager(this);
}

Expand Down Expand Up @@ -1001,7 +1001,7 @@ private boolean internalCreateBond() {
* @return The request.
*/
@NonNull
protected final Request removeBond() {
protected Request removeBond() {
return Request.removeBond().setManager(this);
}

Expand Down Expand Up @@ -1081,7 +1081,7 @@ private boolean ensureServiceChangedEnabled() {
*/
@MainThread
@NonNull
protected final ValueChangedCallback setNotificationCallback(@Nullable final BluetoothGattCharacteristic characteristic) {
protected ValueChangedCallback setNotificationCallback(@Nullable final BluetoothGattCharacteristic characteristic) {
ValueChangedCallback callback = mNotificationCallbacks.get(characteristic);
if (callback == null) {
callback = new ValueChangedCallback();
Expand All @@ -1106,7 +1106,7 @@ protected final ValueChangedCallback setNotificationCallback(@Nullable final Blu
* @return The callback.
*/
@NonNull
protected final ValueChangedCallback setIndicationCallback(@Nullable final BluetoothGattCharacteristic characteristic) {
protected ValueChangedCallback setIndicationCallback(@Nullable final BluetoothGattCharacteristic characteristic) {
return setNotificationCallback(characteristic);
}

Expand All @@ -1125,7 +1125,7 @@ protected final ValueChangedCallback setIndicationCallback(@Nullable final Bluet
* @return The callback.
*/
@NonNull
protected final WaitForValueChangedRequest waitForNotification(@NonNull final BluetoothGattCharacteristic characteristic) {
protected WaitForValueChangedRequest waitForNotification(@NonNull final BluetoothGattCharacteristic characteristic) {
return Request.newWaitForNotificationRequest(characteristic).setManager(this);
}

Expand All @@ -1144,7 +1144,7 @@ protected final WaitForValueChangedRequest waitForNotification(@NonNull final Bl
* @return The callback.
*/
@NonNull
protected final WaitForValueChangedRequest waitForIndication(@NonNull final BluetoothGattCharacteristic characteristic) {
protected WaitForValueChangedRequest waitForIndication(@NonNull final BluetoothGattCharacteristic characteristic) {
return Request.newWaitForIndicationRequest(characteristic).setManager(this);
}

Expand All @@ -1160,7 +1160,7 @@ protected final WaitForValueChangedRequest waitForIndication(@NonNull final Blue
* @return The request.
*/
@NonNull
protected final WriteRequest enableNotifications(
protected WriteRequest enableNotifications(
@Nullable final BluetoothGattCharacteristic characteristic) {
return Request.newEnableNotificationsRequest(characteristic).setManager(this);
}
Expand Down Expand Up @@ -1196,7 +1196,7 @@ private boolean internalEnableNotifications(final BluetoothGattCharacteristic ch
* @return The request.
*/
@NonNull
protected final WriteRequest disableNotifications(@Nullable final BluetoothGattCharacteristic characteristic) {
protected WriteRequest disableNotifications(@Nullable final BluetoothGattCharacteristic characteristic) {
return Request.newDisableNotificationsRequest(characteristic).setManager(this);
}

Expand Down Expand Up @@ -1231,7 +1231,7 @@ private boolean internalDisableNotifications(final BluetoothGattCharacteristic c
* @return The request.
*/
@NonNull
protected final WriteRequest enableIndications(@Nullable final BluetoothGattCharacteristic characteristic) {
protected WriteRequest enableIndications(@Nullable final BluetoothGattCharacteristic characteristic) {
return Request.newEnableIndicationsRequest(characteristic).setManager(this);
}

Expand Down Expand Up @@ -1266,7 +1266,7 @@ private boolean internalEnableIndications(final BluetoothGattCharacteristic char
* @return The request.
*/
@NonNull
protected final WriteRequest disableIndications(@Nullable final BluetoothGattCharacteristic characteristic) {
protected WriteRequest disableIndications(@Nullable final BluetoothGattCharacteristic characteristic) {
return Request.newDisableIndicationsRequest(characteristic).setManager(this);
}

Expand Down Expand Up @@ -1311,7 +1311,7 @@ private static BluetoothGattDescriptor getCccd(@Nullable final BluetoothGattChar
* @return The request.
*/
@NonNull
protected final ReadRequest readCharacteristic(@Nullable final BluetoothGattCharacteristic characteristic) {
protected ReadRequest readCharacteristic(@Nullable final BluetoothGattCharacteristic characteristic) {
return Request.newReadRequest(characteristic).setManager(this);
}

Expand Down Expand Up @@ -1348,7 +1348,7 @@ private boolean internalReadCharacteristic(final BluetoothGattCharacteristic cha
* @return The request.
*/
@NonNull
protected final WriteRequest writeCharacteristic(@Nullable final BluetoothGattCharacteristic characteristic,
protected WriteRequest writeCharacteristic(@Nullable final BluetoothGattCharacteristic characteristic,
@Nullable final Data data) {
return Request.newWriteRequest(characteristic, data != null ? data.getValue() : null)
.setManager(this);
Expand All @@ -1371,7 +1371,7 @@ protected final WriteRequest writeCharacteristic(@Nullable final BluetoothGattCh
* @return The request.
*/
@NonNull
protected final WriteRequest writeCharacteristic(@Nullable final BluetoothGattCharacteristic characteristic,
protected WriteRequest writeCharacteristic(@Nullable final BluetoothGattCharacteristic characteristic,
@Nullable final byte[] data) {
return Request.newWriteRequest(characteristic, data).setManager(this);
}
Expand All @@ -1396,7 +1396,7 @@ protected final WriteRequest writeCharacteristic(@Nullable final BluetoothGattCh
* @return The request.
*/
@NonNull
protected final WriteRequest writeCharacteristic(@Nullable final BluetoothGattCharacteristic characteristic,
protected WriteRequest writeCharacteristic(@Nullable final BluetoothGattCharacteristic characteristic,
@Nullable final byte[] data, final int offset, final int length) {
return Request.newWriteRequest(characteristic, data, offset, length).setManager(this);
}
Expand Down Expand Up @@ -1431,7 +1431,7 @@ private boolean internalWriteCharacteristic(final BluetoothGattCharacteristic ch
* @return The request.
*/
@NonNull
protected final ReadRequest readDescriptor(@Nullable final BluetoothGattDescriptor descriptor) {
protected ReadRequest readDescriptor(@Nullable final BluetoothGattDescriptor descriptor) {
return Request.newReadRequest(descriptor).setManager(this);
}

Expand Down Expand Up @@ -1463,7 +1463,7 @@ private boolean internalReadDescriptor(final BluetoothGattDescriptor descriptor)
* @return The request.
*/
@NonNull
protected final WriteRequest writeDescriptor(@Nullable final BluetoothGattDescriptor descriptor,
protected WriteRequest writeDescriptor(@Nullable final BluetoothGattDescriptor descriptor,
@Nullable final Data data) {
return Request.newWriteRequest(descriptor, data != null ? data.getValue() : null)
.setManager(this);
Expand All @@ -1486,7 +1486,7 @@ protected final WriteRequest writeDescriptor(@Nullable final BluetoothGattDescri
* @return The request.
*/
@NonNull
protected final WriteRequest writeDescriptor(@Nullable final BluetoothGattDescriptor descriptor,
protected WriteRequest writeDescriptor(@Nullable final BluetoothGattDescriptor descriptor,
@Nullable final byte[] data) {
return Request.newWriteRequest(descriptor, data).setManager(this);
}
Expand All @@ -1510,7 +1510,7 @@ protected final WriteRequest writeDescriptor(@Nullable final BluetoothGattDescri
* @return The request.
*/
@NonNull
protected final WriteRequest writeDescriptor(@Nullable final BluetoothGattDescriptor descriptor,
protected WriteRequest writeDescriptor(@Nullable final BluetoothGattDescriptor descriptor,
@Nullable final byte[] data, final int offset,
final int length) {
return Request.newWriteRequest(descriptor, data, offset, length).setManager(this);
Expand All @@ -1535,7 +1535,7 @@ private boolean internalWriteDescriptor(final BluetoothGattDescriptor descriptor
* @return The request.
*/
@NonNull
protected final RequestQueue beginAtomicRequestQueue() {
protected RequestQueue beginAtomicRequestQueue() {
return new RequestQueue().setManager(this);
}

Expand Down Expand Up @@ -1576,7 +1576,7 @@ protected final RequestQueue beginAtomicRequestQueue() {
* @return The request.
*/
@NonNull
protected final ReliableWriteRequest beginReliableWrite() {
protected ReliableWriteRequest beginReliableWrite() {
return Request.newReliableWriteRequest().setManager(this);
}

Expand Down Expand Up @@ -1770,7 +1770,7 @@ private boolean internalWriteDescriptorWorkaround(final BluetoothGattDescriptor
*
* @return The request.
*/
protected final MtuRequest requestMtu(@IntRange(from = 23, to = 517) final int mtu) {
protected MtuRequest requestMtu(@IntRange(from = 23, to = 517) final int mtu) {
return Request.newMtuRequest(mtu).setManager(this);
}

Expand All @@ -1787,7 +1787,7 @@ protected final MtuRequest requestMtu(@IntRange(from = 23, to = 517) final int m
* @return the current MTU value. Default to 23.
*/
@IntRange(from = 23, to = 517)
protected final int getMtu() {
protected int getMtu() {
return mMtu;
}

Expand All @@ -1799,7 +1799,7 @@ protected final int getMtu() {
*
* @param mtu the MTU value set by the peripheral.
*/
protected final void overrideMtu(@IntRange(from = 23, to = 517) final int mtu) {
protected void overrideMtu(@IntRange(from = 23, to = 517) final int mtu) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mMtu = mtu;
}
Expand Down Expand Up @@ -1843,7 +1843,7 @@ private boolean internalRequestMtu(@IntRange(from = 23, to = 517) final int mtu)
* @return The request.
*/
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
protected final ConnectionPriorityRequest requestConnectionPriority(
protected ConnectionPriorityRequest requestConnectionPriority(
@ConnectionPriority final int priority) {
return Request.newConnectionPriorityRequest(priority).setManager(this);
}
Expand Down Expand Up @@ -1898,7 +1898,7 @@ private boolean internalRequestConnectionPriority(@ConnectionPriority final int
* {@link PhyRequest#PHY_OPTION_S2} or {@link PhyRequest#PHY_OPTION_S8}.
* @return The request.
*/
protected final PhyRequest setPreferredPhy(@PhyMask final int txPhy, @PhyMask final int rxPhy,
protected PhyRequest setPreferredPhy(@PhyMask final int txPhy, @PhyMask final int rxPhy,
@PhyOption final int phyOptions) {
return Request.newSetPreferredPhyRequest(txPhy, rxPhy, phyOptions).setManager(this);
}
Expand Down Expand Up @@ -1931,7 +1931,7 @@ private boolean internalSetPreferredPhy(@PhyMask final int txPhy, @PhyMask final
*
* @return The request.
*/
protected final PhyRequest readPhy() {
protected PhyRequest readPhy() {
return Request.newReadPhyRequest().setManager(this);
}

Expand All @@ -1956,7 +1956,7 @@ private boolean internalReadPhy() {
*
* @return The request.
*/
protected final ReadRssiRequest readRssi() {
protected ReadRssiRequest readRssi() {
return Request.newReadRssiRequest().setManager(this);
}

Expand Down Expand Up @@ -1989,7 +1989,7 @@ private boolean internalReadRssi() {
* @return The request.
*/
@SuppressWarnings("JavadocReference")
protected final Request refreshDeviceCache() {
protected Request refreshDeviceCache() {
return Request.newRefreshCacheRequest().setManager(this);
}

Expand Down Expand Up @@ -2029,7 +2029,7 @@ private boolean internalRefreshDeviceCache() {
* @param delay the delay in milliseconds.
* @return The request.
*/
protected final SleepRequest sleep(@IntRange(from = 0) final long delay) {
protected SleepRequest sleep(@IntRange(from = 0) final long delay) {
return Request.newSleepRequest(delay).setManager(this);
}

Expand All @@ -2054,7 +2054,7 @@ protected final void enqueue(@NonNull final Request request) {
/**
* Cancels all the enqueued operations. The one currently executed will be finished.
*/
protected final void clearQueue() {
protected void clearQueue() {
final BleManagerGattCallback callback = mGattCallback;
if (callback != null) {
callback.cancelQueue();
Expand Down

0 comments on commit 3db87a8

Please sign in to comment.