از 27 مارس 2025، توصیه می کنیم از android-latest-release
به جای aosp-main
برای ساختن و کمک به AOSP استفاده کنید. برای اطلاعات بیشتر، به تغییرات AOSP مراجعه کنید.
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
مرجع ساختار GpsGeofencingInterface
#include < gps.h >
رابط توسعه یافته برای پشتیبانی GPS_Geofencing
تعریف در خط 1361 فایل gps.h .
void(* add_geofence_area)(int32_t geofence_id، دو برابر عرض جغرافیایی، طول جغرافیایی دو برابر، شعاع_متر دوبرابر، int last_transition، int monitor_transitions، int notification_responsiveness_ms، intknown_timer_ms) |
یک منطقه geofence اضافه کنید. این api در حال حاضر از geofence های دایره ای پشتیبانی می کند. پارامترها: geofence_id - شناسه geofence. اگر یک geofence با این شناسه از قبل وجود داشته باشد، یک مقدار خطا (GPS_GEOFENCE_ERROR_ID_EXISTS) باید برگردانده شود. عرض جغرافیایی، طول، شعاع_متر - طول، طول و شعاع (بر حسب متر) برای geofence last_transition - وضعیت فعلی geofence. به عنوان مثال، اگر سیستم از قبل بداند که کاربر در داخل geofence است، این روی GPS_GEOFENCE_ENTERED تنظیم می شود. در بیشتر موارد، GPS_GEOFENCE_UNCERTAIN خواهد بود. monitor_transition - کدام انتقال برای نظارت. بیتی OR از GPS_GEOFENCE_ENTERED، GPS_GEOFENCE_EXITED و GPS_GEOFENCE_UNCERTAIN. notification_responsiveness_ms - بهترین توصیف را در مورد اینکه چه مدت باید در زمانی که انتقال مرتبط با Geofence فعال می شود، فراخوانی شود، تعریف می کند. برای مثال، اگر با GPS_GEOFENCE_ENTERED روی 1000 میلیثانیه تنظیم شود، پس از ورود به geofence باید 1000 میلیثانیه نامیده شود. این پارامتر بر حسب میلی ثانیه تعریف می شود. توجه: این نباید با نرخ نظرسنجی GPS اشتباه گرفته شود. تغییر پویا نرخ نمونه برداری از GPS به دلایل صرفه جویی در مصرف انرژی قابل قبول است. بنابراین سرعت نمونه گیری ممکن است سریعتر یا کندتر از این باشد. known_timer_ms - محدودیت زمانی که پس از آن باید انتقال نامشخص آغاز شود. این پارامتر بر حسب میلی ثانیه تعریف می شود. برای توضیح دقیق به بالا مراجعه کنید.
تعریف در خط 1400 فایل gps.h.
رابط geofence را باز می کند و روال های برگشت تماس را برای اجرای این رابط فراهم می کند.
تعریف در خط 1369 فایل gps.h .
void(* pause_geofence)(int32_t geofence_id) |
مانیتورینگ یک ژئوفنس خاص را متوقف کنید. پارامترها: geofence_id - شناسه geofence.
تعریف در خط 1409 فایل gps.h.
void(* remove_geofence_area)(int32_t geofence_id) |
یک منطقه geofence را بردارید. پس از بازگشت عملکرد، هیچ اعلانی نباید ارسال شود. پارامتر: geofence_id - شناسه geofence.
تعریف در خط 1429 فایل gps.h.
void(* resume_geofence)(int32_t geofence_id، int monitor_transitions) |
نظارت بر یک ژئوفنس خاص را از سر بگیرید. پارامترها: geofence_id - شناسه geofence. monitor_transitions - کدام انتقال برای نظارت. بیتی OR از GPS_GEOFENCE_ENTERED، GPS_GEOFENCE_EXITED و GPS_GEOFENCE_UNCERTAIN. این جایگزین مقدار مرتبط ارائه شده در فراخوانی add_geofence_area می شود.
تعریف در خط 1421 فایل gps.h.
روی sizeof (GpsGeofencingInterface) تنظیم کنید
تعریف در خط 1363 فایل gps.h .
مستندات این ساختار از فایل زیر تولید شده است:
- hardware/libhardware/include/hardware/ gps.h
،
مرجع ساختار GpsGeofencingInterface
#include < gps.h >
رابط توسعه یافته برای پشتیبانی GPS_Geofencing
تعریف در خط 1361 فایل gps.h .
void(* add_geofence_area)(int32_t geofence_id، دو برابر عرض جغرافیایی، طول جغرافیایی دو برابر، شعاع_متر دوبرابر، int last_transition، int monitor_transitions، int notification_responsiveness_ms، intknown_timer_ms) |
یک منطقه geofence اضافه کنید. این api در حال حاضر از geofence های دایره ای پشتیبانی می کند. پارامترها: geofence_id - شناسه geofence. اگر یک geofence با این شناسه از قبل وجود داشته باشد، یک مقدار خطا (GPS_GEOFENCE_ERROR_ID_EXISTS) باید برگردانده شود. عرض جغرافیایی، طول، شعاع_متر - طول، طول و شعاع (بر حسب متر) برای geofence last_transition - وضعیت فعلی geofence. به عنوان مثال، اگر سیستم از قبل بداند که کاربر در داخل geofence است، این روی GPS_GEOFENCE_ENTERED تنظیم می شود. در بیشتر موارد، GPS_GEOFENCE_UNCERTAIN خواهد بود. monitor_transition - کدام انتقال برای نظارت. بیتی OR از GPS_GEOFENCE_ENTERED، GPS_GEOFENCE_EXITED و GPS_GEOFENCE_UNCERTAIN. notification_responsiveness_ms - بهترین توصیف را در مورد اینکه چه مدت باید در زمانی که انتقال مرتبط با Geofence فعال می شود، فراخوانی شود، تعریف می کند. برای مثال، اگر با GPS_GEOFENCE_ENTERED روی 1000 میلیثانیه تنظیم شود، پس از ورود به geofence باید 1000 میلیثانیه نامیده شود. این پارامتر بر حسب میلی ثانیه تعریف می شود. توجه: این نباید با نرخ نظرسنجی GPS اشتباه گرفته شود. تغییر پویا نرخ نمونه برداری از GPS به دلایل صرفه جویی در مصرف انرژی قابل قبول است. بنابراین سرعت نمونه گیری ممکن است سریعتر یا کندتر از این باشد. known_timer_ms - محدودیت زمانی که پس از آن باید انتقال نامشخص آغاز شود. این پارامتر بر حسب میلی ثانیه تعریف می شود. برای توضیح دقیق به بالا مراجعه کنید.
تعریف در خط 1400 فایل gps.h.
رابط geofence را باز می کند و روال های برگشت تماس را برای اجرای این رابط فراهم می کند.
تعریف در خط 1369 فایل gps.h .
void(* pause_geofence)(int32_t geofence_id) |
مانیتورینگ یک ژئوفنس خاص را متوقف کنید. پارامترها: geofence_id - شناسه geofence.
تعریف در خط 1409 فایل gps.h.
void(* remove_geofence_area)(int32_t geofence_id) |
یک منطقه geofence را بردارید. پس از بازگشت عملکرد، هیچ اعلانی نباید ارسال شود. پارامتر: geofence_id - شناسه geofence.
تعریف در خط 1429 فایل gps.h.
void(* resume_geofence)(int32_t geofence_id، int monitor_transitions) |
نظارت بر یک ژئوفنس خاص را از سر بگیرید. پارامترها: geofence_id - شناسه geofence. monitor_transitions - کدام انتقال برای نظارت. بیتی OR از GPS_GEOFENCE_ENTERED، GPS_GEOFENCE_EXITED و GPS_GEOFENCE_UNCERTAIN. این جایگزین مقدار مرتبط ارائه شده در فراخوانی add_geofence_area می شود.
تعریف در خط 1421 فایل gps.h.
روی sizeof (GpsGeofencingInterface) تنظیم کنید
تعریف در خط 1363 فایل gps.h .
مستندات این ساختار از فایل زیر تولید شده است:
- hardware/libhardware/include/hardware/ gps.h
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Android Hardware Abstraction Layer: GpsGeofencingInterface Struct Reference\n\nGpsGeofencingInterface Struct Reference\n=======================================\n\n[Data Fields](#pub-attribs) \nGpsGeofencingInterface 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_geofencing_interface#a854352f53b148adc24983a58a1866d66) |\n| ||\n| void(\\* | [init](/reference/hal/struct_gps_geofencing_interface#a4504d0e82b1d377fa32d56ec5004774f) )( [GpsGeofenceCallbacks](/reference/hal/struct_gps_geofence_callbacks) \\*callbacks) |\n| ||\n| void(\\* | [add_geofence_area](/reference/hal/struct_gps_geofencing_interface#add2c5bdb0d1496ac9ee6a2460fb12a08) )(int32_t geofence_id, double latitude, double longitude, double radius_meters, int last_transition, int monitor_transitions, int notification_responsiveness_ms, int unknown_timer_ms) |\n| ||\n| void(\\* | [pause_geofence](/reference/hal/struct_gps_geofencing_interface#a850b900b8eabf9328ec853978936ed4f) )(int32_t geofence_id) |\n| ||\n| void(\\* | [resume_geofence](/reference/hal/struct_gps_geofencing_interface#af409f9b64a5b9b42a5417ae381fabc88) )(int32_t geofence_id, int monitor_transitions) |\n| ||\n| void(\\* | [remove_geofence_area](/reference/hal/struct_gps_geofencing_interface#a4cff265eb49bb5d94d9be5a4c55ceea7) )(int32_t geofence_id) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nExtended interface for GPS_Geofencing support\n\n\nDefinition at line\n[1361](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(\\* add_geofence_area)(int32_t geofence_id, double latitude, double longitude, double radius_meters, int last_transition, int monitor_transitions, int notification_responsiveness_ms, int unknown_timer_ms) |\n\n\nAdd a geofence area. This api currently supports circular geofences. Parameters: geofence_id - The id for the geofence. If a geofence with this id already exists, an error value (GPS_GEOFENCE_ERROR_ID_EXISTS) should be returned. latitude, longtitude, radius_meters - The lat, long and radius (in meters) for the geofence last_transition - The current state of the geofence. For example, if the system already knows that the user is inside the geofence, this will be set to GPS_GEOFENCE_ENTERED. In most cases, it will be GPS_GEOFENCE_UNCERTAIN. monitor_transition - Which transitions to monitor. Bitwise OR of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and GPS_GEOFENCE_UNCERTAIN. notification_responsiveness_ms - Defines the best-effort description of how soon should the callback be called when the transition associated with the\n[Geofence](/reference/hal/struct_geofence)\nis triggered. For instance, if set to 1000 millseconds with GPS_GEOFENCE_ENTERED, the callback should be called 1000 milliseconds within entering the geofence. This parameter is defined in milliseconds. NOTE: This is not to be confused with the rate that the GPS is polled at. It is acceptable to dynamically vary the rate of sampling the GPS for power-saving reasons; thus the rate of sampling may be faster or slower than this. unknown_timer_ms - The time limit after which the UNCERTAIN transition should be triggered. This parameter is defined in milliseconds. See above for a detailed explanation.\n\n\nDefinition at line\n[1400](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| void(\\* init)( [GpsGeofenceCallbacks](/reference/hal/struct_gps_geofence_callbacks) \\*callbacks) |\n\n\nOpens the geofence interface and provides the callback routines to the implementation of this interface.\n\n\nDefinition at line\n[1369](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| void(\\* pause_geofence)(int32_t geofence_id) |\n\n\nPause monitoring a particular geofence. Parameters: geofence_id - The id for the geofence.\n\n\nDefinition at line\n[1409](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| void(\\* remove_geofence_area)(int32_t geofence_id) |\n\n\nRemove a geofence area. After the function returns, no notifications should be sent. Parameter: geofence_id - The id for the geofence.\n\n\nDefinition at line\n[1429](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| void(\\* resume_geofence)(int32_t geofence_id, int monitor_transitions) |\n\n\nResume monitoring a particular geofence. Parameters: geofence_id - The id for the geofence. monitor_transitions - Which transitions to monitor. Bitwise OR of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and GPS_GEOFENCE_UNCERTAIN. This supersedes the value associated provided in the add_geofence_area call.\n\n\nDefinition at line\n[1421](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(GpsGeofencingInterface)\n\n\nDefinition at line\n[1363](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)"]]