Начиная с 27 марта 2025 г. мы рекомендуем использовать android-latest-release
вместо aosp-main
для создания и участия в AOSP. Дополнительные сведения см. в разделе Изменения в AOSP .
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Ссылка на структуру vibrator_device
#include < vibrator.h >
Определение в строке 37 файла vibrator.h .
Выключить вибратор
Отмените ранее запущенную вибрацию, если таковая имеется.
- Возврат
- 0 в случае успеха, в противном случае отрицательный код ошибки
Определение в строке 63 файла vibrator.h .
int(* vibrator_on)(struct vibrator_device *vibradev, unsigned int timeout_ms) |
Включи вибратор
Эту функцию следует вызывать только после истечения или отмены предыдущего тайм-аута (через vibrator_off() ).
- Параметры
timeout_ms | количество миллисекунд вибрации |
- Возврат
- 0 в случае успеха, в противном случае отрицательный код ошибки
Определение в строке 55 файла vibrator.h .
Документация для этой структуры была создана из следующего файла:
- Аппаратное обеспечение/libhardware/include/hardware/ vibrator.h
Контент и образцы кода на этой странице предоставлены по лицензиям. Java и OpenJDK – это зарегистрированные товарные знаки корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-29 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-29 UTC."],[],[],null,["# Android Hardware Abstraction Layer: vibrator_device Struct Reference\n\nvibrator_device Struct Reference\n================================\n\n[Data Fields](#pub-attribs) \nvibrator_device Struct Reference \n\n`\n#include \u003c\n`[vibrator.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vibrator.h)`\n\u003e\n`\n\n|----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| struct [hw_device_t](/reference/hal/structhw__device__t) | [common](/reference/hal/structvibrator__device#a86a0ca82dd3f02023e259b8b5e155dbe) |\n| ||\n| int(\\* | [vibrator_on](/reference/hal/structvibrator__device#a6c44b936e041cbff5e2207f86d755148) )(struct [vibrator_device](/reference/hal/structvibrator__device) \\*vibradev, unsigned int timeout_ms) |\n| ||\n| int(\\* | [vibrator_off](/reference/hal/structvibrator__device#a050f76d66b2ea6e7149b145dbad123eb) )(struct [vibrator_device](/reference/hal/structvibrator__device) \\*vibradev) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nDefinition at line\n[37](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vibrator.h)\nof file\n[vibrator.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vibrator.h)\n.\n\nField Documentation\n-------------------\n\n\n|-----------------------------------------------------------------|\n| struct [hw_device_t](/reference/hal/structhw__device__t) common |\n\n\nCommon methods of the vibrator device. This\n*must*\nbe the first member of\n[vibrator_device](/reference/hal/structvibrator__device)\nas users of this structure will cast a\n[hw_device_t](/reference/hal/structhw__device__t)\nto\n[vibrator_device](/reference/hal/structvibrator__device)\npointer in contexts where it's known the\n[hw_device_t](/reference/hal/structhw__device__t)\nreferences a\n[vibrator_device](/reference/hal/structvibrator__device)\n.\n\n\nDefinition at line\n[44](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vibrator.h)\nof file\n[vibrator.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vibrator.h)\n.\n\n|--------------------------------------------------------------------------------------------------|\n| int(\\* vibrator_off)(struct [vibrator_device](/reference/hal/structvibrator__device) \\*vibradev) |\n\n\nTurn off vibrator\n\n\nCancel a previously-started vibration, if any.\n\n\nReturns\n:\n 0 in case of success, negative errno code else\n\n\nDefinition at line\n[63](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vibrator.h)\nof file\n[vibrator.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vibrator.h)\n.\n\n|--------------------------------------------------------------------------------------------------------------------------|\n| int(\\* vibrator_on)(struct [vibrator_device](/reference/hal/structvibrator__device) \\*vibradev, unsigned int timeout_ms) |\n\n\nTurn on vibrator\n\n\nThis function must only be called after the previous timeout has expired or was canceled (through\n[vibrator_off()](/reference/hal/structvibrator__device#a050f76d66b2ea6e7149b145dbad123eb)\n).\n\n\nParameters\n:\n\n |------------|-----------------------------------|\n | timeout_ms | number of milliseconds to vibrate |\n\n\nReturns\n:\n 0 in case of success, negative errno code else\n\n\nDefinition at line\n[55](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vibrator.h)\nof file\n[vibrator.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vibrator.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [vibrator.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/vibrator.h)"]]