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.
Struktura sensors_module_t
#include <
sensors.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
1149
pliku
sensors.h
.
Wymień wszystkie dostępne czujniki. Lista jest zwracana w elementach „list”.
-
Zwroty
-
liczba czujników na liście
Definicja w wierszu
1156
pliku
sensors.h
.
int(* set_operation_mode)(unsigned int mode)
|
Umieść moduł w określonym trybie. Zdefiniowano te tryby:
0 – normalna praca. Domyślny stan modułu. 1 – tryb sprzężenia zwrotnego. W tym trybie usługa czujnika wstrzykuje dane do obsługiwanych czujników.
-
Zwroty
-
0 w przypadku powodzenia -EINVAL, jeśli żądany tryb nie jest obsługiwany -EPERM, jeśli operacja jest niedozwolona
Definicja w wierszu
1169
pliku
sensors.h
.
Dokumentacja tego typu danych została wygenerowana z tego pliku:
-
hardware/libhardware/include/hardware/
sensors.h
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: sensors_module_t Struct Reference\n\nsensors_module_t Struct Reference\n=================================\n\n[Data Fields](#pub-attribs) \nsensors_module_t Struct Reference \n\n`\n#include \u003c\n`[sensors.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/sensors.h)`\n\u003e\n`\n\n|----------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| struct [hw_module_t](/reference/hal/structhw__module__t) | [common](/reference/hal/structsensors__module__t#a71ea01183b3998cad6a2301a37a42fc7) |\n| ||\n| int(\\* | [get_sensors_list](/reference/hal/structsensors__module__t#aa9546f8477ee959716aa78e849a2c51b) )(struct [sensors_module_t](/reference/hal/structsensors__module__t) \\*module, struct [sensor_t](/reference/hal/structsensor__t) const \\*\\*list) |\n| ||\n| int(\\* | [set_operation_mode](/reference/hal/structsensors__module__t#a495cc50ac138223c6f32006810c1a8ca) )(unsigned int mode) |\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[1149](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/sensors.h)\nof file\n[sensors.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/sensors.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[1150](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/sensors.h)\nof file\n[sensors.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/sensors.h)\n.\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| int(\\* get_sensors_list)(struct [sensors_module_t](/reference/hal/structsensors__module__t) \\*module, struct [sensor_t](/reference/hal/structsensor__t) const \\*\\*list) |\n\n\nEnumerate all available sensors. The list is returned in \"list\".\n\n\nReturns\n:\n number of sensors in the list\n\n\nDefinition at line\n[1156](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/sensors.h)\nof file\n[sensors.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/sensors.h)\n.\n\n|-----------------------------------------------|\n| int(\\* set_operation_mode)(unsigned int mode) |\n\n\nPlace the module in a specific mode. The following modes are defined\n\n\n0 - Normal operation. Default state of the module. 1 - Loopback mode. Data is injected for the supported sensors by the sensor service in this mode.\n\n\nReturns\n:\n 0 on success -EINVAL if requested mode is not supported -EPERM if operation is not allowed\n\n\nDefinition at line\n[1169](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/sensors.h)\nof file\n[sensors.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/sensors.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [sensors.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/sensors.h)"]]