Add signal connection status 'NoSuchTransmissionId'

This commit is contained in:
dijunkun
2023-12-04 14:04:36 +08:00
parent 5e2d27e9d2
commit ed8b536ac0
2 changed files with 12 additions and 5 deletions

View File

@@ -560,6 +560,13 @@ void ClientConnectionStatus(ConnectionStatus status) {
joined = false; joined = false;
connect_label = connect_button_pressed ? "Disconnect" : "Connect"; connect_label = connect_button_pressed ? "Disconnect" : "Connect";
} }
} else if (ConnectionStatus::NoSuchTransmissionId == status) {
client_connection_status_str = "No such transmission id";
if (connect_button_pressed) {
connect_button_pressed = false;
joined = false;
connect_label = connect_button_pressed ? "Disconnect" : "Connect";
}
} }
} }
@@ -1031,15 +1038,15 @@ int main() {
{ {
{ {
static char remote_id[20] = ""; static char remote_id[20] = "";
if (strcmp(remote_id, "") == 0) { // if (strcmp(remote_id, "") == 0) {
strcpy(remote_id, GetMac(mac_addr).c_str()); // strcpy(remote_id, GetMac(mac_addr).c_str());
} // }
ImGui::Text("REMOTE ID:"); ImGui::Text("REMOTE ID:");
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(95); ImGui::SetNextItemWidth(95);
ImGui::InputTextWithHint("##remote_id", mac_addr, remote_id, ImGui::InputTextWithHint("##remote_id", mac_addr, remote_id,
IM_ARRAYSIZE(remote_id), IM_ARRAYSIZE(remote_id),
ImGuiInputTextFlags_AllowTabInput); ImGuiInputTextFlags_CharsNoBlank);
ImGui::Spacing(); ImGui::Spacing();