Skip to content

Commit

Permalink
fix(dp): fixed get cbsd state response (magma#13145)
Browse files Browse the repository at this point in the history
Signed-off-by: Wojciech Sadowy <wojciech.sadowy@freedomfi.com>

Co-authored-by: Wojciech Sadowy <wojciech.sadowy@freedomfi.com>
  • Loading branch information
2 people authored and bhuvaneshne committed Jul 1, 2022
1 parent c25efcc commit 7efbf16
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ def _build_result(self, cbsd: Optional[DBCbsd] = None, session: Optional[Session
if not grants or cbsd.is_deleted:
return CBSDStateResult(radio_enabled=False)
channels = self._build_lte_channels(grants)
logger.debug("grants=")
return CBSDStateResult(
radio_enabled=True,
carrier_aggregation_enabled=cbsd.carrier_aggregation_enabled,
channel=channels[0],
channels=channels,
)

def _build_lte_channels(self, grants: List[DBChannel]) -> List[LteChannel]:
Expand Down
7 changes: 7 additions & 0 deletions dp/cloud/python/magma/test_runner/tests/api_data_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,11 @@ def build_grant_state_data(self, frequenzy_mhz=None, bandwidth_mhz=None, max_eir
high_frequency_hz=frequency_hz + half_bandwidth_hz,
max_eirp_dbm_mhz=max_eirp,
),
channels=[
LteChannel(
low_frequency_hz=frequency_hz - half_bandwidth_hz,
high_frequency_hz=frequency_hz + half_bandwidth_hz,
max_eirp_dbm_mhz=max_eirp,
),
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ def _build_get_state_result() -> CBSDStateResult:
high_frequency_hz=3630_000_000,
max_eirp_dbm_mhz=28.0,
),
channels=[
LteChannel(
low_frequency_hz=3620_000_000,
high_frequency_hz=3630_000_000,
max_eirp_dbm_mhz=28.0,
),
],
)

@staticmethod
Expand Down

0 comments on commit 7efbf16

Please sign in to comment.