1e41f4b71Sopenharmony_ci# ICellbatchingInterface 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## 概述 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ci定义对基站轨迹数据记录模块进行基本操作的接口。 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci接口包含注册回调函数,取消注册回调函数,使能和去使能基站轨迹数据记录,主动获取基站轨迹数据。 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci**起始版本:** 4.0 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci**相关模块:**[HdiLpfenceCellbatching](_hdi_lpfence_cellbatching.md) 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci## 汇总 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci### Public 成员函数 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ci| 名称 | 描述 | 21e41f4b71Sopenharmony_ci| -------- | -------- | 22e41f4b71Sopenharmony_ci| [RegisterCellbatchingCallback](#registercellbatchingcallback) ([in] [ICellbatchingCallback](interface_i_cellbatching_callback.md) callbackObj) | 注册回调函数。 | 23e41f4b71Sopenharmony_ci| [UnregisterCellbatchingCallback](#unregistercellbatchingcallback) ([in] [ICellbatchingCallback](interface_i_cellbatching_callback.md) callbackObj) | 取消注册回调函数。 | 24e41f4b71Sopenharmony_ci| [CellbatchingSwitch](#cellbatchingswitch) ([in] struct [CellbatchingRequest](_cellbatching_request.md) req) | 打开/关闭基站轨迹数据记录。 | 25e41f4b71Sopenharmony_ci| [FlushCellbatching](#flushcellbatching) () | 上报缓存的基站轨迹数据。 | 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci## 成员函数说明 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci### CellbatchingSwitch() 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci``` 34e41f4b71Sopenharmony_ciICellbatchingInterface::CellbatchingSwitch ([in] struct CellbatchingRequest req) 35e41f4b71Sopenharmony_ci``` 36e41f4b71Sopenharmony_ci**描述** 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ci打开/关闭基站轨迹数据记录。 39e41f4b71Sopenharmony_ci 40e41f4b71Sopenharmony_ci功能打开后,会将设备接收到的基站数据进行缓存,若接收到的基站数据与上一次接收的数据相同,则不会进行此次的数据缓存。 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci**起始版本:** 4.0 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci**参数:** 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci| 名称 | 描述 | 47e41f4b71Sopenharmony_ci| -------- | -------- | 48e41f4b71Sopenharmony_ci| req | 设置基站轨迹数据记录参数。详见[CellbatchingRequest](_cellbatching_request.md)。 | 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ci**返回:** 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci如果操作成功,则返回0。 53e41f4b71Sopenharmony_ci 54e41f4b71Sopenharmony_ci如果操作失败,则返回负值。 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ci### FlushCellbatching() 58e41f4b71Sopenharmony_ci 59e41f4b71Sopenharmony_ci``` 60e41f4b71Sopenharmony_ciICellbatchingInterface::FlushCellbatching () 61e41f4b71Sopenharmony_ci``` 62e41f4b71Sopenharmony_ci**描述** 63e41f4b71Sopenharmony_ci 64e41f4b71Sopenharmony_ci上报缓存的基站轨迹数据。 65e41f4b71Sopenharmony_ci 66e41f4b71Sopenharmony_ci上报基站数据的个数与设备的缓存buffer大小、设备接收的基站数据个数有关。flush之后,底层缓存基站数据会被清空。 67e41f4b71Sopenharmony_ci 68e41f4b71Sopenharmony_ci**起始版本:** 4.0 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_ci**返回:** 71e41f4b71Sopenharmony_ci 72e41f4b71Sopenharmony_ci如果操作成功,则返回0。 73e41f4b71Sopenharmony_ci 74e41f4b71Sopenharmony_ci如果操作失败,则返回负值。 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_ci 77e41f4b71Sopenharmony_ci### RegisterCellbatchingCallback() 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_ci``` 80e41f4b71Sopenharmony_ciICellbatchingInterface::RegisterCellbatchingCallback ([in] ICellbatchingCallback callbackObj) 81e41f4b71Sopenharmony_ci``` 82e41f4b71Sopenharmony_ci**描述** 83e41f4b71Sopenharmony_ci 84e41f4b71Sopenharmony_ci注册回调函数。 85e41f4b71Sopenharmony_ci 86e41f4b71Sopenharmony_ci用户在开启基站轨迹数据记录功能前,需要先注册该回调函数。当应用主动获取基站轨迹数据时,会通过回调函数进行上报。 87e41f4b71Sopenharmony_ci 88e41f4b71Sopenharmony_ci**起始版本:** 4.0 89e41f4b71Sopenharmony_ci 90e41f4b71Sopenharmony_ci**参数:** 91e41f4b71Sopenharmony_ci 92e41f4b71Sopenharmony_ci| 名称 | 描述 | 93e41f4b71Sopenharmony_ci| -------- | -------- | 94e41f4b71Sopenharmony_ci| callbackObj | 要注册的回调函数,只需成功订阅一次,无需重复订阅。详见[ICellbatchingCallback](interface_i_cellbatching_callback.md)。 | 95e41f4b71Sopenharmony_ci 96e41f4b71Sopenharmony_ci**返回:** 97e41f4b71Sopenharmony_ci 98e41f4b71Sopenharmony_ci如果注册回调函数成功,则返回0。 99e41f4b71Sopenharmony_ci 100e41f4b71Sopenharmony_ci如果注册回调函数失败,则返回负值。 101e41f4b71Sopenharmony_ci 102e41f4b71Sopenharmony_ci 103e41f4b71Sopenharmony_ci### UnregisterCellbatchingCallback() 104e41f4b71Sopenharmony_ci 105e41f4b71Sopenharmony_ci``` 106e41f4b71Sopenharmony_ciICellbatchingInterface::UnregisterCellbatchingCallback ([in] ICellbatchingCallback callbackObj) 107e41f4b71Sopenharmony_ci``` 108e41f4b71Sopenharmony_ci**描述** 109e41f4b71Sopenharmony_ci 110e41f4b71Sopenharmony_ci取消注册回调函数。 111e41f4b71Sopenharmony_ci 112e41f4b71Sopenharmony_ci取消之前注册的回调函数。当应用不需要使用基站轨迹数据记录功能,或需要更换回调函数时,需要取消注册回调函数。 113e41f4b71Sopenharmony_ci 114e41f4b71Sopenharmony_ci**起始版本:** 4.0 115e41f4b71Sopenharmony_ci 116e41f4b71Sopenharmony_ci**参数:** 117e41f4b71Sopenharmony_ci 118e41f4b71Sopenharmony_ci| 名称 | 描述 | 119e41f4b71Sopenharmony_ci| -------- | -------- | 120e41f4b71Sopenharmony_ci| callbackObj | 要取消注册的回调函数,只需成功取消订阅一次,无需重复取消订阅。详见[ICellbatchingCallback](interface_i_cellbatching_callback.md)。 | 121e41f4b71Sopenharmony_ci 122e41f4b71Sopenharmony_ci**返回:** 123e41f4b71Sopenharmony_ci 124e41f4b71Sopenharmony_ci如果取消注册回调函数成功,则返回0。 125e41f4b71Sopenharmony_ci 126e41f4b71Sopenharmony_ci如果取消注册回调函数失败,则返回负值。 127