Skip to content

Commit

Permalink
Merge pull request #204 from microsoft/bandrename
Browse files Browse the repository at this point in the history
Rename 'Bands' fields in API types to 'FrequencyBands' for consistency.
  • Loading branch information
abeltrano authored Mar 3, 2024
2 parents fcbc3a7 + ebfa8bb commit e12cf20
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions protocol/protos/WifiCore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ message Dot11AccessPointConfiguration
Dot11PhyType PhyType = 3;
Dot11AuthenticationAlgorithm AuthenticationAlgorithm = 4;
Dot11CipherSuite CipherSuite = 5;
repeated Dot11FrequencyBand Bands = 6;
repeated Dot11FrequencyBand FrequencyBands = 6;
}

message Dot11AccessPointCapabilities
{
repeated Microsoft.Net.Wifi.Dot11FrequencyBand Bands = 1;
repeated Microsoft.Net.Wifi.Dot11FrequencyBand FrequencyBands = 1;
repeated Microsoft.Net.Wifi.Dot11PhyType PhyTypes = 2;
repeated Microsoft.Net.Wifi.Dot11AkmSuite AkmSuites = 3;
repeated Microsoft.Net.Wifi.Dot11CipherSuite CipherSuites = 4;
Expand Down
2 changes: 1 addition & 1 deletion src/common/service/NetRemoteService.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ NetRemoteService::WifiAccessPointEnableImpl(std::string_view accessPointId, cons
}
}

if (!std::empty(dot11AccessPointConfiguration->bands())) {
if (!std::empty(dot11AccessPointConfiguration->frequencybands())) {
auto dot11FrequencyBands = ToDot11FrequencyBands(*dot11AccessPointConfiguration);
wifiOperationStatus = WifiAccessPointSetFrequencyBandsImpl(accessPointId, dot11FrequencyBands, accessPointController);
if (wifiOperationStatus.code() != WifiAccessPointOperationStatusCode::WifiAccessPointOperationStatusCodeSucceeded) {
Expand Down
2 changes: 1 addition & 1 deletion src/common/tools/cli/NetRemoteCliHandlerOperations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ NetRemoteAccessPointCapabilitiesToString(const Microsoft::Net::Wifi::Dot11Access
ss << '\n'
<< indent0
<< "Bands:";
for (const auto& band : accessPointCapabilities.bands()) {
for (const auto& band : accessPointCapabilities.frequencybands()) {
std::string_view bandName(magic_enum::enum_name(static_cast<Microsoft::Net::Wifi::Dot11FrequencyBand>(band)));
bandName.remove_prefix(BandPrefixLength);
ss << '\n'
Expand Down
6 changes: 3 additions & 3 deletions src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ ToDot11FrequencyBands(const WifiAccessPointSetFrequencyBandsRequest& request) no
std::vector<Dot11FrequencyBand>
ToDot11FrequencyBands(const Dot11AccessPointConfiguration& dot11AccessPointConfiguration) noexcept
{
std::vector<Dot11FrequencyBand> dot11FrequencyBands(static_cast<std::size_t>(std::size(dot11AccessPointConfiguration.bands())));
std::ranges::transform(dot11AccessPointConfiguration.bands(), std::begin(dot11FrequencyBands), detail::toDot11FrequencyBand);
std::vector<Dot11FrequencyBand> dot11FrequencyBands(static_cast<std::size_t>(std::size(dot11AccessPointConfiguration.frequencybands())));
std::ranges::transform(dot11AccessPointConfiguration.frequencybands(), std::begin(dot11FrequencyBands), detail::toDot11FrequencyBand);

return dot11FrequencyBands;
}
Expand Down Expand Up @@ -444,7 +444,7 @@ ToDot11AccessPointCapabilities(const Ieee80211AccessPointCapabilities& ieee80211
std::vector<Dot11FrequencyBand> bands(std::size(ieee80211AccessPointCapabilities.FrequencyBands));
std::ranges::transform(ieee80211AccessPointCapabilities.FrequencyBands, std::begin(bands), ToDot11FrequencyBand);

*dot11Capabilities.mutable_bands() = {
*dot11Capabilities.mutable_frequencybands() = {
std::make_move_iterator(std::begin(bands)),
std::make_move_iterator(std::end(bands))
};
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/TestNetRemoteServiceClient.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ TEST_CASE("WifiAccessPointEnable API", "[basic][rpc][client][remote]")
apConfiguration.set_phytype(Dot11PhyType::Dot11PhyTypeA);
apConfiguration.set_authenticationalgorithm(Dot11AuthenticationAlgorithm::Dot11AuthenticationAlgorithmSharedKey);
apConfiguration.set_ciphersuite(Dot11CipherSuite::Dot11CipherSuiteCcmp256);
apConfiguration.mutable_bands()->Add(Dot11FrequencyBand::Dot11FrequencyBand2_4GHz);
apConfiguration.mutable_bands()->Add(Dot11FrequencyBand::Dot11FrequencyBand5_0GHz);
apConfiguration.mutable_frequencybands()->Add(Dot11FrequencyBand::Dot11FrequencyBand2_4GHz);
apConfiguration.mutable_frequencybands()->Add(Dot11FrequencyBand::Dot11FrequencyBand5_0GHz);

WifiAccessPointEnableRequest request{};
request.set_accesspointid(InterfaceName1);
Expand Down Expand Up @@ -169,7 +169,7 @@ TEST_CASE("WifiAccessPointEnable API", "[basic][rpc][client][remote]")
apConfiguration.set_phytype(Dot11PhyType::Dot11PhyTypeA);
apConfiguration.set_authenticationalgorithm(Dot11AuthenticationAlgorithm::Dot11AuthenticationAlgorithmSharedKey);
apConfiguration.set_ciphersuite(Dot11CipherSuite::Dot11CipherSuiteCcmp256);
apConfiguration.mutable_bands()->Add(Dot11FrequencyBand::Dot11FrequencyBand2_4GHz);
apConfiguration.mutable_frequencybands()->Add(Dot11FrequencyBand::Dot11FrequencyBand2_4GHz);

WifiAccessPointEnableRequest request{};
request.set_accesspointid(InterfaceName1);
Expand Down

0 comments on commit e12cf20

Please sign in to comment.