// subsystems of a device.
interface IWificond {
- // Create a network interface suitable for use as an AP.
- IApInterface CreateApInterface();
+ // Create a network interface suitable for use as an AP.
+ IApInterface createApInterface();
- // Tear down all existing interfaces. This should enable clients to create
- // future interfaces immediately after this method returns.
- void TearDownInterfaces();
+ // Tear down all existing interfaces. This should enable clients to create
+ // future interfaces immediately after this method returns.
+ void tearDownInterfaces();
}
}
-Status Server::CreateApInterface(sp<IApInterface>* created_interface) {
+Status Server::createApInterface(sp<IApInterface>* created_interface) {
if (!ap_interfaces_.empty()) {
// In the future we may support multiple interfaces at once. However,
// today, we support just one.
return Status::ok();
}
-Status Server::TearDownInterfaces() {
+Status Server::tearDownInterfaces() {
if (!ap_interfaces_.empty()) {
ap_interfaces_.clear();
if (!driver_tool_->UnloadDriver()) {
std::unique_ptr<wifi_hal::DriverTool> driver_tool);
~Server() override = default;
- android::binder::Status CreateApInterface(
+ android::binder::Status createApInterface(
android::sp<android::net::wifi::IApInterface>* created_interface) override;
- android::binder::Status TearDownInterfaces() override;
+ android::binder::Status tearDownInterfaces() override;
private:
// Does the actual work of setting up an interface for a particular mode.
// We should be able to create an AP interface.
sp<IApInterface> ap_interface;
- ASSERT_TRUE(service->CreateApInterface(&ap_interface).isOk());
+ ASSERT_TRUE(service->createApInterface(&ap_interface).isOk());
// We should not be able to create two AP interfaces.
sp<IApInterface> ap_interface2;
- ASSERT_FALSE(service->CreateApInterface(&ap_interface2).isOk());
+ ASSERT_FALSE(service->createApInterface(&ap_interface2).isOk());
// We can tear down the created interface.
- ASSERT_TRUE(service->TearDownInterfaces().isOk());
+ ASSERT_TRUE(service->tearDownInterfaces().isOk());
}
} // namespace wificond
EXPECT_CALL(*driver_tool_, ChangeFirmwareMode(DriverTool::kFirmwareModeAp))
.InSequence(sequence)
.WillOnce(Return(true));
- EXPECT_TRUE(server_.CreateApInterface(&ap_if).isOk());
+ EXPECT_TRUE(server_.createApInterface(&ap_if).isOk());
EXPECT_NE(nullptr, ap_if.get());
}
TEST_F(ServerTest, DoesNotSupportMultipleInterfaces) {
sp<IApInterface> ap_if;
- EXPECT_TRUE(server_.CreateApInterface(&ap_if).isOk());
+ EXPECT_TRUE(server_.createApInterface(&ap_if).isOk());
EXPECT_NE(nullptr, ap_if.get());
ap_if = nullptr;
- EXPECT_FALSE(server_.CreateApInterface(&ap_if).isOk());
+ EXPECT_FALSE(server_.createApInterface(&ap_if).isOk());
EXPECT_EQ(nullptr, ap_if.get());
}
TEST_F(ServerTest, CanDestroyInterfaces) {
EXPECT_CALL(*driver_tool_, UnloadDriver()).Times(0);
sp<IApInterface> ap_if;
- EXPECT_TRUE(server_.CreateApInterface(&ap_if).isOk());
+ EXPECT_TRUE(server_.createApInterface(&ap_if).isOk());
// When we tear down the interface, we expect the driver to be unloaded.
EXPECT_CALL(*driver_tool_, UnloadDriver()).Times(1).WillOnce(Return(true));
- EXPECT_TRUE(server_.TearDownInterfaces().isOk());
+ EXPECT_TRUE(server_.tearDownInterfaces().isOk());
// After a teardown, we should be able to create another interface.
- EXPECT_TRUE(server_.CreateApInterface(&ap_if).isOk());
+ EXPECT_TRUE(server_.createApInterface(&ap_if).isOk());
}
} // namespace wificond