اعتبارًا من 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, double latitude, double longitude, double radius_meters, int last_transition, int monitor_transitions, int notification_responsiveness_ms, int unknown_timer_ms)
|
أضِف منطقة حدود جغرافية. تتيح واجهة برمجة التطبيقات هذه حاليًا استخدام حدود جغرافية دائرية. المَعلمات: geofence_id: معرّف الحدود الجغرافية إذا كان هناك حدود جغرافية تحمل هذا المعرّف، يجب عرض قيمة خطأ (GPS_GEOFENCE_ERROR_ID_EXISTS). latitude وlongtitude وradius_meters: خطوط الطول والعرض ونصف القطر (بالمتر) للحدود الجغرافية last_transition: الحالة الحالية للحدود الجغرافية على سبيل المثال، إذا كان النظام يعلم أنّ المستخدم داخل السياج الجغرافي، سيتم ضبط هذا الإعداد على GPS_GEOFENCE_ENTERED. في معظم الحالات، سيكون GPS_GEOFENCE_UNCERTAIN. monitor_transition - الذي ينتقل إلى المراقبة. OR ثنائي التدرّج لـ GPS_GEOFENCE_ENTERED وGPS_GEOFENCE_EXITED وGPS_GEOFENCE_UNCERTAIN. notification_responsiveness_ms: يحدّد وصف الجهد الأفضل للوقت الذي يجب فيه استدعاء دالة الاستدعاء عند بدء عملية النقل المرتبطة بحدود
المنطقة الجغرافية
على سبيل المثال، في حال ضبط القيمة على 1000 ملي ثانية باستخدام GPS_GEOFENCE_ENTERED، يجب استدعاء دالة الاستدعاء بعد 1000 ملي ثانية من دخول السياج الجغرافي. يتمّ تحديد هذه المَعلمة بالمللي ثانية. ملاحظة: يجب عدم الخلط بين هذا المعدل ومعدل الاستطلاع في نظام تحديد المواقع العالمي (GPS). من المقبول تغيير معدّل أخذ العينات من نظام تحديد المواقع العالمي (GPS) ديناميكيًا لأسباب متعلقة بتوفير الطاقة، وبالتالي قد يكون معدّل أخذ العينات أسرع أو أبطأ من هذا المعدّل. unknown_timer_ms: الحدّ الزمني الذي بعد انقضاءه يجب بدء عملية النقل UNCERTAIN يتمّ تحديد هذه المَعلمة بالمللي ثانية. اطّلِع على ما سبق للحصول على شرح مفصّل.
التعريف في السطر
1400
من الملف
gps.h
.
يفتح واجهة سياج جغرافي ويقدّم إجراءات الاستدعاء لتنفيذ هذه الواجهة.
التعريف في السطر
1369
من الملف
gps.h
.
void(* pause_geofence)(int32_t geofence_id)
|
يمكنك إيقاف مراقبة حدود جغرافية معيّنة مؤقتًا. المَعلمات: geofence_id: معرّف الحدود الجغرافية
التعريف في السطر
1409
من الملف
gps.h
.
void(* remove_geofence_area)(int32_t geofence_id)
|
إزالة منطقة حدود جغرافية بعد إرجاع الدالة، من المفترض ألا يتم إرسال أي إشعارات. المَعلمة: geofence_id - رقم تعريف الحدود الجغرافية
التعريف في السطر
1429
من الملف
gps.h
.
void(* resume_geofence)(int32_t geofence_id, int monitor_transitions)
|
استئناف مراقبة حدود جغرافية معيّنة المَعلمات: geofence_id: رقم تعريف السياج الجغرافي. 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
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ 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: 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)"]]