A partir del 27 de marzo de 2025, te recomendamos que uses android-latest-release
en lugar de aosp-main
para compilar y contribuir a AOSP. Para obtener más información, consulta Cambios en AOSP.
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Referencia de la estructura vibrator_device
#include <
vibrator.h
>
Definición en la línea
37
del archivo
vibrator.h
.
Cómo desactivar el vibrador
Cancela una vibración iniciada anteriormente, si la hubiera.
-
Muestra
-
0 en caso de éxito, código de error negativo de errno de lo contrario
Definición en la línea
63
del archivo
vibrator.h
.
int(* vibrator_on)(struct
vibrator_device
*vibradev, unsigned int timeout_ms)
|
Cómo activar el vibrador
Solo se debe llamar a esta función después de que venza o se cancele el tiempo de espera anterior (a través de
vibrator_off()
).
-
Parámetros
-
timeout_ms
|
cantidad de milisegundos para vibrar
|
-
Muestra
-
0 en caso de éxito, código de error negativo de errno de lo contrario
Definición en la línea
55
del archivo
vibrator.h
.
La documentación de esta struct se generó a partir del siguiente archivo:
El contenido y las muestras de código que aparecen en esta página están sujetas a las licencias que se describen en la Licencia de Contenido. Java y OpenJDK son marcas registradas de Oracle o sus afiliados.
Última actualización: 2025-07-26 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-07-26 (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)"]]