2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
hw_module_t 구조체 참조
#include <
hardware.h
>
모든 하드웨어 모듈에는 HAL_MODULE_INFO_SYM이라는 데이터 구조가 있어야 하며 이 데이터 구조의 필드는
hw_module_t
로 시작하고 그 뒤에 모듈별 정보가 나와야 합니다.
hardware.h
파일의
86
번 째 줄에 정의되어 있습니다.
version_major/version_minor 정의는 임시 소스 코드 호환성을 위해 여기에 제공됩니다. 다음 버전에서는 삭제됩니다. 모든 클라이언트를 새 버전 형식으로 변환해야 합니다. HAL 모듈 인터페이스의 API 버전입니다. 이는
hw_module_t
,
hw_module_methods_t
,
hw_device_t
구조체 및 정의를 버전 관리하기 위한 것입니다.
HAL 인터페이스가 이 필드를 소유합니다. 모듈 사용자/구현은 버전 정보에 이 값을 사용해서는 안 됩니다.
현재 유일하게 유효한 값은 0입니다.
hardware.h
파일의
129
줄에 정의되어 있습니다.
uint16_t module_api_version
|
구현된 모듈의 API 버전입니다. 모듈 인터페이스가 변경되면 모듈 소유자가 버전을 업데이트해야 합니다.
gralloc 및 audio와 같은 파생된 모듈은 이 필드를 소유하고 관리합니다. 모듈 사용자는 버전 필드를 해석하여 제공된 모듈 구현과 상호 운용할지 결정해야 합니다. 예를 들어 SurfaceFlinger는 gralloc-module API의 여러 버전을 관리하는 방법을 알고 있는지 확인해야 하며, AudioFlinger는 audio-module API에 대해 동일한 작업을 수행하는 방법을 알아야 합니다.
모듈 API 버전에는 주 버전과 부 버전이 포함되어야 합니다. 예를 들어 버전 1.0은 0x0100으로 나타낼 수 있습니다. 이 형식은 버전 0x0100~0x01ff가 모두 API와 호환된다는 것을 의미합니다.
향후 libhardware는 지원되는 최소/최대 버전을 인수로 사용하고 제공된 범위를 벗어난 버전의 모듈을 거부할 수 있는 hw_get_module_version() (또는 이에 상응하는) 함수를 노출할 예정입니다.
hardware.h
FILE의
111
라인에 정의가 있습니다.
태그를 HARDWARE_MODULE_TAG로 초기화해야 합니다.
hardware.h
파일의
88
줄에 정의되어 있습니다.
이 구조체에 관한 문서는 다음 파일에서 생성되었습니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Android Hardware Abstraction Layer: hw_module_t Struct Reference\n\nhw_module_t Struct Reference\n============================\n\n[Data Fields](#pub-attribs) \nhw_module_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__module__t#a1c50fcd1195659821729f52af8f3bb7d) |\n| ||\n| uint16_t | [module_api_version](/reference/hal/structhw__module__t#a5b80425dcc298281d75edaa9a8083ccb) |\n| ||\n| uint16_t | [hal_api_version](/reference/hal/structhw__module__t#ab37ccc85f1197981a04116244354874f) |\n| ||\n| const char \\* | [id](/reference/hal/structhw__module__t#aeffa2f0815ce90fecbda9aac199143db) |\n| ||\n| const char \\* | [name](/reference/hal/structhw__module__t#a8f8f80d37794cde9472343e4487ba3eb) |\n| ||\n| const char \\* | [author](/reference/hal/structhw__module__t#adc89bc26ec139d32e904360eeef3cca8) |\n| ||\n| struct [hw_module_methods_t](/reference/hal/structhw__module__methods__t) \\* | [methods](/reference/hal/structhw__module__t#ae5b7afff8f18102ffd7577cd95e0ad83) |\n| ||\n| void \\* | [dso](/reference/hal/structhw__module__t#a8586652230f2639b4ee04adaf37e8348) |\n| ||\n| uint32_t | [reserved](/reference/hal/structhw__module__t#a41d9ba252fcb951e005e4b8c3bfc6803) \\[32-7\\] |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nEvery hardware module must have a data structure named HAL_MODULE_INFO_SYM and the fields of this data structure must begin with\n[hw_module_t](/reference/hal/structhw__module__t)\nfollowed by module specific information.\n\n\nDefinition at line\n[86](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| const char\\* author |\n\n\nAuthor/owner/implementor of the module\n\n\nDefinition at line\n[139](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| void\\* dso |\n\n\nmodule's dso\n\n\nDefinition at line\n[145](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| uint16_t hal_api_version |\n\n\nversion_major/version_minor defines are supplied here for temporary source code compatibility. They will be removed in the next version. ALL clients must convert to the new version format. The API version of the HAL module interface. This is meant to version the\n[hw_module_t](/reference/hal/structhw__module__t)\n,\n[hw_module_methods_t](/reference/hal/structhw__module__methods__t)\n, and\n[hw_device_t](/reference/hal/structhw__device__t)\nstructures and definitions.\n\n\nThe HAL interface owns this field. Module users/implementations must NOT rely on this value for version information.\n\n\nPresently, 0 is the only valid value.\n\n\nDefinition at line\n[129](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| const char\\* id |\n\n\nIdentifier of module\n\n\nDefinition at line\n[133](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_methods_t](/reference/hal/structhw__module__methods__t) \\* methods |\n\n\nModules methods\n\n\nDefinition at line\n[142](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| uint16_t module_api_version |\n\n\nThe API version of the implemented module. The module owner is responsible for updating the version when a module interface has changed.\n\n\nThe derived modules such as gralloc and audio own and manage this field. The module user must interpret the version field to decide whether or not to inter-operate with the supplied module implementation. For example, SurfaceFlinger is responsible for making sure that it knows how to manage different versions of the gralloc-module API, and AudioFlinger must know how to do the same for audio-module API.\n\n\nThe module API version should include a major and a minor component. For example, version 1.0 could be represented as 0x0100. This format implies that versions 0x0100-0x01ff are all API-compatible.\n\n\nIn the future, libhardware will expose a hw_get_module_version() (or equivalent) function that will take minimum/maximum supported versions as arguments and would be able to reject modules with versions outside of the supplied range.\n\n\nDefinition at line\n[111](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| const char\\* name |\n\n\nName of this module\n\n\nDefinition at line\n[136](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\\[32-7\\] |\n\n\npadding to 128 bytes, reserved for future use\n\n\nDefinition at line\n[151](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_MODULE_TAG\n\n\nDefinition at line\n[88](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)"]]