mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
3.6 KiB
C
103 lines
3.6 KiB
C
4 years ago
|
/**
|
||
5 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
5 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
5 years ago
|
*
|
||
4 years ago
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
5 years ago
|
*
|
||
|
*/
|
||
|
|
||
4 years ago
|
#ifndef SRSRAN_UE_MIB_NBIOT_H
|
||
|
#define SRSRAN_UE_MIB_NBIOT_H
|
||
5 years ago
|
|
||
4 years ago
|
#include "srsran/config.h"
|
||
|
#include "srsran/phy/ch_estimation/chest_dl_nbiot.h"
|
||
|
#include "srsran/phy/dft/ofdm.h"
|
||
|
#include "srsran/phy/phch/npbch.h"
|
||
|
#include "srsran/phy/sync/cfo.h"
|
||
|
#include "srsran/phy/ue/ue_sync_nbiot.h"
|
||
5 years ago
|
|
||
4 years ago
|
#define SRSRAN_UE_MIB_NBIOT_NOF_PRB 6
|
||
|
#define SRSRAN_UE_MIB_NBIOT_FOUND 1
|
||
|
#define SRSRAN_UE_MIB_NBIOT_NOTFOUND 0
|
||
5 years ago
|
|
||
|
/**
|
||
|
* \brief This object decodes the MIB-NB from the NPBCH of an NB-IoT LTE signal.
|
||
|
*
|
||
4 years ago
|
* The function srsran_ue_mib_nbiot_decode() shall be called multiple
|
||
5 years ago
|
* times, each passing a number of samples multiple of 19200,
|
||
|
* sampled at 1.92 MHz (that is, 10 ms of samples).
|
||
|
*
|
||
|
* The function uses the sync_t object to find the NPSS sequence and
|
||
|
* decode the NPBCH to obtain the MIB.
|
||
|
*
|
||
|
* The function returns 0 until the MIB is decoded.
|
||
|
*/
|
||
|
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
|
srsran_sync_nbiot_t sfind;
|
||
5 years ago
|
|
||
|
cf_t* sf_symbols;
|
||
4 years ago
|
cf_t* ce[SRSRAN_MAX_PORTS];
|
||
5 years ago
|
|
||
4 years ago
|
srsran_ofdm_t fft;
|
||
|
srsran_chest_dl_nbiot_t chest;
|
||
|
srsran_npbch_t npbch;
|
||
5 years ago
|
|
||
4 years ago
|
uint8_t last_bch_payload[SRSRAN_MIB_NB_LEN];
|
||
5 years ago
|
uint32_t nof_tx_ports;
|
||
|
uint32_t nof_rx_antennas;
|
||
|
uint32_t sfn_offset;
|
||
|
|
||
|
uint32_t frame_cnt;
|
||
4 years ago
|
} srsran_ue_mib_nbiot_t;
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_ue_mib_nbiot_init(srsran_ue_mib_nbiot_t* q, cf_t** in_buffer, uint32_t max_prb);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_ue_mib_nbiot_set_cell(srsran_ue_mib_nbiot_t* q, srsran_nbiot_cell_t cell);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_ue_mib_nbiot_free(srsran_ue_mib_nbiot_t* q);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_ue_mib_nbiot_reset(srsran_ue_mib_nbiot_t* q);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_ue_mib_nbiot_decode(srsran_ue_mib_nbiot_t* q,
|
||
5 years ago
|
cf_t* input,
|
||
|
uint8_t* bch_payload,
|
||
|
uint32_t* nof_tx_ports,
|
||
|
int* sfn_offset);
|
||
|
|
||
|
/* This interface uses ue_mib and ue_sync to first get synchronized subframes
|
||
|
* and then decode MIB
|
||
|
*
|
||
|
* This object calls the pbch object with nof_ports=0 for blind nof_ports determination
|
||
|
*/
|
||
|
typedef struct {
|
||
4 years ago
|
srsran_ue_mib_nbiot_t ue_mib;
|
||
|
srsran_nbiot_ue_sync_t ue_sync;
|
||
|
cf_t* sf_buffer[SRSRAN_MAX_PORTS];
|
||
5 years ago
|
uint32_t nof_rx_antennas;
|
||
4 years ago
|
} srsran_ue_mib_sync_nbiot_t;
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int
|
||
|
srsran_ue_mib_sync_nbiot_init_multi(srsran_ue_mib_sync_nbiot_t* q,
|
||
|
int(recv_callback)(void*, cf_t* [SRSRAN_MAX_PORTS], uint32_t, srsran_timestamp_t*),
|
||
5 years ago
|
uint32_t nof_rx_antennas,
|
||
|
void* stream_handler);
|
||
|
|
||
4 years ago
|
SRSRAN_API void srsran_ue_mib_sync_nbiot_free(srsran_ue_mib_sync_nbiot_t* q);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_ue_mib_sync_nbiot_set_cell(srsran_ue_mib_sync_nbiot_t* q, srsran_nbiot_cell_t cell);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_ue_mib_sync_nbiot_reset(srsran_ue_mib_sync_nbiot_t* q);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_ue_mib_sync_nbiot_decode(srsran_ue_mib_sync_nbiot_t* q,
|
||
5 years ago
|
uint32_t max_frames_timeout,
|
||
|
uint8_t* bch_payload,
|
||
|
uint32_t* nof_tx_ports,
|
||
|
int* sfn_offset);
|
||
|
|
||
4 years ago
|
#endif // SRSRAN_UE_MIB_NBIOT_H
|