Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 811fd27c authored by Duy Truong's avatar Duy Truong Committed by Gerrit Code Review
Browse files

Merge "rootcanal: correctly handle error conditions in test command add_phy."

parents 8991a1d4 609ff7f6
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -188,15 +188,19 @@ void TestCommandHandler::Del(const vector<std::string>& args) {
}

void TestCommandHandler::AddPhy(const vector<std::string>& args) {
  if (args[0] == "LOW_ENERGY") {
  if (args.size() != 1) {
    response_string_ = "TestCommandHandler 'add_phy' takes one argument";
  } else if (args[0] == "LOW_ENERGY") {
    model_.AddPhy(Phy::Type::LOW_ENERGY);
    response_string_ = "TestCommandHandler 'add_phy' called with LOW_ENERGY";
  } else if (args[0] == "BR_EDR") {
    model_.AddPhy(Phy::Type::BR_EDR);
    response_string_ = "TestCommandHandler 'add_phy' called with BR_EDR";
  } else {
    response_string_ =
        "TestCommandHandler 'add_phy' with unrecognized type " + args[0];
    send_response_(response_string_);
  }
  send_response_(response_string_);
}

void TestCommandHandler::DelPhy(const vector<std::string>& args) {