Skip to content

Commit

Permalink
reduce cpu load
Browse files Browse the repository at this point in the history
  • Loading branch information
TalusL committed Jun 19, 2024
1 parent 6610e23 commit 7585619
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/wifi/WFBReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ bool WFBReceiver::Start(const std::string &vidPid, uint8_t channel, int channelW
try {
rtlDevice = wifi_driver.CreateRtlDevice(dev_handle);
rtlDevice->Init(
[](const Packet &p) { WFBReceiver::Instance().handle80211Frame(p); },
[](const Packet &p) {
WFBReceiver::Instance().handle80211Frame(p);
QmlNativeAPI::Instance().UpdateCount();
},
SelectedChannel {
.Channel = channel,
.ChannelOffset = 0,
Expand Down Expand Up @@ -141,13 +144,11 @@ bool WFBReceiver::Start(const std::string &vidPid, uint8_t channel, int channelW
void WFBReceiver::handle80211Frame(const Packet &packet) {

QmlNativeAPI::Instance().wifiFrameCount_++;
QmlNativeAPI::Instance().UpdateCount();
RxFrame frame(packet.Data);
if (!frame.IsValidWfbFrame()) {
return;
}
QmlNativeAPI::Instance().wfbFrameCount_++;
QmlNativeAPI::Instance().UpdateCount();

static int8_t rssi[4] = { 1, 1, 1, 1 };
static uint8_t antenna[4] = { 1, 1, 1, 1 };
Expand Down

0 comments on commit 7585619

Please sign in to comment.