Skip to content

Commit

Permalink
Making LinkUniversal::send(...) return bool, honoring LinkWireless' r…
Browse files Browse the repository at this point in the history
…esponse
  • Loading branch information
afska committed Feb 24, 2024
1 parent b8540e7 commit c804eb9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/LinkUniversal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,16 @@ class LinkUniversal {

u16 peek(u8 playerId) { return incomingMessages[playerId].peek(); }

void send(u16 data) {
bool send(u16 data) {
if (data == LINK_CABLE_DISCONNECTED || data == LINK_CABLE_NO_DATA)
return;
return false;

if (mode == LINK_CABLE)
if (mode == LINK_CABLE) {
linkCable->send(data);
else
linkWireless->send(data);
return true;
} else {
return linkWireless->send(data);
}
}

State getState() { return state; }
Expand Down

0 comments on commit c804eb9

Please sign in to comment.