Просмотр исходного кода

fix(agents): show the two-argument beacon pairing command (#1746)

The pairing command the UI prints takes three arguments, but the RTLPlayground firmware parser stores the second one as the token, so the slug ended up saved as the token and the pairing failed.

The slug is not an argument: `beacon.c` reads it from the device hostname.

- `AgentsSection.tsx`: the tooltip and the visible command now show `beacon <ip-netpulse> <token>`.
- `doc/BEACON.md`: same fix, plus a note on where the slug comes from and why a third argument breaks the pairing.

Verified against the firmware, not the issue: `cmd_parser.c` takes `cmd_words_b[2]` as the beacon token, and `beacon.c` builds the slug from `hostname`.

`npm run build` and `eslint` pass, and the built bundle no longer contains the three-argument form.

Closes #1730
Nacho 1 месяц назад
Родитель
Сommit
484fcb6512
2 измененных файлов с 9 добавлено и 4 удалено
  1. 2 2
      app/src/components/routers/AgentsSection.tsx
  2. 7 2
      doc/BEACON.md

+ 2 - 2
app/src/components/routers/AgentsSection.tsx

@@ -669,8 +669,8 @@ function DiscoveredStrip() {
             <span className="text-caption font-medium text-text-primary">{c.dev}</span>
             {c.fw && <span className="rounded-full border border-border px-2 py-0.5 font-mono text-[10px] text-text-muted">{c.fw}</span>}
             {pairState.token ? (
-              <code className="min-w-0 flex-1 truncate rounded-lg bg-canvas px-2 py-1 font-mono text-caption text-ok" title={`beacon <ip-netpulse> <slug> <token>`}>
-                beacon &lt;ip-netpulse&gt; &lt;slug&gt; {pairState.token.slice(0, 12)}…
+              <code className="min-w-0 flex-1 truncate rounded-lg bg-canvas px-2 py-1 font-mono text-caption text-ok" title={`beacon <ip-netpulse> <token>`}>
+                beacon &lt;ip-netpulse&gt; {pairState.token.slice(0, 12)}…
               </code>
             ) : (
               <>

+ 7 - 2
doc/BEACON.md

@@ -85,10 +85,15 @@ otras integraciones los usan, pero este firmware no los emitirá.
 ## Comando de configuración (consola + Advanced Settings)
 
 ```
-beacon <ip-netpulse> <slug> <token>     # pareo: unicast + token
-beacon off                               # apaga beacon y announce
+beacon <ip-netpulse> <token>     # pareo: unicast + token
+beacon off                       # apaga beacon y announce
 ```
 
+El `slug` no va en el comando: el firmware lo toma del `hostname` del
+equipo y debe coincidir con el slug con el que NetPulse registra el
+agente. Con un tercer argumento, el parser toma el segundo (el slug)
+como token y el pareo falla.
+
 Puerto destino (5140) y cadencia (30 s / 60 s announce) fijos en código.
 
 ## Modelo de seguridad (decisión consciente v1)