Hotspot UI

This commit is contained in:
Robin Davies
2021-08-22 11:51:09 -04:00
parent f6aa331d77
commit 865e23b413
51 changed files with 918 additions and 146 deletions
+21
View File
@@ -10,9 +10,30 @@
using namespace pipedal;
static WifiChannel GetChannel(std::vector<WifiChannel> channels, const std::string&channelId)
{
for (auto &channel: channels)
{
if (channel.channelId_ == channelId)
{
return channel;
}
}
throw PiPedalException("Channel not found.");;
}
TEST_CASE( "Wifi Channel Test", "[wifi_channels_test]" ) {
std::vector<WifiChannel> result = pipedal::getWifiChannels("CA");
// channel 36 is indoors only (CA)
WifiChannel channel = GetChannel(result,"a36");
REQUIRE(channel.channelName_.find("Indoors") != std::string::npos);
// channel 36 is not indoors only (US)
result = pipedal::getWifiChannels("US");
channel = GetChannel(result,"a36");
REQUIRE(channel.channelName_.find("Indoors") == std::string::npos);
}