हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
hw_device_t स्ट्रक्चर का रेफ़रंस
#include <
hardware.h
>
हर डिवाइस डेटा स्ट्रक्चर,
hw_device_t
से शुरू होना चाहिए. इसके बाद, मॉड्यूल के हिसाब से सार्वजनिक तरीके और एट्रिब्यूट होने चाहिए.
परिभाषा,
hardware.h
फ़ाइल की पंक्ति
167
पर दी गई है.
इस डिवाइस को बंद करना
परिभाषा,
hardware.h
फ़ाइल की लाइन
200
पर दी गई है
.
इस डिवाइस से जुड़े मॉड्यूल का रेफ़रंस
परिभाषा,
hardware.h
फ़ाइल की लाइन
190
पर दी गई है.
आने वाले समय में इस्तेमाल के लिए रिज़र्व किया गया पैडिंग
परिभाषा,
hardware.h
फ़ाइल की लाइन
196
पर दी गई है.
टैग को HARDWARE_DEVICE_TAG पर शुरू किया जाना चाहिए
परिभाषा,
hardware.h
फ़ाइल की पंक्ति
169
पर दी गई है.
मॉड्यूल के हिसाब से डिवाइस एपीआई का वर्शन. डिवाइस के अलग-अलग वर्शन को मैनेज करने के लिए, डेरिव्ड-मॉड्यूल उपयोगकर्ता इस वैल्यू का इस्तेमाल करता है.
मॉड्यूल के उपयोगकर्ता को module_api_version और डिवाइस वर्शन फ़ील्ड की जांच करनी होती है, ताकि यह पक्का किया जा सके कि उपयोगकर्ता, मॉड्यूल के लागू होने के बारे में जानकारी दे सकता है या नहीं.
एक मॉड्यूल, अलग-अलग वर्शन वाले कई डिवाइसों के साथ काम कर सकता है. यह तब काम आ सकता है, जब किसी डिवाइस के इंटरफ़ेस में ऐसा बदलाव हो जाए जिससे वह पुराने वर्शन के साथ काम न करे. हालांकि, साथ ही, यह ज़रूरी हो कि पुराने वर्शन के साथ भी काम करता रहे. इसका एक उदाहरण Camera 2.0 API है.
इस फ़ील्ड का इस्तेमाल, मॉड्यूल के उपयोगकर्ता करते हैं. HAL इंटरफ़ेस इस फ़ील्ड का इस्तेमाल नहीं करता.
परिभाषा,
hardware.h
फ़ाइल की लाइन
187
पर दी गई है.
इस स्ट्रक्चर का दस्तावेज़, इस फ़ाइल से जनरेट किया गया था:
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, 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_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)"]]