-
- All Implemented Interfaces:
-
android.os.Parcelable
public class MutableData extends Data
-
-
Constructor Summary
Constructors Constructor Description MutableData()MutableData(Array<byte> data)
-
Method Summary
Modifier and Type Method Description static MutableDatafrom(@NonNull() BluetoothGattCharacteristic characteristic)static MutableDatafrom(@NonNull() BluetoothGattDescriptor descriptor)booleansetValue(@Nullable() Array<byte> value)Updates the locally stored value of this data. booleansetByte(int value, @IntRange(from = 0) int offset)Updates the byte at offset position. booleansetValue(int value, int formatType, @IntRange(from = 0) int offset)Set the locally stored value of this data. booleansetValue(int mantissa, int exponent, int formatType, @IntRange(from = 0) int offset)Set the locally stored value of this data. booleansetValue(long value, int formatType, @IntRange(from = 0) int offset)Set the locally stored value of this data. booleansetValue(float value, int formatType, @IntRange(from = 0) int offset)Set the locally stored value of this data. -
Methods inherited from class no.nordicsemi.android.ble.data.Data
describeContents, from, from, from, getByte, getFloatValue, getIntValue, getLongValue, getStringValue, getTypeLen, getValue, opCode, opCode, size, toString, writeToParcel -
Methods inherited from class android.os.Parcelable
describeContents, writeToParcel -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MutableData
MutableData()
-
MutableData
MutableData(Array<byte> data)
-
-
Method Detail
-
from
static MutableData from(@NonNull() BluetoothGattCharacteristic characteristic)
-
from
static MutableData from(@NonNull() BluetoothGattDescriptor descriptor)
-
setValue
boolean setValue(@Nullable() Array<byte> value)
Updates the locally stored value of this data.
- Parameters:
value- New value
-
setByte
boolean setByte(int value, @IntRange(from = 0) int offset)
Updates the byte at offset position.
- Parameters:
value- Byte to setoffset- The offset
-
setValue
boolean setValue(int value, int formatType, @IntRange(from = 0) int offset)
Set the locally stored value of this data.
See setValue for details.
- Parameters:
value- New value for this dataformatType- Integer format type used to transform the value parameteroffset- Offset at which the value should be placed
-
setValue
boolean setValue(int mantissa, int exponent, int formatType, @IntRange(from = 0) int offset)
Set the locally stored value of this data.
See setValue for details.
- Parameters:
mantissa- Mantissa for this dataexponent- Exponent value for this dataformatType- Float format type used to transform the value parameteroffset- Offset at which the value should be placed
-
setValue
boolean setValue(long value, int formatType, @IntRange(from = 0) int offset)
Set the locally stored value of this data.
See setValue for details.
- Parameters:
value- New value for this data.formatType- Integer format type used to transform the value parameteroffset- Offset at which the value should be placed
-
setValue
boolean setValue(float value, int formatType, @IntRange(from = 0) int offset)
Set the locally stored value of this data.
See setValue for details.
- Parameters:
value- Float value to be writtenformatType- Float format type used to transform the value parameteroffset- Offset at which the value should be placed
-
-
-
-