Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tham chiếu cấu trúc AGpsStatus
#include <
gps.h
>
Định nghĩa tại dòng
885
của tệp
gps.h
.
struct sockaddr_storage addr
|
Phải chứa địa chỉ IPv4 (AF_INET) hoặc IPv6 (AF_INET6) để báo cáo. Mọi giá trị khác của addr.ss_family sẽ bị từ chối.
Định nghĩa tại dòng
902
của tệp
gps.h
.
Phải được đặt thành địa chỉ IPv4 hợp lệ nếu trường "addr" chứa địa chỉ IPv4, hoặc đặt thành INADDR_NONE nếu không.
Định nghĩa tại dòng
896
của tệp
gps.h
.
đặt thành sizeof(AGpsStatus)
Định nghĩa tại dòng
887
của tệp
gps.h
.
Tài liệu cho cấu trúc này được tạo từ tệp sau:
-
hardware/libhardware/include/hardware/
gps.h
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Android Hardware Abstraction Layer: AGpsStatus Struct Reference\n\nAGpsStatus Struct Reference\n===========================\n\n[Data Fields](#pub-attribs) \nAGpsStatus 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_a_gps_status#a854352f53b148adc24983a58a1866d66) |\n| ||\n| [AGpsType](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h) | [type](/reference/hal/struct_a_gps_status#ab639ef6817d6d72c3935f2fefaceb388) |\n| ||\n| [AGpsStatusValue](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h) | [status](/reference/hal/struct_a_gps_status#ae9d376f9eb394301034e54329ce1c0d9) |\n| ||\n| uint32_t | [ipaddr](/reference/hal/struct_a_gps_status#ae1eb735f98e6aa289cc149178b6e0b00) |\n| ||\n| struct sockaddr_storage | [addr](/reference/hal/struct_a_gps_status#a7fe4b3f87e7a49d2520a0d26563bb921) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nDefinition at line\n[885](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| struct sockaddr_storage addr |\n\n\nMust contain the IPv4 (AF_INET) or IPv6 (AF_INET6) address to report. Any other value of addr.ss_family will be rejected.\n\n\nDefinition at line\n[902](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| uint32_t ipaddr |\n\n\nMust be set to a valid IPv4 address if the field 'addr' contains an IPv4 address, or set to INADDR_NONE otherwise.\n\n\nDefinition at line\n[896](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(AGpsStatus)\n\n\nDefinition at line\n[887](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| [AGpsStatusValue](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h) status |\n\n\nDefinition at line\n[890](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| [AGpsType](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h) type |\n\n\nDefinition at line\n[889](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)"]]