À partir du 27 mars 2025, nous vous recommandons d'utiliser android-latest-release
au lieu de aosp-main
pour créer et contribuer à AOSP. Pour en savoir plus, consultez la section Modifications apportées à AOSP.
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Documentation de référence sur la struct GpsNavigationMessageInterface
#include <
gps.h
>
Interface étendue pour la prise en charge des rapports sur les messages de navigation GPS.
Définition à la ligne
2157
du fichier
gps.h
.
Arrête les mises à jour de l'HAL et désinscrit les routines de rappel. Après un appel d'arrêt, les rappels précédemment enregistrés doivent être considérés comme non valides par le HAL. Si "stop" est appelé sans "init" précédent, cette fonction ne doit effectuer aucune tâche.
Définition à la ligne
2181
du fichier
gps.h
.
Initialise l'interface et enregistre les routines de rappel auprès du HAL. Une fois l'appel "init" réussi, le HAL doit commencer à fournir des mises à jour dès qu'elles sont disponibles.
État : GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT : si un rappel a déjà été enregistré sans appel correspondant à "close". GPS_NAVIGATION_MESSAGE_ERROR_GENERIC : si une autre erreur s'est produite, le HAL ne devrait pas générer de mises à jour en renvoyant ce code d'erreur.
Définition à la ligne
2173
du fichier
gps.h
.
Définissez sur sizeof(GpsNavigationMessageInterface).
Définition à la ligne
2159
du fichier
gps.h
.
La documentation de ce struct a été générée à partir du fichier suivant :
-
hardware/libhardware/include/hardware/
gps.h
Le contenu et les exemples de code de cette page sont soumis aux licences décrites dans la Licence de contenu. Java et OpenJDK sont des marques ou des marques déposées d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/27 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/27 (UTC)."],[],[],null,["# Android Hardware Abstraction Layer: GpsNavigationMessageInterface Struct Reference\n\nGpsNavigationMessageInterface Struct Reference\n==============================================\n\n[Data Fields](#pub-attribs) \nGpsNavigationMessageInterface Struct Reference \n\n`\n#include \u003c\n`[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)`\n\u003e\n`\n\n|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| size_t | [size](/reference/hal/struct_gps_navigation_message_interface#a854352f53b148adc24983a58a1866d66) |\n| ||\n| int(\\* | [init](/reference/hal/struct_gps_navigation_message_interface#aff4b47b76fd1ebedee4ef8f23e1fd850) )( [GpsNavigationMessageCallbacks](/reference/hal/struct_gps_navigation_message_callbacks) \\*callbacks) |\n| ||\n| void(\\* | [close](/reference/hal/struct_gps_navigation_message_interface#a9736ff1cda7d1d558f5cd251e0049c49) )() |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nExtended interface for GPS navigation message reporting support.\n\n\nDefinition at line\n[2157](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\nField Documentation\n-------------------\n\n\n|------------------|\n| void(\\* close)() |\n\n\nStops updates from the HAL, and unregisters the callback routines. After a call to stop, the previously registered callbacks must be considered invalid by the HAL. If stop is invoked without a previous 'init', this function should perform no work.\n\n\nDefinition at line\n[2181](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|--------------------------------------------------------------------------------------------------------------------|\n| int(\\* init)( [GpsNavigationMessageCallbacks](/reference/hal/struct_gps_navigation_message_callbacks) \\*callbacks) |\n\n\nInitializes the interface and registers the callback routines with the HAL. After a successful call to 'init' the HAL must begin to provide updates as they become available.\n\n\nStatus: GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT - if a callback has already been registered without a corresponding call to 'close'. GPS_NAVIGATION_MESSAGE_ERROR_GENERIC - if any other error occurred, it is expected that the HAL will not generate any updates upon returning this error code.\n\n\nDefinition at line\n[2173](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|-------------|\n| size_t size |\n\n\nSet to sizeof(GpsNavigationMessageInterface)\n\n\nDefinition at line\n[2159](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)"]]