Package 

Class MutableData

  • All Implemented Interfaces:
    android.os.Parcelable

    
    public class MutableData
    extends Data
                        
    • Method Summary

      Modifier and Type Method Description
      static MutableData from(@NonNull() BluetoothGattCharacteristic characteristic)
      static MutableData from(@NonNull() BluetoothGattDescriptor descriptor)
      boolean setValue(@Nullable() Array<byte> value) Updates the locally stored value of this data.
      boolean setByte(int value, @IntRange(from = 0) int offset) Updates the byte at offset position.
      boolean setValue(int value, int formatType, @IntRange(from = 0) int offset) Set the locally stored value of this data.
      boolean setValue(int mantissa, int exponent, int formatType, @IntRange(from = 0) int offset) Set the locally stored value of this data.
      boolean setValue(long value, int formatType, @IntRange(from = 0) int offset) Set the locally stored value of this data.
      boolean setValue(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

      • 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 set
        offset - 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 data
        formatType - Integer format type used to transform the value parameter
        offset - 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 data
        exponent - Exponent value for this data
        formatType - Float format type used to transform the value parameter
        offset - 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 parameter
        offset - 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 written
        formatType - Float format type used to transform the value parameter
        offset - Offset at which the value should be placed