1# IGeofenceInterface 2 3 4## 概述 5 6定义接口用于添加围栏,删除围栏,设置围栏回调函数等。 7 8**起始版本:** 3.2 9 10**相关模块:**[HdiGeofence](_hdi_geofence.md) 11 12 13## 汇总 14 15 16### Public 成员函数 17 18| 名称 | 描述 | 19| -------- | -------- | 20| [SetGeofenceCallback](#setgeofencecallback) ([in] [IGeofenceCallback](interface_i_geofence_callback.md) callbackObj) | 设置地理围栏回调函数。 | 21| [AddGnssGeofence](#addgnssgeofence) ([in] struct [GeofenceInfo](_geofence_info.md) fence, [in] enum GeofenceEvent monitorEvent) | 添加一个地理围栏。 | 22| [DeleteGnssGeofence](#deletegnssgeofence) ([in] int fenceIndex) | 删除一个地理围栏。 | 23 24 25## 成员函数说明 26 27 28### AddGnssGeofence() 29 30``` 31IGeofenceInterface::AddGnssGeofence ([in] struct GeofenceInfo fence, [in] enum GeofenceEvent monitorEvent ) 32``` 33 34**描述** 35 36添加一个地理围栏。 37 38**起始版本:** 3.2 39 40**参数:** 41 42| 名称 | 描述 | 43| -------- | -------- | 44| fence | 表示地理围栏的参数。详情参考[GeofenceInfo](_geofence_info.md)。 | 45| monitorEvent | 表示APP想要监控的地理围栏事件。详情参考[GeofenceEvent](_hdi_geofence.md#geofenceevent)。 | 46 47**返回:** 48 49返回0表示成功,返回负数表示失败。 50 51 52### DeleteGnssGeofence() 53 54``` 55IGeofenceInterface::DeleteGnssGeofence ([in] int fenceIndex) 56``` 57 58**描述** 59 60删除一个地理围栏。 61 62**起始版本:** 3.2 63 64**参数:** 65 66| 名称 | 描述 | 67| -------- | -------- | 68| fenceIndex | 表示地理围栏的编号。 | 69 70**返回:** 71 72返回0表示成功,返回负数表示失败。 73 74 75### SetGeofenceCallback() 76 77``` 78IGeofenceInterface::SetGeofenceCallback ([in] IGeofenceCallback callbackObj) 79``` 80 81**描述** 82 83设置地理围栏回调函数。 84 85**起始版本:** 3.2 86 87**参数:** 88 89| 名称 | 描述 | 90| -------- | -------- | 91| callback | 表示地理围栏的回调函数,GNSS驱动使用此回调上报地理围栏服务可用性, 上报地理围栏事件,上报地理围栏操作结果。详情参考[IGeofenceCallback](interface_i_geofence_callback.md)。 | 92 93**返回:** 94 95返回0表示成功,返回负数表示失败。 96