18NS_LOG_COMPONENT_DEFINE(
"NrCommon");
24FlowId_t::FlowId_t(
const uint16_t a,
const uint8_t b)
56ImsiLcidPair_t::ImsiLcidPair_t()
60ImsiLcidPair_t::ImsiLcidPair_t(
const uint64_t a,
const uint8_t b)
92NrUeConfig_t::NrUeConfig_t()
135 auto valFp = (int16_t)(val * 8);
143 double valD = ((int16_t)val) / 8.0;
156static const uint32_t BufferSizeLevelBsrTable[64] = {
157 0, 10, 12, 14, 17, 19, 22, 26, 31, 36, 42, 49, 57,
158 67, 78, 91, 107, 125, 146, 171, 200, 234, 274, 321, 376, 440,
159 515, 603, 706, 826, 967, 1132, 1326, 1552, 1817, 2127, 2490, 2915, 3413,
160 3995, 4677, 5476, 6411, 7505, 8787, 10287, 12043, 14099, 16507, 19325, 22624, 26487,
161 31009, 36304, 42502, 49759, 58255, 68201, 79846, 93749, 109439, 128125, 150000, 150000,
167 NS_ABORT_MSG_UNLESS(val < 64,
"val = " << val <<
" is out of range");
168 return BufferSizeLevelBsrTable[val];
175 if (BufferSizeLevelBsrTable[63] < val)
181 while (BufferSizeLevelBsrTable[index] < val)
183 NS_ASSERT(index < 64);
218 NS_ASSERT_MSG(range <= 97,
"value " << range <<
" is out of range");
219 return (
double)range - 141.0;
226 double range = std::min(std::max(std::floor(dbm + 141), 0.0), 97.0);
227 return (uint8_t)range;
234 NS_ASSERT_MSG(range <= 34,
"value " << (uint16_t)range <<
" is out of range");
235 return ((
double)range - 40.0) * 0.5;
242 double range = std::min(std::max(std::floor(db * 2 + 40), 0.0), 34.0);
243 return (uint8_t)range;
261 if (hysteresisIeValue > 30)
263 NS_FATAL_ERROR(
"The value " << (uint16_t)hysteresisIeValue
264 <<
" is out of the allowed range (0..30)"
265 <<
" for Hysteresis IE value");
268 double actual =
static_cast<double>(hysteresisIeValue) * 0.5;
269 NS_ASSERT(actual >= 0.0);
270 NS_ASSERT(actual <= 15.0);
277 if ((hysteresisDb < 0.0) || (hysteresisDb > 15.0))
279 NS_FATAL_ERROR(
"The value " << hysteresisDb <<
" is out of the allowed range (0..15) dB"
280 <<
" for hysteresis");
283 uint8_t ieValue = lround(hysteresisDb * 2.0);
284 NS_ASSERT(ieValue <= 30);
291 if ((a3OffsetIeValue < -30) || (a3OffsetIeValue > 30))
293 NS_FATAL_ERROR(
"The value " << (int16_t)a3OffsetIeValue
294 <<
" is out of the allowed range (-30..30)"
295 <<
" for a3-Offset IE value");
298 double actual =
static_cast<double>(a3OffsetIeValue) * 0.5;
299 NS_ASSERT(actual >= -15.0);
300 NS_ASSERT(actual <= 15.0);
307 if ((a3OffsetDb < -15.0) || (a3OffsetDb > 15.0))
309 NS_FATAL_ERROR(
"The value " << a3OffsetDb <<
" is out of the allowed range (-15..15) dB"
310 <<
" for A3 Offset");
313 int8_t ieValue = lround(a3OffsetDb * 2.0);
314 NS_ASSERT(ieValue >= -30);
315 NS_ASSERT(ieValue <= 30);
322 if ((qRxLevMinIeValue < -70) || (qRxLevMinIeValue > -22))
324 NS_FATAL_ERROR(
"The value " << (int16_t)qRxLevMinIeValue
325 <<
" is out of the allowed range (-70..-22)"
326 <<
" for Q-RxLevMin IE value");
329 double actual =
static_cast<double>(qRxLevMinIeValue) * 2;
330 NS_ASSERT(actual >= -140.0);
331 NS_ASSERT(actual <= -44.0);
338 if ((qQualMinIeValue < -34) || (qQualMinIeValue > -3))
340 NS_FATAL_ERROR(
"The value " << (int16_t)qQualMinIeValue
341 <<
" is out of the allowed range (-34..-3)"
342 <<
" for Q-QualMin IE value");
345 auto actual =
static_cast<double>(qQualMinIeValue);
346 NS_ASSERT(actual >= -34.0);
347 NS_ASSERT(actual <= -3.0);
static uint32_t BsrId2BufferSize(uint8_t val)
static uint8_t BufferSize2BsrId(uint32_t val)
static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue)
Returns the actual value of a hysteresis parameter.
static double RsrqRange2Db(uint8_t range)
static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue)
Returns the actual value of an Q-RxLevMin parameter.
static double RsrpRange2Dbm(uint8_t range)
static uint8_t ActualHysteresis2IeValue(double hysteresisDb)
Returns the IE value of hysteresis.
static double QuantizeRsrq(double v)
static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue)
Returns the actual value of an a3-Offset parameter.
static double QuantizeRsrp(double v)
static uint8_t Dbm2RsrpRange(double dbm)
static double IeValue2ActualQQualMin(int8_t qQualMinIeValue)
Returns the actual value of an Q-QualMin parameter.
static uint8_t Db2RsrqRange(double db)
static int8_t ActualA3Offset2IeValue(double a3OffsetDb)
Returns the IE value of a3-Offset.
static uint16_t double2fpS11dot3(double val)
static double getMinFpS11dot3Value()
static double fpS11dot3toDouble(uint16_t val)
static uint8_t TxMode2LayerNum(uint8_t txMode)
Parameters for configuring the UE.