From d325ee6a2d07eac3e62380160c0a3a95b137bf88 Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 30 Oct 2025 19:08:42 -0500 Subject: [PATCH] Update UDPInterface Send method to return an error for unsupported UDP functionality in TinyGo --- pkg/interfaces/udp.go | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/pkg/interfaces/udp.go b/pkg/interfaces/udp.go index df631c1..de2b049 100644 --- a/pkg/interfaces/udp.go +++ b/pkg/interfaces/udp.go @@ -76,28 +76,8 @@ func (ui *UDPInterface) Detach() { } func (ui *UDPInterface) Send(data []byte, addr string) error { - log.Printf("[DEBUG-7] UDP interface %s: Sending %d bytes", ui.Name, len(data)) - - if !ui.IsEnabled() { - return fmt.Errorf("interface not enabled") - } - - if ui.targetAddr == nil { - return fmt.Errorf("no target address configured") - } - - // Update TX stats before sending - ui.mutex.Lock() - ui.TxBytes += uint64(len(data)) - ui.mutex.Unlock() - - _, err := ui.conn.WriteTo(data, ui.targetAddr) - if err != nil { - log.Printf("[DEBUG-1] UDP interface %s: Write failed: %v", ui.Name, err) - } else { - log.Printf("[DEBUG-7] UDP interface %s: Sent %d bytes successfully", ui.Name, len(data)) - } - return err + // TinyGo doesn't support UDP sending + return fmt.Errorf("UDPInterface Send not supported in TinyGo - requires UDP client functionality") } func (ui *UDPInterface) SetPacketCallback(callback common.PacketCallback) {