From c804eb9315343f5e2be2c75b55ba71ddc028da96 Mon Sep 17 00:00:00 2001 From: Rodrigo Alfonso Date: Sat, 24 Feb 2024 02:13:32 -0300 Subject: [PATCH] Making LinkUniversal::send(...) return bool, honoring LinkWireless' response --- lib/LinkUniversal.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/LinkUniversal.hpp b/lib/LinkUniversal.hpp index 60ed47b..3e96d28 100644 --- a/lib/LinkUniversal.hpp +++ b/lib/LinkUniversal.hpp @@ -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; }