feat: pin sends to testowy channel (index 2), never primary (v0.1.3) (#5)
CI / build + unit (push) Successful in 36s

feat: pin sends to testowy channel (index 2), never primary (v0.1.3)
This commit was merged in pull request #5.
This commit is contained in:
2026-09-23 22:06:01 +02:00
parent 266aadf635
commit 3062f40899
7 changed files with 72 additions and 6 deletions
+6 -1
View File
@@ -23,6 +23,11 @@ export class MeshService implements OnModuleInit, OnModuleDestroy {
process.env.MESH_RECONNECT_MS ?? '5000',
10,
);
// sends are pinned to the test channel ("testowy", index 2) on purpose — never the primary channel
private readonly sendChannel = parseInt(
process.env.MESH_SEND_CHANNEL ?? '2',
10,
);
private socket: net.Socket | null = null;
private buffer: Uint8Array = new Uint8Array(0);
@@ -75,7 +80,7 @@ export class MeshService implements OnModuleInit, OnModuleDestroy {
async sendText(to: number, text: string): Promise<number> {
if (!this.connected || !this.socket)
throw new ServiceUnavailableException('bridge not connected');
const { bytes, id } = await buildTextToRadio(to, text);
const { bytes, id } = await buildTextToRadio(to, text, this.sendChannel);
this.socket.write(bytes);
return id;
}