feat(12-01): add RF monitor collector, WIRELESS_REGISTRATIONS stream, wire into poll cycle
- RFMonitorStats struct for per-interface RF data (noise floor, channel width, TX power) - CollectRFMonitor with v6/v7 RouterOS version routing - WIRELESS_REGISTRATIONS NATS stream with 30-day retention (separate from DEVICE_EVENTS) - WirelessRegistrationEvent type and PublishWirelessRegistrations method - Poll cycle collects per-client registrations and RF stats, publishes combined event Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
32
poller/internal/device/rf_monitor_test.go
Normal file
32
poller/internal/device/rf_monitor_test.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package device
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRFMonitorStatsFields(t *testing.T) {
|
||||
// Compilation test: ensure RFMonitorStats has all required fields
|
||||
// with correct types.
|
||||
stats := RFMonitorStats{
|
||||
Interface: "wlan1",
|
||||
NoiseFloor: -105,
|
||||
ChannelWidth: "20MHz",
|
||||
TxPower: 24,
|
||||
RegisteredClients: 15,
|
||||
}
|
||||
if stats.Interface != "wlan1" {
|
||||
t.Error("Interface field not set correctly")
|
||||
}
|
||||
if stats.NoiseFloor != -105 {
|
||||
t.Error("NoiseFloor field not set correctly")
|
||||
}
|
||||
if stats.ChannelWidth != "20MHz" {
|
||||
t.Error("ChannelWidth field not set correctly")
|
||||
}
|
||||
if stats.TxPower != 24 {
|
||||
t.Error("TxPower field not set correctly")
|
||||
}
|
||||
if stats.RegisteredClients != 15 {
|
||||
t.Error("RegisteredClients field not set correctly")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user