|
|
@ -42,17 +42,18 @@ public:
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* UE's FSM for controlling Time Aligment command generation.
|
|
|
|
* UE's FSM for controlling Time Aligment command generation.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Initially the FSM starts at none state which automatically transitions to Measure. Measurements are collected while
|
|
|
|
* Initially the FSM starts at idle state which transitions to Measure as soon as start is called. Measurements are
|
|
|
|
* the FSM is in Measure state. Up to MAX_NOF_MEAS are stored. The FSM uses a minimum of MIN_NOF_MEAS measurements to
|
|
|
|
* collected while the FSM is in Measure state. Up to MAX_NOF_MEAS are stored. The FSM uses a minimum of MIN_NOF_MEAS
|
|
|
|
* compute the TA average. The TA command is triggered as soon as the TA average is higher than TA_N_THRESHOLD. After
|
|
|
|
* measurements to compute the TA average. The TA command is triggered as soon as the TA average is higher than
|
|
|
|
* triggering a TA command, holds in prohibit state for PROHIBIT_PERIOD_MS before start collecting measurements.
|
|
|
|
* TA_N_THRESHOLD. After triggering a TA command, holds in prohibit state for PROHIBIT_PERIOD_MS before start collecting
|
|
|
|
|
|
|
|
* measurements.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* +------+ First call +---------+ Trigger +----------+
|
|
|
|
* +------+ Start +---------+ Trigger +----------+
|
|
|
|
* | None | ------------->| Measure |------------>| Prohibit |
|
|
|
|
* | Idle | ------->| Measure |------------>| Prohibit |
|
|
|
|
* +------+ +---------+ +----------+
|
|
|
|
* +------+ +---------+ +----------+
|
|
|
|
* ^ ^ |
|
|
|
|
* ^ ^ |
|
|
|
|
* | | Prohibit expires |
|
|
|
|
* | | Prohibit expires |
|
|
|
|
* --+ +------------------------+
|
|
|
|
* --+ +------------------------+
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -82,11 +83,11 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
// FSM states
|
|
|
|
// FSM states
|
|
|
|
typedef enum {
|
|
|
|
typedef enum {
|
|
|
|
state_none = 0, ///< NO state has been set yet
|
|
|
|
state_idle = 0, ///< Waits for start order
|
|
|
|
state_measure, ///< Performing measurement
|
|
|
|
state_measure, ///< Performing measurement
|
|
|
|
state_prohibit ///< Waiting for HARQ to transmit CE command, NO measurement shall be stored
|
|
|
|
state_prohibit ///< Waiting for HARQ to transmit CE command, NO measurement shall be stored
|
|
|
|
} state_t;
|
|
|
|
} state_t;
|
|
|
|
state_t state = state_none;
|
|
|
|
state_t state = state_idle;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Reset Measurement and timer counter
|
|
|
|
* Reset Measurement and timer counter
|
|
|
@ -120,17 +121,6 @@ private:
|
|
|
|
return static_cast<int>(std::roundf(ta_us * 1e-6f / SRSLTE_LTE_TS / 16.0f));
|
|
|
|
return static_cast<int>(std::roundf(ta_us * 1e-6f / SRSLTE_LTE_TS / 16.0f));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Runs initial state none
|
|
|
|
|
|
|
|
* @return 0
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
uint32_t run_state_none()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
reset_measurements();
|
|
|
|
|
|
|
|
state = state_measure;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Runs measure state
|
|
|
|
* Runs measure state
|
|
|
|
* @return the number of enqueued MAC CE carrying TA commands
|
|
|
|
* @return the number of enqueued MAC CE carrying TA commands
|
|
|
@ -187,8 +177,9 @@ private:
|
|
|
|
uint32_t run_fsm()
|
|
|
|
uint32_t run_fsm()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (state) {
|
|
|
|
switch (state) {
|
|
|
|
case state_none:
|
|
|
|
case state_idle:
|
|
|
|
return run_state_none();
|
|
|
|
// Waits for Start order, do nothing
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
case state_measure:
|
|
|
|
case state_measure:
|
|
|
|
return run_state_measure();
|
|
|
|
return run_state_measure();
|
|
|
|
case state_prohibit:
|
|
|
|
case state_prohibit:
|
|
|
@ -210,6 +201,17 @@ public:
|
|
|
|
run_fsm();
|
|
|
|
run_fsm();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Gives an start order to the FSM
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void start()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Transition to idle only if the current state is idle
|
|
|
|
|
|
|
|
if (state == state_idle) {
|
|
|
|
|
|
|
|
state = state_measure;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Pushes TA measurement and runs internal FSM
|
|
|
|
* Pushes TA measurement and runs internal FSM
|
|
|
|
*
|
|
|
|
*
|
|
|
|