自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
context_hub_module_t 結構體參考資料
#include <
context_hub.h
>
每個硬體模組都必須有名為 HAL_MODULE_INFO_SYM 的資料結構,且此資料結構的欄位必須以
hw_module_t
開頭,後面接著模組專屬資訊。
定義位於檔案
context_hub.h
的第
391
行。
列舉所有可用的中樞。清單會以「list」格式傳回。
-
退貨
-
結果:清單中的 hub 數量或錯誤 (負值)
此方法應在裝置啟動時呼叫。
定義位於檔案
context_hub.h 的第
400
行。
int(* send_message)(uint32_t hub_id, const struct
hub_message_t
*msg)
|
這個結構體的說明文件是由下列檔案產生:
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","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 (世界標準時間)。"],[],[],null,["# Android Hardware Abstraction Layer: context_hub_module_t Struct Reference\n\ncontext_hub_module_t Struct Reference\n=====================================\n\n[Data Fields](#pub-attribs) \ncontext_hub_module_t Struct Reference \n\n`\n#include \u003c\n`[context_hub.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)`\n\u003e\n`\n\n|----------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| struct [hw_module_t](/reference/hal/structhw__module__t) | [common](/reference/hal/structcontext__hub__module__t#a71ea01183b3998cad6a2301a37a42fc7) |\n| ||\n| int(\\* | [get_hubs](/reference/hal/structcontext__hub__module__t#a460328b43bbf62fd021541b547ea05b7) )(struct [context_hub_module_t](/reference/hal/structcontext__hub__module__t) \\*module, const struct [context_hub_t](/reference/hal/structcontext__hub__t) \\*\\*list) |\n| ||\n| int(\\* | [subscribe_messages](/reference/hal/structcontext__hub__module__t#a5a4c5caaa184e7918c86c847dfd507ff) )(uint32_t hub_id, [context_hub_callback](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h) cbk, void \\*cookie) |\n| ||\n| int(\\* | [send_message](/reference/hal/structcontext__hub__module__t#a8ad344fdd7d209b19bff76be0fedca8a) )(uint32_t hub_id, const struct [hub_message_t](/reference/hal/structhub__message__t) \\*msg) |\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[391](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)\nof file\n[context_hub.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)\n.\n\nField Documentation\n-------------------\n\n\n|-----------------------------------------------------------------|\n| struct [hw_module_t](/reference/hal/structhw__module__t) common |\n\n\nDefinition at line\n[392](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)\nof file\n[context_hub.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)\n.\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| int(\\* get_hubs)(struct [context_hub_module_t](/reference/hal/structcontext__hub__module__t) \\*module, const struct [context_hub_t](/reference/hal/structcontext__hub__t) \\*\\*list) |\n\n\nEnumerate all available hubs.The list is returned in \"list\".\n\n\nReturns\n:\n result : number of hubs in list or error (negative)\n\n\nThis method shall be called at device bootup.\n\n\nDefinition at line\n[400](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)\nof file\n[context_hub.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)\n.\n\n|-----------------------------------------------------------------------------------------------------------------|\n| int(\\* send_message)(uint32_t hub_id, const struct [hub_message_t](/reference/hal/structhub__message__t) \\*msg) |\n\n\nSend a message to a hub\n\n\nReturns\n:\n result : 0 if successful, error code otherwise\n\n\nDefinition at line\n[413](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)\nof file\n[context_hub.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)\n.\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| int(\\* subscribe_messages)(uint32_t hub_id, [context_hub_callback](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h) cbk, void \\*cookie) |\n\n\nRegisters a callback for the HAL implementation to communicate with the context hub service.\n\n\nReturns\n:\n result : 0 if successful, error code otherwise\n\n\nDefinition at line\n[407](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)\nof file\n[context_hub.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [context_hub.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/context_hub.h)"]]