Package 

Class Data

  • All Implemented Interfaces:
    android.os.Parcelable

    
    public class Data
     implements Parcelable
                        
    • Constructor Detail

      • Data

        Data()
      • Data

        Data(Array<byte> value)
    • Method Detail

      • opCode

         static Data opCode(byte opCode, byte parameter)
      • getStringValue

        @Nullable() String getStringValue(@IntRange(from = 0) int offset)

        Return the stored value of this characteristic.

        See getValue for details.

        Parameters:
        offset - Offset at which the string value can be found.
      • size

         int size()

        Returns the size of underlying byte array.

      • getByte

        @Nullable() Byte getByte(@IntRange(from = 0) int offset)

        Returns a byte at the given offset from the byte array.

        Parameters:
        offset - Offset at which the byte value can be found.
      • getIntValue

        @Nullable() Integer getIntValue(int formatType, @IntRange(from = 0) int offset)

        Returns an integer value from the byte array.

        The formatType parameter determines how the valueis to be interpreted. For example, setting formatType to FORMAT_UINT16_LE specifies that the first two bytes of thevalue at the given offset are interpreted to generate thereturn value.

        Parameters:
        formatType - The format type used to interpret the value.
        offset - Offset at which the integer value can be found.
      • getLongValue

        @Nullable() Long getLongValue(int formatType, @IntRange(from = 0) int offset)

        Returns a long value from the byte array.

        Only FORMAT_UINT32_LE and FORMAT_SINT32_LE are supported.

        The formatType parameter determines how the valueis to be interpreted. For example, setting formatType to FORMAT_UINT32_LE specifies that the first four bytes of thevalue at the given offset are interpreted to generate thereturn value.

        Parameters:
        formatType - The format type used to interpret the value.
        offset - Offset at which the integer value can be found.
      • getFloatValue

        @Nullable() Float getFloatValue(int formatType, @IntRange(from = 0) int offset)

        Returns an float value from the given byte array.

        Parameters:
        formatType - The format type used to interpret the value.
        offset - Offset at which the float value can be found.
      • getTypeLen

         static int getTypeLen(int formatType)

        Returns the size of a give value type.