Allow manual packet preparation outside the selected scan channels
This commit is contained in:
1 parent
c0204f6b02
commit
e64b69e50f
3 files changed
+7
-1
No files matched your search
@@ -1,6 +1,9 @@
|
||||
import {test} from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {canExpeditePacket,shouldAdvancePacketScan} from './packet-preparation.mjs';
|
||||
import {canExpeditePacket,shouldAdvancePacketScan,packetPreparationMode} from './packet-preparation.mjs';
|
||||
test('manual packet preparation is independent of listening channel selection',()=>{
|
||||
const selected=['7050000-USB','14122000-USB'];assert.equal(packetPreparationMode(selected,'144950000-DATA-FM'),'direct');assert.equal(packetPreparationMode([...selected,'144950000-DATA-FM'],'144950000-DATA-FM'),'scan');assert.deepEqual(selected,['7050000-USB','14122000-USB']);
|
||||
});
|
||||
test('a manual packet request may advance the scanner from either HF band while idle',()=>{
|
||||
const idle={request:{id:'new'},manualRequestId:null,ptt:false,connections:0,radioState:'Free',users:'',lastPtt:0,now:100000};
|
||||
assert.equal(canExpeditePacket(idle),true);assert.equal(canExpeditePacket({...idle,radioPorts:[4,7],users:'Attached to Port 2/1'}),true);assert.equal(canExpeditePacket({...idle,radioPorts:[4,7],users:'Attached to Port 7/1'}),false);
|
||||
|
||||
Reference in new issue
Block a user