Require protocol version 5 to send rescan devices packet and to show rescan button in clients list

This commit is contained in:
Adam Honse 2025-07-04 02:04:10 -05:00
parent c750158286
commit 5aaadf4e5a
2 changed files with 20 additions and 13 deletions

View file

@ -764,6 +764,8 @@ void NetworkClient::SendRequest_ProtocolVersion()
void NetworkClient::SendRequest_RescanDevices()
{
if(GetProtocolVersion() >= 5)
{
NetPacketHeader request_hdr;
InitNetPacketHeader(&request_hdr, 0, NET_PACKET_ID_REQUEST_RESCAN_DEVICES, 0);
@ -771,6 +773,7 @@ void NetworkClient::SendRequest_RescanDevices()
send_in_progress.lock();
send(client_sock, (char *)&request_hdr, sizeof(NetPacketHeader), MSG_NOSIGNAL);
send_in_progress.unlock();
}
}
void NetworkClient::SendRequest_RGBController_ClearSegments(unsigned int dev_idx, int zone)

View file

@ -173,8 +173,11 @@ void OpenRGBClientInfoPage::UpdateInfo()
signalMapperSave->setMapping(checkbox_save, arg_save);
/*-----------------------------------------------------*\
| Create the rescan button |
| Create the rescan button if protocol version is 5 or |
| greater |
\*-----------------------------------------------------*/
if(ResourceManager::get()->GetClients()[client_idx]->GetProtocolVersion() >= 5)
{
QPushButton* button_rescan = new QPushButton(tr("Rescan Devices"));
ui->ClientTree->setItemWidget(new_top_item, 3, button_rescan);
@ -185,6 +188,7 @@ void OpenRGBClientInfoPage::UpdateInfo()
arg_rescan->widget = button_rescan;
signalMapperRescan->setMapping(button_rescan, arg_rescan);
}
/*-----------------------------------------------------*\
| Create the disconnect button |