Skip to content

Commit

Permalink
Merge pull request #537 from handymenny/ulTxSwitch
Browse files Browse the repository at this point in the history
capabilityInformation: Initial ul tx switch support
  • Loading branch information
handymenny authored Nov 10, 2024
2 parents 4fcddff + 6fa4059 commit 028e671
Show file tree
Hide file tree
Showing 11 changed files with 34,287 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package it.smartphonecombo.uecapabilityparser.extension

import it.smartphonecombo.uecapabilityparser.model.Duplex
import it.smartphonecombo.uecapabilityparser.model.band.DuplexBandTable
import it.smartphonecombo.uecapabilityparser.model.component.ComponentNr

val ComponentNr.isSUL
get() = DuplexBandTable.getNrDuplex(this.band) == Duplex.SUL
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import it.smartphonecombo.uecapabilityparser.extension.getInt
import it.smartphonecombo.uecapabilityparser.extension.getObject
import it.smartphonecombo.uecapabilityparser.extension.getObjectAtPath
import it.smartphonecombo.uecapabilityparser.extension.getString
import it.smartphonecombo.uecapabilityparser.extension.isSUL
import it.smartphonecombo.uecapabilityparser.extension.merge
import it.smartphonecombo.uecapabilityparser.extension.mutableListWithCapacity
import it.smartphonecombo.uecapabilityparser.extension.typedList
Expand All @@ -25,6 +26,9 @@ import it.smartphonecombo.uecapabilityparser.model.Mimo
import it.smartphonecombo.uecapabilityparser.model.PowerClass
import it.smartphonecombo.uecapabilityparser.model.Rat
import it.smartphonecombo.uecapabilityparser.model.SingleBCS
import it.smartphonecombo.uecapabilityparser.model.UplinkTxSwitchConfig
import it.smartphonecombo.uecapabilityparser.model.UplinkTxSwitchOption
import it.smartphonecombo.uecapabilityparser.model.UplinkTxSwitchType
import it.smartphonecombo.uecapabilityparser.model.band.BandBoxed
import it.smartphonecombo.uecapabilityparser.model.band.BandLteDetails
import it.smartphonecombo.uecapabilityparser.model.band.BandNrDetails
Expand Down Expand Up @@ -145,7 +149,9 @@ object ImportCapabilityInformation : ImportCapabilities {
nrBandsMap = getNrBands(nr, ueType).associateBy({ it.band }, { it })
nrFeatures = getNRFeatureSet(nr)
val featureSetCombination = getFeatureSetCombinations(nr)
val saCombos = getNrBandCombinations(nr).typedList<ComboNr>()
val nrCaCombos = getNrBandCombinations(nr).typedList<ComboNr>()
val saUlTxSwitchCombos = getUlTxSwitchBandCombinations(nr)
val saCombos = nrCaCombos + saUlTxSwitchCombos
comboList.nrCombos =
linkFeaturesAndCarrier(
saCombos,
Expand All @@ -156,7 +162,8 @@ object ImportCapabilityInformation : ImportCapabilities {
nrBandsMap,
)
.typedList()
val nrDcCombos = getNrDcBandCombinations(nr, saCombos)

val nrDcCombos = getNrDcBandCombinations(nr, nrCaCombos)
val nrDcComboWithFeatures =
linkFeaturesAndCarrier(
nrDcCombos,
Expand All @@ -172,6 +179,7 @@ object ImportCapabilityInformation : ImportCapabilities {
val (fr2, fr1) = combo.masterComponents.partition { it.isFR2 }
ComboNrDc(fr1, fr2, combo.featureSet, combo.bcs)
}

filterList.add(getUeNrCapabilityFilters(nr))
val release = parseAccessRelease(nrCapability)
val segSupported = parseSegSupportedNr(nr, release)
Expand Down Expand Up @@ -1600,6 +1608,66 @@ object ImportCapabilityInformation : ImportCapabilities {
return ueCapFilter
}

// R16 ul tx switch NRCA parsing. NRDC, ENDC, ul tx switch R17 and R18 not supported for lack of
// samples
private fun getUlTxSwitchBandCombinations(nrCapability: UENrCapabilityJson): List<ComboNr> {
val bandCombinationsPath = "rf-Parameters.supportedBandCombinationList-UplinkTxSwitch-r16"
val bandCombinationsList = nrCapability.rootJson.getArrayAtPath(bandCombinationsPath)

if (bandCombinationsList == null) return emptyList()

val list = mutableListWithCapacity<ComboNr>(bandCombinationsList.size)
for (bandCombination in bandCombinationsList) {
val bandCombinationR16 = bandCombination.getObject("bandCombination-r16")
val bandList = bandCombinationR16?.getArray("bandList") ?: continue
val nrBands = mutableListWithCapacity<ComponentNr>(bandList.size)

for (bandParameters in bandList) {
val component = parse5gBandParameters(bandParameters)
if (component is ComponentNr) {
nrBands.add(component)
}
}

val featureSetCombination = bandCombinationR16.getInt("featureSetCombination") ?: 0
val bcsString = bandCombinationR16.getString("supportedBandwidthCombinationSet") ?: "1"
val bcs = BCS.fromBinaryString(bcsString)

val bandPairs = bandCombination.getArray("supportedBandPairListNR-r16") ?: continue
val optionR16Str = bandCombination.getString("uplinkTxSwitching-OptionSupport-r16")
val optionR16 = UplinkTxSwitchOption.valueOf(optionR16Str)

for (pairs in bandPairs) {
// -1 because index start from 1
val ul1 = pairs.getInt("bandIndexUL1-r16")?.minus(1)
val ul2 = pairs.getInt("bandIndexUL2-r16")?.minus(1)

if (ul1 == null || ul2 == null) continue

var isSUL = false
val newBands =
nrBands.mapIndexed { index, band ->
if (index == ul1 || index == ul2) {
if (band.isSUL) isSUL = true
band.copy(ulTxSwitch = true)
} else {
band
}
}

// sul supports only option 1
val ulTxSwitchOption = if (isSUL) UplinkTxSwitchOption.SWITCHED_UL else optionR16

val type = UplinkTxSwitchType.R16
val ulTxSwitchConfig = UplinkTxSwitchConfig(type, ulTxSwitchOption)

val combo = ComboNr(newBands, featureSetCombination, bcs, listOf(ulTxSwitchConfig))
list.add(combo)
}
}
return list
}

private fun parseReceivedFilters(
receivedFilters: JsonObject,
ueCapFilter: IUeCapabilityFilter,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package it.smartphonecombo.uecapabilityparser.model

import kotlinx.serialization.Serializable

@Serializable
enum class UplinkTxSwitchOption {
NONE,
SWITCHED_UL,
DUAL_UL,
BOTH;

companion object {
fun valueOf(name: String?): UplinkTxSwitchOption {
return when (name) {
"switchedUL" -> SWITCHED_UL
"dualUL" -> DUAL_UL
"both" -> BOTH
else -> NONE
}
}
}
}

@Serializable
enum class UplinkTxSwitchType {
R16, // 1Tx-2Tx across 2 carriers
R17_1T2T, // 1Tx-2Tx across 3 carriers (1 + 2 contiguous)
R17_2T2T, // 2Tx-2Tx across 3 carriers (1 + 2 contiguous)
R18_1T, // 1Tx-1Tx, 1Tx-2Tx across 4 carriers
R18_2T, // 2Tx-2Tx across 4 carriers
}

@Serializable
data class UplinkTxSwitchConfig(val type: UplinkTxSwitchType, val option: UplinkTxSwitchOption)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package it.smartphonecombo.uecapabilityparser.model.combo
import it.smartphonecombo.uecapabilityparser.extension.populateCsvStringBuilders
import it.smartphonecombo.uecapabilityparser.model.BCS
import it.smartphonecombo.uecapabilityparser.model.EmptyBCS
import it.smartphonecombo.uecapabilityparser.model.UplinkTxSwitchConfig
import it.smartphonecombo.uecapabilityparser.model.component.ComponentNr
import it.smartphonecombo.uecapabilityparser.model.component.IComponent
import kotlinx.serialization.SerialName
Expand All @@ -13,6 +14,7 @@ import kotlinx.serialization.Transient
data class ComboNr(
@SerialName("components") override val masterComponents: List<ComponentNr>,
override val bcs: BCS = EmptyBCS,
val uplinkTxSwitch: List<UplinkTxSwitchConfig> = emptyList(),
) : ICombo {
@Transient
override var featureSet: Int = 0
Expand All @@ -22,7 +24,8 @@ data class ComboNr(
masterComponents: List<ComponentNr>,
featureSet: Int,
bcs: BCS,
) : this(masterComponents, bcs) {
uplinkTxSwitch: List<UplinkTxSwitchConfig> = emptyList(),
) : this(masterComponents, bcs, uplinkTxSwitch) {
this.featureSet = featureSet
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ data class ComponentNr(
@SerialName("maxScs") var scs: Int = 0,
@SerialName("maxBwDl") var maxBandwidthDl: Bandwidth = EmptyBandwidth,
@SerialName("maxBwUl") var maxBandwidthUl: Bandwidth = EmptyBandwidth,
@SerialName("ulTxSwitch") var ulTxSwitch: Boolean = false,
) : IComponent {

override fun compareTo(other: IComponent): Int {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/web
Submodule web updated 1527 files
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,14 @@ internal class ImportCapabilityInformationTest :
fun ueRedCapTDD() {
parse("ueRedCapTDD.json", "ueRedCapTDD.json")
}

@Test
fun ueCapNrUlTxSwitchR16() {
parse("ueCapNrUlTxSwitchR16.json", "ueCapNrUlTxSwitchR16.json")
}

@Test
fun ueCapNrUlTxSwitchR16_2() {
parse("ueCapNrUlTxSwitchR16_2.json", "ueCapNrUlTxSwitchR16_2.json")
}
}
Loading

0 comments on commit 028e671

Please sign in to comment.