mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 15:04:11 +00:00
Main thread using FreeRTOS notifications, added missing commands for firmware update
This commit is contained in:
parent
07ba714f1f
commit
8c33ae523a
11 changed files with 209 additions and 134 deletions
|
|
@ -157,6 +157,30 @@ bool Device::SendFirmwareChunk(Protocol::FirmwarePacket &fw)
|
|||
}
|
||||
}
|
||||
|
||||
bool Device::SendCommandWithoutPayload(Protocol::PacketType type)
|
||||
{
|
||||
if(m_connected) {
|
||||
unsigned char buffer[32];
|
||||
Protocol::PacketInfo p;
|
||||
p.type = type;
|
||||
unsigned int length = Protocol::EncodePacket(p, buffer, sizeof(buffer));
|
||||
if(!length) {
|
||||
qCritical() << "Failed to encode packet";
|
||||
return false;
|
||||
}
|
||||
int actual_length;
|
||||
auto ret = libusb_bulk_transfer(m_handle, EP_Data_Out_Addr, buffer, length, &actual_length, 0);
|
||||
if(ret < 0) {
|
||||
qCritical() << "Error sending data: "
|
||||
<< libusb_strerror((libusb_error) ret);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<QString> Device::GetDevices()
|
||||
{
|
||||
std::vector<QString> serials;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue