Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dp): Add carrier aggregation logic to AMC (#13379)
Signed-off-by: Kuba Marciniszyn <kuba@freedomfi.com>
- Loading branch information
Showing
38 changed files
with
957 additions
and
2,029 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 0 additions & 52 deletions
52
dp/cloud/go/active_mode_controller/internal/containers/min_queue_test.go
This file was deleted.
Oops, something went wrong.
71 changes: 0 additions & 71 deletions
71
dp/cloud/go/active_mode_controller/internal/containers/priority_queue.go
This file was deleted.
Oops, something went wrong.
51 changes: 0 additions & 51 deletions
51
dp/cloud/go/active_mode_controller/internal/containers/priority_queue_test.go
This file was deleted.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
.../active_mode_controller/internal/message_generator/message/store_available_frequencies.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
Copyright 2022 The Magma Authors. | ||
This source code is licensed under the BSD-style license found in the | ||
LICENSE file in the root directory of this source tree. | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package message | ||
|
||
import ( | ||
"context" | ||
"strconv" | ||
"strings" | ||
|
||
"magma/dp/cloud/go/active_mode_controller/protos/active_mode" | ||
) | ||
|
||
func NewStoreAvailableFrequenciesMessage(id int64, frequencies []uint32) *storeAvailableFrequenciesMessage { | ||
return &storeAvailableFrequenciesMessage{ | ||
id: id, | ||
frequencies: frequencies, | ||
} | ||
} | ||
|
||
type storeAvailableFrequenciesMessage struct { | ||
id int64 | ||
frequencies []uint32 | ||
} | ||
|
||
func (s *storeAvailableFrequenciesMessage) Send(ctx context.Context, provider ClientProvider) error { | ||
req := &active_mode.StoreAvailableFrequenciesRequest{ | ||
Id: s.id, | ||
AvailableFrequencies: s.frequencies, | ||
} | ||
client := provider.GetActiveModeClient() | ||
_, err := client.StoreAvailableFrequencies(ctx, req) | ||
return err | ||
} | ||
|
||
func (s *storeAvailableFrequenciesMessage) String() string { | ||
b := strings.Builder{} | ||
_, _ = b.WriteString("store available frequencies: ") | ||
_, _ = b.WriteString(strconv.FormatInt(s.id, 10)) | ||
_, _ = b.WriteString(" (") | ||
for i, f := range s.frequencies { | ||
_, _ = b.WriteString(strconv.FormatUint(uint64(f), 2)) | ||
if i != len(s.frequencies)-1 { | ||
_, _ = b.WriteString(", ") | ||
} | ||
} | ||
_, _ = b.WriteString(")") | ||
return b.String() | ||
} |
Oops, something went wrong.