Skip to content

Commit

Permalink
Make methods of BluetoothPeripheralManagerCallback open
Browse files Browse the repository at this point in the history
  • Loading branch information
weliem committed Feb 15, 2022
1 parent dcb0243 commit 22b296b
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ abstract class BluetoothPeripheralManagerCallback {
* successfully.
* @param service The service that has been added
*/
fun onServiceAdded(status: GattStatus, service: BluetoothGattService) {}
open fun onServiceAdded(status: GattStatus, service: BluetoothGattService) {}

/**
* A remote central has requested to read a local characteristic.
Expand All @@ -53,7 +53,7 @@ abstract class BluetoothPeripheralManagerCallback {
* @param bluetoothCentral the central that is doing the request
* @param characteristic the characteristic to be read
*/
fun onCharacteristicRead(bluetoothCentral: BluetoothCentral, characteristic: BluetoothGattCharacteristic) {}
open fun onCharacteristicRead(bluetoothCentral: BluetoothCentral, characteristic: BluetoothGattCharacteristic) {}

/**
* A remote central has requested to write a local characteristic.
Expand All @@ -71,7 +71,7 @@ abstract class BluetoothPeripheralManagerCallback {
* @param value the value the central wants to write
* @return GattStatus.SUCCESS if the value is acceptable, otherwise an appropriate status
*/
fun onCharacteristicWrite(bluetoothCentral: BluetoothCentral, characteristic: BluetoothGattCharacteristic, value: ByteArray): GattStatus {
open fun onCharacteristicWrite(bluetoothCentral: BluetoothCentral, characteristic: BluetoothGattCharacteristic, value: ByteArray): GattStatus {
return GattStatus.SUCCESS
}

Expand All @@ -86,7 +86,7 @@ abstract class BluetoothPeripheralManagerCallback {
* @param bluetoothCentral the central that is doing the request
* @param descriptor the descriptor to be read
*/
fun onDescriptorRead(bluetoothCentral: BluetoothCentral, descriptor: BluetoothGattDescriptor) {}
open fun onDescriptorRead(bluetoothCentral: BluetoothCentral, descriptor: BluetoothGattDescriptor) {}

/**
* A remote central has requested to write a local descriptor.
Expand All @@ -104,7 +104,7 @@ abstract class BluetoothPeripheralManagerCallback {
* @param value the value the central wants to write
* @return GattStatus.SUCCESS if the value is acceptable, otherwise an appropriate status
*/
fun onDescriptorWrite(bluetoothCentral: BluetoothCentral, descriptor: BluetoothGattDescriptor, value: ByteArray): GattStatus {
open fun onDescriptorWrite(bluetoothCentral: BluetoothCentral, descriptor: BluetoothGattDescriptor, value: ByteArray): GattStatus {
return GattStatus.SUCCESS
}

Expand All @@ -114,15 +114,15 @@ abstract class BluetoothPeripheralManagerCallback {
* @param bluetoothCentral the central
* @param characteristic the characteristic
*/
fun onNotifyingEnabled(bluetoothCentral: BluetoothCentral, characteristic: BluetoothGattCharacteristic) {}
open fun onNotifyingEnabled(bluetoothCentral: BluetoothCentral, characteristic: BluetoothGattCharacteristic) {}

/**
* A remote central has disabled notifications or indications for a characteristic
*
* @param bluetoothCentral the central
* @param characteristic the characteristic
*/
fun onNotifyingDisabled(bluetoothCentral: BluetoothCentral, characteristic: BluetoothGattCharacteristic) {}
open fun onNotifyingDisabled(bluetoothCentral: BluetoothCentral, characteristic: BluetoothGattCharacteristic) {}

/**
* A notification has been sent to a central
Expand All @@ -132,39 +132,39 @@ abstract class BluetoothPeripheralManagerCallback {
* @param characteristic the characteristic for which the notification was sent
* @param status the status of the operation
*/
fun onNotificationSent(bluetoothCentral: BluetoothCentral, value: ByteArray, characteristic: BluetoothGattCharacteristic, status: GattStatus) {}
open fun onNotificationSent(bluetoothCentral: BluetoothCentral, value: ByteArray, characteristic: BluetoothGattCharacteristic, status: GattStatus) {}

/**
* A remote central has connected
*
* @param bluetoothCentral the central
*/
fun onCentralConnected(bluetoothCentral: BluetoothCentral) {}
open fun onCentralConnected(bluetoothCentral: BluetoothCentral) {}

/**
* A remote central has disconnected
*
* @param bluetoothCentral the central
*/
fun onCentralDisconnected(bluetoothCentral: BluetoothCentral) {}
open fun onCentralDisconnected(bluetoothCentral: BluetoothCentral) {}

/**
* Advertising has successfully started
*
* @param settingsInEffect the AdvertiseSettings that are currently active
*/
fun onAdvertisingStarted(settingsInEffect: AdvertiseSettings) {}
open fun onAdvertisingStarted(settingsInEffect: AdvertiseSettings) {}

/**
* Advertising has failed
*
* @param advertiseError the error explaining why the advertising failed
*/
fun onAdvertiseFailure(advertiseError: AdvertiseError) {}
open fun onAdvertiseFailure(advertiseError: AdvertiseError) {}

/**
* Advertising has stopped
*
*/
fun onAdvertisingStopped() {}
open fun onAdvertisingStopped() {}
}

0 comments on commit 22b296b

Please sign in to comment.