fix N1MM parsing: real band numbers, accept 0°, start the listener
- Map RadioInfo frequencies and rotor <freqband> to standard band numbers (1.8, 3.5, 5, 7 … 10000) instead of truncating to integers, so 160 m and 80 m no longer become bands 1 and 3. - A turn to azimuth 0 (north) was dropped by a falsy check. - Log malformed rotor packets instead of dropping them silently. - The UDP listener was left commented out; start it after the HTTP server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import RotClient from './RotClient.js';
|
||||
import type { FullConfig, StationConfig, DynamicData, InitialState, TurnMessage, TurnMessageHandler } from './types.js';
|
||||
import type { FullConfig, StationConfig, DynamicData, InitialState, RadioInfoMessage, TurnMessage, TurnMessageHandler } from './types.js';
|
||||
|
||||
export interface TurnEvent {
|
||||
label: string;
|
||||
@@ -42,7 +42,7 @@ export default class RotRouter implements TurnMessageHandler {
|
||||
return this.stations;
|
||||
}
|
||||
|
||||
handleRadioInfo(sourceIp: string, band: number, freq: number): void {
|
||||
handleRadioInfo({ sourceIp, band, freq }: RadioInfoMessage): void {
|
||||
const station = this.resolveStation(sourceIp);
|
||||
if (!station) return;
|
||||
this.radioInfoHandlers.forEach(h => h(station, band, freq));
|
||||
@@ -59,7 +59,7 @@ export default class RotRouter implements TurnMessageHandler {
|
||||
handleTurnMessage(msg: TurnMessage): void {
|
||||
const client = this.findClientForBand(msg.band);
|
||||
if (!client) {
|
||||
console.error(`No RotClient found for the ${msg.band} band!`);
|
||||
console.error(`No rotator configured for the ${msg.band} MHz band!`);
|
||||
return;
|
||||
}
|
||||
client.turn(msg.az);
|
||||
|
||||
Reference in New Issue
Block a user