// 秒寻科技
// 信号同步处理，包括时隙同步和比特同步
// zt
// 2023-03-12

#ifndef __BTS_SYNC_H__
#define __BTS_SYNC_H__

#include "../../sysdefine/sysdef.h"

// 供外部使用接口
void bts_sync_main(PUB_LOCATION_DATA_T *pstLocationDataList, BTS_AMPL_MIRROR_DATA_T *pstBtsAmplMirrorDataList, BTS_MAX_AMPL_DATA_T *pstBtsMaxAmplDataList);

// 供内部使用接口
void bts_sync_check_valid_bts(BTS_MAX_AMPL_DATA_T *pstBtsMaxAmplDataList, uint8 *pbyValidFlag);
void bts_sync_cal_signal_slot(uint8 byMainBtsSetSlot, int32 dwMainBtsFrameStartIndex, uint8 *pbySignalSlotList);
void bts_sync_cal_slot_sync_offset(uint8 *pbySignalSoltList, uint8 byBtsSetSlot, int8 *pbySlotOffset);
int32 bts_sync_cal_main_bts_sync_index(uint8 byMainBtsSetSlot, int32 dwMainBtsMaxIndex, uint8 *pbySignalSoltList);
int32 bts_sync_cal_slave_bts_sync_index(PUB_LOCATION_DATA_T *pstLocationData, uint8 byMainBtsSlot, int32 dwMainBtsSyncIndex, uint8 *pbySignalSoltList, flt32 *pfData);
void bts_sync_set_bts_signal_sync(PUB_LOCATION_DATA_T *pstLocationData, int32 dwBtsSyncIndex);

#endif