Skip to content

Commit

Permalink
remove spin_once and add processAllPackets()
Browse files Browse the repository at this point in the history
  • Loading branch information
whoenig committed Nov 1, 2023
1 parent 87d0d73 commit e160121
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/crazyflie_cpp/Crazyflie.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class Crazyflie
float qx, float qy, float qz, float qw);

void sendPing();
void spin_once();
void processAllPackets();
void reboot();
#if 0
// returns new address
Expand Down
12 changes: 8 additions & 4 deletions src/Crazyflie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,15 @@ void Crazyflie::sendPing()
}
}

void Crazyflie::spin_once()
void Crazyflie::processAllPackets()
{
auto p = m_connection.receive(bitcraze::crazyflieLinkCpp::Connection::TimeoutNone);
if (p.valid()) {
processPacket(p);
while (true) {
auto p = m_connection.receive(bitcraze::crazyflieLinkCpp::Connection::TimeoutNone);
if (p.valid()) {
processPacket(p);
} else {
break;
}
}
}

Expand Down

0 comments on commit e160121

Please sign in to comment.