Od 27 marca 2025 r. zalecamy używanie android-latest-release
zamiast aosp-main
do kompilowania i wspołtworzenia AOSP. Więcej informacji znajdziesz w artykule o zmianach w AOSP.
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Informacje o strukturze context_hub_module_t
#include <
context_hub.h
>
Każdy moduł sprzętowy musi mieć strukturę danych o nazwie HAL_MODULE_INFO_SYM, a pola tej struktury danych muszą zaczynać się od
hw_module_t
po czym następuje informacja o danym module.
Definicja w wierszu
391
pliku
context_hub.h
.
Wymień wszystkie dostępne koncentratory.Lista jest zwracana w elemencie „list”.
-
Zwroty
-
wynik : liczba hubów na liście lub błąd (ujemny)
Ta metoda jest wywoływana podczas uruchamiania urządzenia.
Definicja w wierszu
400
pliku
context_hub.h
.
int(* send_message)(uint32_t hub_id, const struct
hub_message_t
*msg)
|
Wysyłanie wiadomości do huba
-
Zwroty
-
result : 0, jeśli udało się, w przeciwnym razie kod błędu
Definicja w wierszu
413
pliku
context_hub.h
.
Rejestruje wywołanie zwrotne dla implementacji HAL, aby umożliwić komunikację z usługą Context Hub.
-
Zwroty
-
result : 0, jeśli udało się, w przeciwnym razie kod błędu
Definicja w wierszu
407
pliku
context_hub.h
.
Dokumentacja tego typu danych została wygenerowana z tego pliku:
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-27 UTC."],[],[],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)"]]