37 lines
1.3 KiB
Java
37 lines
1.3 KiB
Java
package com.afunx.ble.blelitelib.operation;
|
|
|
|
import android.bluetooth.BluetoothGatt;
|
|
import android.bluetooth.BluetoothGattDescriptor;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class BleWriteDescriptorOperation extends BleOperationAbs {
|
|
private final BluetoothGatt mBluetoothGatt;
|
|
private final BluetoothGattDescriptor mDescriptor;
|
|
private final byte[] mMsg;
|
|
|
|
private BleWriteDescriptorOperation(BluetoothGatt bluetoothGatt, BluetoothGattDescriptor bluetoothGattDescriptor, byte[] bArr) {
|
|
this.mBluetoothGatt = bluetoothGatt;
|
|
this.mDescriptor = bluetoothGattDescriptor;
|
|
this.mMsg = bArr;
|
|
}
|
|
|
|
public static BleWriteDescriptorOperation createInstance(BluetoothGatt bluetoothGatt, BluetoothGattDescriptor bluetoothGattDescriptor, byte[] bArr) {
|
|
return new BleWriteDescriptorOperation(bluetoothGatt, bluetoothGattDescriptor, bArr);
|
|
}
|
|
|
|
@Override // com.afunx.ble.blelitelib.operation.BleOperationAbs
|
|
protected void clearConcurrentOperation() {
|
|
}
|
|
|
|
@Override // com.afunx.ble.blelitelib.operation.BleOperation
|
|
public int getOperatcionCode() {
|
|
return 7;
|
|
}
|
|
|
|
@Override // com.afunx.ble.blelitelib.operation.BleOperation, java.lang.Runnable
|
|
public void run() {
|
|
this.mDescriptor.setValue(this.mMsg);
|
|
this.mBluetoothGatt.writeDescriptor(this.mDescriptor);
|
|
}
|
|
}
|