自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
GnssConfigurationInterface 結構體參考資料
#include <
gps.h
>
用於將 GNSS 設定內容從平台傳遞至 HAL 的介面。
定義位於檔案
gps.h
的
2188
行。
void(* configuration_update)(const char *config_data, int32_t length)
|
將 GNSS 設定內容傳送至 HAL。參數:config_data - 指向 char 陣列的指標,通常會保留檔案(/etc/gps.conf) 的預期內容,也就是以 '
' 分隔的 UTF8 字串序列。length - 設定資料中的 UTF8 字元總數。
重要事項:GPS HAL 應預期此函式可多次呼叫。即使 GpsLocationProvider 已建構並啟用,也可能會呼叫此方法。無論設定資料是否變更,GPS HAL 都應維持對各種回呼的現有要求。
定義位於檔案
gps.h
的
2205
行。
設為 sizeof(GnssConfigurationInterface)
定義位於檔案
gps.h
的
2190
行。
這個結構體的說明文件是由下列檔案產生:
-
hardware/libhardware/include/hardware/
gps.h
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","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 (世界標準時間)。"],[],[],null,["# Android Hardware Abstraction Layer: GnssConfigurationInterface Struct Reference\n\nGnssConfigurationInterface Struct Reference\n===========================================\n\n[Data Fields](#pub-attribs) \nGnssConfigurationInterface 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_gnss_configuration_interface#a854352f53b148adc24983a58a1866d66) |\n| ||\n| void(\\* | [configuration_update](/reference/hal/struct_gnss_configuration_interface#aba4127a8b06d8b52f2704706c31dadc5) )(const char \\*config_data, int32_t length) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nInterface for passing GNSS configuration contents from platform to HAL.\n\n\nDefinition at line\n[2188](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(\\* configuration_update)(const char \\*config_data, int32_t length) |\n\n\nDeliver GNSS configuration contents to HAL. Parameters: config_data - a pointer to a char array which holds what usually is expected from file(/etc/gps.conf), i.e., a sequence of UTF8 strings separated by '\n\n\n'. length - total number of UTF8 characters in configuraiton data.\n\n\nIMPORTANT: GPS HAL should expect this function can be called multiple times. And it may be called even when GpsLocationProvider is already constructed and enabled. GPS HAL should maintain the existing requests for various callback regardless the change in configuration data.\n\n\nDefinition at line\n[2205](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(GnssConfigurationInterface)\n\n\nDefinition at line\n[2190](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)"]]