blob: 32a2992aad796d882ad4577275e43f6bea3e87f2 [file] [log] [blame]
#ifndef _MRS_EAS_SEARCH_H
#define _MRS_EAS_SEARCH_H
#include "mrs_common_capability.h"
#include "mrs_common_search.h"
#include "mrs_as_struct.h"
#include "mcc_recog_train_data.h"
#ifdef UNIT_TEST
#include "mcc_recog_test_data.h"
#endif /* UNIT_TEST */
#define MRS_EAS_MCC_RECOG_MAX_SUBBAND_NUM 64 //Should be same as MAX_RSSI_SNIFFER_BAND_COMPLETE_SUBBAND
typedef enum {
MRS_GET_PREDICT_EARFCN_TABLE,
MRS_EAS_GET_PREDICT_FREQ_LIST_BY_PLMN_1,
MRS_EAS_GET_PREDICT_FREQ_LIST_BY_PLMN_2,
MRS_EAS_GET_PREDICT_FREQ_LIST_BY_PLMN_3,
MRS_EAS_GET_PREDICT_FREQ_LIST_BY_PLMN_4,
MRS_EAS_GET_PREDICT_FREQ_LIST_BY_PLMN_5,
MRS_EAS_GET_PREDICT_FREQ_LIST_BY_BAND_1,
}mrs_predict_utility_ut_enum;
typedef struct eas_mcc_recog_mcc_list {
kal_uint8 mcc_num;
mrs_mcc_id mcc[MCC_RECOG_LTE_MAX_MCC_LEN];
} mrs_eas_mcc_recog_mcc_list_struct;
typedef struct
{
EARFCN freq; // The central frequency of each subband.
kal_int16 rssi; // The rssi result (qdBm) or each subband.
} mrs_eas_subband_rssi_struct;
typedef struct
{
kal_uint16 band;
kal_uint8 subband_num; // The number of subbands to report.
mrs_eas_subband_rssi_struct subband_rssi[MRS_EAS_MCC_RECOG_MAX_SUBBAND_NUM];
} mrs_eas_band_rssi_distribution_struct;
typedef struct
{
kal_uint16 band_num;
mrs_eas_band_rssi_distribution_struct band[MCC_RECOG_LTE_BAND_NUM];
} mrs_eas_rssi_distribution_struct;
kal_uint16 mrs_eas_get_predict_freq_list_by_plmn(
MRS_SIM_INDEX sim_index,
const mrs_plmn_id_list *plmn_list,
const EARFCN *skip_freq_list,
const kal_uint16 skip_freq_list_num,
EARFCN *predict_freq_list);
void mrs_get_predict_earfcn_table_by_band(kal_uint32 lte_band, mrs_freq_table_struct *earfcn_table);
void mrs_get_top10_earfcn(mrs_freq_table_struct *earfcn_table);
void mrs_append_top10_earfcn_table(mrs_freq_table_struct *skip_freq_table, mrs_freq_table_struct *output_table);
kal_uint16 mrs_eas_get_predict_freq_list_by_band(
MRS_SIM_INDEX sim_index,
const kal_uint32 band_list_num,
const kal_uint16 *band_list,
const EARFCN *skip_freq_list,
const kal_uint16 skip_freq_list_num,
EARFCN *predict_freq_list // kal_uint32 array[64]
);
void mrs_eas_mrs_plmn_id_to_plmn_id(const mrs_plmn_id *src, plmn_id_struct *dst);
void mrs_eas_plmn_id_to_mrs_plmn_id(const plmn_id_struct *src, mrs_plmn_id *dst);
double mrs_eas_mcc_recog_centered_cosine_distance(const kal_int8 *data1, const kal_int8 *data2, kal_uint32 data_len);
kal_bool mrs_eas_mcc_recog_is_remarkable_band(kal_uint16 band);
mrs_eas_mcc_recog_mcc_list_struct mrs_eas_mcc_recog_get_mcc(mrs_eas_rssi_distribution_struct *rssi_distribution);
void mcc_ai_init_wrapper();
int mcc_ai_inference_wrapper
(kal_int8 *input_buf, int input_length,
maif_mcc_enum *prediction_mcc_code, float *softmax_probability);
#ifdef UNIT_TEST
void mrs_eas_mcc_recog_regression();
void mrs_eas_mcc_recog_test(kal_int8 *test_data, kal_uint32 data_len);
#endif /* UNIT_TEST */
#endif