aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/main.go b/app/main.go
index 46da46d..b9be1e5 100644
--- a/app/main.go
+++ b/app/main.go
@@ -31,7 +31,9 @@ func main() {
receivedData := string(buf[:size])
fmt.Printf("Received %d bytes from %s: %s\n", size, source, receivedData)
- response := []byte{}
+ response := make([]byte, 12)
+ copy(response, buf[:12])
+ response[2] = flipIndicator(response[2])
_, err = udpConn.WriteToUDP(response, source)
if err != nil {
@@ -39,3 +41,7 @@ func main() {
}
}
}
+
+func flipIndicator(b byte) byte {
+ return b | 0b10000000
+}