feat: pin sends to testowy channel (index 2), never primary (v0.1.3) (#5)
CI / build + unit (push) Successful in 36s
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user