Skip to content

Commit 015d963

Browse files
Merge branch 'dev' into 'rolling'
[Modify]: Fixed aiting for voice to connect to the network cannot be stopped See merge request MiRoboticsLab/rop/interaction!65
2 parents 79a32f1 + 9d777f5 commit 015d963

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

connector/include/connector/connector.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ class Connector final : public rclcpp::Node
215215
bool connect_network_status = true;
216216
int connect_code = -1;
217217
bool bledfu_progress_status = true;
218+
bool camera_callback_flag = false;
218219
}; // class Connector
219220
} // namespace interaction
220221
} // namespace cyberdog

connector/src/connector.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ void Connector::CameraSignalCallback(const CameraMsg::SharedPtr msg)
563563
connect_document.HasMember(ip.c_str()) &&
564564
connect_document[ip.c_str()].IsString())
565565
{
566+
this->camera_callback_flag = true;
566567
if (this->DoConnect(
567568
connect_document[wifi_name.c_str()].GetString(),
568569
connect_document[wifi_password.c_str()].GetString(),
@@ -687,6 +688,13 @@ bool Connector::DoConnect(std::string name, std::string password, std::string pr
687688
return return_false("Wifi provider is empty.");
688689
}
689690
if (name == this->state_msg_.ssid) {
691+
if (this->camera_callback_flag) {
692+
this->camera_callback_flag = false;
693+
this->Interaction(AudioMsg::PID_WIFI_CONNECTION_SUCCEEDED_0);
694+
} else {
695+
this->CtrlAudio(9999);
696+
this->CtrlLed(AudioMsg::PID_WIFI_CONNECTION_SUCCEEDED_0);
697+
}
690698
return return_true(
691699
"The target wifi and the currently connected wifi are the same wifi.",
692700
true);

0 commit comments

Comments
 (0)