Report


class Report
kotlin.Any
   ↳ android.hardware.hid.Report

Represents a Human Interface Device (HID) report exchanged between a host and a HID device.

A HID report contains structured data defined by the device's report descriptor. It includes an optional report ID that distinguishes between multiple report formats supported by the same device, along with a read-only binary data payload.

Summary

Public constructors
Report(reportId: Int, data: ByteBuffer)

Creates a new Report instance with a specified report ID and binary data payload.

Constructor for a report that does not use report ID.

Public methods
Boolean
equals(other: Any?)

ByteBuffer

Returns the data provided by the device for the report ID.

Int

Accessor for the report ID.

Int

Public constructors

Report

Report(
    reportId: Int,
    data: ByteBuffer)

Creates a new Report instance with a specified report ID and binary data payload.

To prevent external modification, the provided ByteBuffer is copied into an internal payload buffer.

Parameters
reportId Int: the ID for this report format, or zero if report IDs are not used.
data ByteBuffer: the non-null buffer containing the raw binary report payload.

Report

Report(data: ByteBuffer)

Constructor for a report that does not use report ID.

Parameters
data ByteBuffer: the report data.
This value cannot be null.

Public methods

equals

fun equals(other: Any?): Boolean

getData

fun getData(): ByteBuffer

Returns the data provided by the device for the report ID.

The data format is specified in the device descriptor, provided by HidDevice.getReportDescriptor.

Return
ByteBuffer the ByteBuffer of the raw report data.
This value cannot be null.

getReportId

fun getReportId(): Int

Accessor for the report ID.

Return
Int the report ID or zero if the device does not use report IDs.

hashCode

fun hashCode(): Int