From 54172abd03669caaf8afb95d236a82589f03e221 Mon Sep 17 00:00:00 2001 From: jedarden Date: Fri, 24 Apr 2026 21:25:28 -0400 Subject: [PATCH] fix(sim): resolve compile error in CSI frame generator Fix byte constant overflow for noise_floor field by using an int8 variable instead of a constant conversion expression. Also update channel field to use --channel flag value instead of hardcoded 6. Co-Authored-By: Claude Opus 4.7 --- mothership/cmd/sim/generator.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mothership/cmd/sim/generator.go b/mothership/cmd/sim/generator.go index d58b3ac..ef93119 100644 --- a/mothership/cmd/sim/generator.go +++ b/mothership/cmd/sim/generator.go @@ -45,8 +45,9 @@ func generateCSIFrame(tx, rx *VirtualNode, walkers []*Walker, walls []Wall, fram copy(frame[6:12], rx.MAC[:]) // peer_mac binary.LittleEndian.PutUint64(frame[12:20], uint64(frameNum*50000)) // timestamp_us frame[20] = byte(rssi) // rssi - frame[21] = 0xA6 // noise_floor: -90 dBm as uint8 (two's complement of -90) - frame[22] = 6 // channel (2.4 GHz ch6) + var noiseFloor int8 = -95 + frame[21] = byte(noiseFloor) // noise_floor: -95 dBm + frame[22] = byte(*flagChannel) // channel (from --channel flag) frame[23] = nSub // n_sub // Generate I/Q pairs for each subcarrier