Skip to content

Commit

Permalink
Merge branch 'dev' into 'rolling'
Browse files Browse the repository at this point in the history
[Modify]: Fixed aiting for voice to connect to the network cannot be stopped

See merge request MiRoboticsLab/rop/interaction!65
  • Loading branch information
xiaomi-robot-liukai committed Dec 25, 2023
2 parents 79a32f1 + 9d777f5 commit 015d963
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions connector/include/connector/connector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ class Connector final : public rclcpp::Node
bool connect_network_status = true;
int connect_code = -1;
bool bledfu_progress_status = true;
bool camera_callback_flag = false;
}; // class Connector
} // namespace interaction
} // namespace cyberdog
Expand Down
8 changes: 8 additions & 0 deletions connector/src/connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ void Connector::CameraSignalCallback(const CameraMsg::SharedPtr msg)
connect_document.HasMember(ip.c_str()) &&
connect_document[ip.c_str()].IsString())
{
this->camera_callback_flag = true;
if (this->DoConnect(
connect_document[wifi_name.c_str()].GetString(),
connect_document[wifi_password.c_str()].GetString(),
Expand Down Expand Up @@ -687,6 +688,13 @@ bool Connector::DoConnect(std::string name, std::string password, std::string pr
return return_false("Wifi provider is empty.");
}
if (name == this->state_msg_.ssid) {
if (this->camera_callback_flag) {
this->camera_callback_flag = false;
this->Interaction(AudioMsg::PID_WIFI_CONNECTION_SUCCEEDED_0);
} else {
this->CtrlAudio(9999);
this->CtrlLed(AudioMsg::PID_WIFI_CONNECTION_SUCCEEDED_0);
}
return return_true(
"The target wifi and the currently connected wifi are the same wifi.",
true);
Expand Down

0 comments on commit 015d963

Please sign in to comment.