Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
hw_device_t Struct Reference
#include <
hardware.h
>
Every device data structure must begin with
hw_device_t
followed by module specific public methods and attributes.
Definition at line
167
of file
hardware.h
.
reference to the module this device belongs to
Definition at line
190
of file
hardware.h
.
padding reserved for future use
Definition at line
196
of file
hardware.h
.
tag must be initialized to HARDWARE_DEVICE_TAG
Definition at line
169
of file
hardware.h
.
Version of the module-specific device API. This value is used by the derived-module user to manage different device implementations.
The module user is responsible for checking the module_api_version and device version fields to ensure that the user is capable of communicating with the specific module implementation.
One module can support multiple devices with different versions. This can be useful when a device interface changes in an incompatible way but it is still necessary to support older implementations at the same time. One such example is the Camera 2.0 API.
This field is interpreted by the module user and is ignored by the HAL interface itself.
Definition at line
187
of file
hardware.h
.
The documentation for this struct was generated from the following file:
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2019-10-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2019-10-02 UTC."],[],[],null,["# Android Hardware Abstraction Layer: hw_device_t Struct Reference\n\nhw_device_t Struct Reference\n============================\n\n[Data Fields](#pub-attribs) \nhw_device_t Struct Reference \n\n`\n#include \u003c\n`[hardware.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)`\n\u003e\n`\n\n|-------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| uint32_t | [tag](/reference/hal/structhw__device__t#a1c50fcd1195659821729f52af8f3bb7d) |\n| ||\n| uint32_t | [version](/reference/hal/structhw__device__t#acd99bb05ca015e7d74448acb1deba7ca) |\n| ||\n| struct [hw_module_t](/reference/hal/structhw__module__t) \\* | [module](/reference/hal/structhw__device__t#a0566f4bbaaf67d861130a279b9fe6e53) |\n| ||\n| uint32_t | [reserved](/reference/hal/structhw__device__t#a364fd3526fe030c97b47b0e71b31e199) \\[12\\] |\n| ||\n| int(\\* | [close](/reference/hal/structhw__device__t#a5fb45cbb01844ab66f2a7fef565928c8) )(struct [hw_device_t](/reference/hal/structhw__device__t) \\*device) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nEvery device data structure must begin with\n[hw_device_t](/reference/hal/structhw__device__t)\nfollowed by module specific public methods and attributes.\n\n\nDefinition at line\n[167](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\nof file\n[hardware.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\n.\n\nField Documentation\n-------------------\n\n\n|----------------------------------------------------------------------------------|\n| int(\\* close)(struct [hw_device_t](/reference/hal/structhw__device__t) \\*device) |\n\n\nClose this device\n\n\nDefinition at line\n[200](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\nof file\n[hardware.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\n.\n\n|--------------------------------------------------------------------|\n| struct [hw_module_t](/reference/hal/structhw__module__t) \\* module |\n\n\nreference to the module this device belongs to\n\n\nDefinition at line\n[190](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\nof file\n[hardware.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\n.\n\n|-------------------------|\n| uint32_t reserved\\[12\\] |\n\n\npadding reserved for future use\n\n\nDefinition at line\n[196](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\nof file\n[hardware.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\n.\n\n|--------------|\n| uint32_t tag |\n\n\ntag must be initialized to HARDWARE_DEVICE_TAG\n\n\nDefinition at line\n[169](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\nof file\n[hardware.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\n.\n\n|------------------|\n| uint32_t version |\n\n\nVersion of the module-specific device API. This value is used by the derived-module user to manage different device implementations.\n\n\nThe module user is responsible for checking the module_api_version and device version fields to ensure that the user is capable of communicating with the specific module implementation.\n\n\nOne module can support multiple devices with different versions. This can be useful when a device interface changes in an incompatible way but it is still necessary to support older implementations at the same time. One such example is the Camera 2.0 API.\n\n\nThis field is interpreted by the module user and is ignored by the HAL interface itself.\n\n\nDefinition at line\n[187](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\nof file\n[hardware.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [hardware.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hardware.h)"]]