החל מ-27 במרץ 2025, מומלץ להשתמש ב-android-latest-release
במקום ב-aosp-main
כדי ליצור תרומות ל-AOSP. מידע נוסף זמין במאמר שינויים ב-AOSP.
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
הפניה ל-struct של GpsNavigationMessageInterface
#include <
gps.h
>
ממשק מורחב לתמיכה בדיווח על הודעות של ניווט GPS.
ההגדרה מופיעה בשורה
2157
בקובץ
gps.h
.
הפסקת העדכונים מ-HAL והסרת הרישום של פונקציות ה-callback. אחרי קריאה להפסקה, HAL צריך להתייחס כאל לא חוקיות את הפונקציות להפעלה חוזרת (callbacks) שרושמו קודם. אם קוראים לפונקציה stop בלי 'init' קודם, הפונקציה הזו לא אמורה לבצע שום פעולה.
ההגדרה מופיעה בשורה
2181
בקובץ
gps.h
.
הפונקציה מפעילה את הממשק ומרשמת את פונקציות ה-call back ב-HAL. אחרי קריאה מוצלחת ל-'init', ה-HAL צריך להתחיל לספק עדכונים ברגע שהם זמינים.
סטטוס: GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT – אם כבר נרשם קריאה חוזרת ללא קריאה תואמת ל-'close'. GPS_NAVIGATION_MESSAGE_ERROR_GENERIC – אם אירעה שגיאה אחרת, ה-HAL לא אמור ליצור עדכונים כשהוא מחזיר את קוד השגיאה הזה.
ההגדרה מופיעה בשורה
2173
בקובץ
gps.h
.
מגדירים לערך sizeof(GpsNavigationMessageInterface)
ההגדרה מופיעה בשורה
2159
בקובץ
gps.h
.
התיעוד של המבנה הזה נוצר מהקובץ הבא:
-
hardware/libhardware/include/hardware/
gps.h
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון 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-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)"]]