hamlib 0.3.3 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -24
- package/index.d.ts +84 -137
- package/lib/index.js +101 -407
- package/lib/spectrum.d.ts +63 -0
- package/lib/spectrum.js +364 -0
- package/lib/spectrum.mjs +7 -0
- package/package.json +17 -1
- package/prebuilds/darwin-arm64/libhamlib.4.dylib +0 -0
- package/prebuilds/darwin-arm64/node.napi.node +0 -0
- package/prebuilds/darwin-x64/libhamlib.4.dylib +0 -0
- package/prebuilds/darwin-x64/node.napi.node +0 -0
- package/prebuilds/linux-arm64/libhamlib.so +0 -0
- package/prebuilds/linux-arm64/libhamlib.so.4 +0 -0
- package/prebuilds/linux-arm64/libhamlib.so.4.0.7 +0 -0
- package/prebuilds/linux-arm64/node.napi.node +0 -0
- package/prebuilds/linux-x64/libhamlib.so +0 -0
- package/prebuilds/linux-x64/libhamlib.so.4 +0 -0
- package/prebuilds/linux-x64/libhamlib.so.4.0.7 +0 -0
- package/prebuilds/linux-x64/node.napi.node +0 -0
- package/prebuilds/win32-x64/hamlib_shim.dll +0 -0
- package/prebuilds/win32-x64/node.napi.node +0 -0
- package/spectrum.d.ts +2 -0
- package/spectrum.js +1 -0
- package/spectrum.mjs +2 -0
- package/src/hamlib.cpp +173 -133
- package/src/shim/hamlib_shim.c +8 -0
- package/src/shim/hamlib_shim.h +3 -1
package/index.d.ts
CHANGED
|
@@ -59,9 +59,27 @@ interface AntennaInfo {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* VFO
|
|
62
|
+
* Hamlib VFO token.
|
|
63
|
+
* 实际支持的 token 取决于具体 backend / 电台型号。
|
|
63
64
|
*/
|
|
64
|
-
type VFO =
|
|
65
|
+
type VFO =
|
|
66
|
+
| 'VFOA'
|
|
67
|
+
| 'VFOB'
|
|
68
|
+
| 'VFOC'
|
|
69
|
+
| 'currVFO'
|
|
70
|
+
| 'VFO'
|
|
71
|
+
| 'MEM'
|
|
72
|
+
| 'Main'
|
|
73
|
+
| 'Sub'
|
|
74
|
+
| 'TX'
|
|
75
|
+
| 'RX'
|
|
76
|
+
| 'MainA'
|
|
77
|
+
| 'MainB'
|
|
78
|
+
| 'MainC'
|
|
79
|
+
| 'SubA'
|
|
80
|
+
| 'SubB'
|
|
81
|
+
| 'SubC'
|
|
82
|
+
| 'Other';
|
|
65
83
|
|
|
66
84
|
/**
|
|
67
85
|
* Radio mode type
|
|
@@ -251,7 +269,7 @@ interface SplitStatusInfo {
|
|
|
251
269
|
/** Split enabled status */
|
|
252
270
|
enabled: boolean;
|
|
253
271
|
/** TX VFO */
|
|
254
|
-
txVfo:
|
|
272
|
+
txVfo: VFO;
|
|
255
273
|
}
|
|
256
274
|
|
|
257
275
|
/**
|
|
@@ -410,10 +428,9 @@ declare class HamLib extends EventEmitter {
|
|
|
410
428
|
/**
|
|
411
429
|
* Set Hamlib debug level (affects all instances globally)
|
|
412
430
|
* Controls the verbosity of Hamlib library debug output.
|
|
413
|
-
* By default, debug level is set to 0 (NONE) to prevent unwanted output.
|
|
414
431
|
*
|
|
415
432
|
* @param level Debug level:
|
|
416
|
-
* - 0 = NONE (no debug output)
|
|
433
|
+
* - 0 = NONE (no debug output)
|
|
417
434
|
* - 1 = BUG (serious bug messages only)
|
|
418
435
|
* - 2 = ERR (error messages)
|
|
419
436
|
* - 3 = WARN (warning messages)
|
|
@@ -421,7 +438,7 @@ declare class HamLib extends EventEmitter {
|
|
|
421
438
|
* - 5 = TRACE (trace messages - very detailed)
|
|
422
439
|
* @static
|
|
423
440
|
* @example
|
|
424
|
-
* // Disable all debug output
|
|
441
|
+
* // Disable all debug output
|
|
425
442
|
* HamLib.setDebugLevel(0);
|
|
426
443
|
*
|
|
427
444
|
* // Enable verbose debugging for troubleshooting
|
|
@@ -451,7 +468,7 @@ declare class HamLib extends EventEmitter {
|
|
|
451
468
|
|
|
452
469
|
/**
|
|
453
470
|
* Set VFO (Variable Frequency Oscillator)
|
|
454
|
-
* @param vfo VFO identifier, typically '
|
|
471
|
+
* @param vfo VFO identifier, typically 'VFOA' or 'VFOB'
|
|
455
472
|
* @throws Throws error when device doesn't support or operation fails
|
|
456
473
|
*/
|
|
457
474
|
setVfo(vfo: VFO): Promise<number>;
|
|
@@ -459,11 +476,11 @@ declare class HamLib extends EventEmitter {
|
|
|
459
476
|
/**
|
|
460
477
|
* Set frequency
|
|
461
478
|
* @param frequency Frequency value in hertz
|
|
462
|
-
* @param vfo Optional VFO to set frequency on ('
|
|
479
|
+
* @param vfo Optional VFO to set frequency on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
463
480
|
* @example
|
|
464
481
|
* await rig.setFrequency(144390000); // Set to 144.39MHz on current VFO
|
|
465
|
-
* await rig.setFrequency(144390000, '
|
|
466
|
-
* await rig.setFrequency(144390000, '
|
|
482
|
+
* await rig.setFrequency(144390000, 'VFOA'); // Set to 144.39MHz on VFOA
|
|
483
|
+
* await rig.setFrequency(144390000, 'VFOB'); // Set to 144.39MHz on VFOB
|
|
467
484
|
*/
|
|
468
485
|
setFrequency(frequency: number, vfo?: VFO): Promise<number>;
|
|
469
486
|
|
|
@@ -471,11 +488,11 @@ declare class HamLib extends EventEmitter {
|
|
|
471
488
|
* Set radio mode
|
|
472
489
|
* @param mode Radio mode (such as 'USB', 'LSB', 'FM', 'PKTFM')
|
|
473
490
|
* @param bandwidth Optional bandwidth setting ('narrow', 'wide', or default)
|
|
474
|
-
* @param vfo Optional VFO to set mode on ('
|
|
491
|
+
* @param vfo Optional VFO to set mode on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
475
492
|
* @example
|
|
476
493
|
* await rig.setMode('USB');
|
|
477
494
|
* await rig.setMode('FM', 'narrow');
|
|
478
|
-
* await rig.setMode('USB', 'wide', '
|
|
495
|
+
* await rig.setMode('USB', 'wide', 'VFOA');
|
|
479
496
|
*/
|
|
480
497
|
setMode(mode: RadioMode, bandwidth?: 'narrow' | 'wide', vfo?: VFO): Promise<number>;
|
|
481
498
|
|
|
@@ -490,16 +507,16 @@ declare class HamLib extends EventEmitter {
|
|
|
490
507
|
* Get current VFO
|
|
491
508
|
* @returns Current VFO identifier
|
|
492
509
|
*/
|
|
493
|
-
getVfo(): Promise<
|
|
510
|
+
getVfo(): Promise<VFO>;
|
|
494
511
|
|
|
495
512
|
/**
|
|
496
513
|
* Get current frequency
|
|
497
|
-
* @param vfo Optional VFO to get frequency from ('
|
|
514
|
+
* @param vfo Optional VFO to get frequency from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
498
515
|
* @returns Current frequency value in hertz
|
|
499
516
|
* @example
|
|
500
517
|
* await rig.getFrequency(); // Get frequency from current VFO
|
|
501
|
-
* await rig.getFrequency('
|
|
502
|
-
* await rig.getFrequency('
|
|
518
|
+
* await rig.getFrequency('VFOA'); // Get frequency from VFOA
|
|
519
|
+
* await rig.getFrequency('VFOB'); // Get frequency from VFOB
|
|
503
520
|
*/
|
|
504
521
|
getFrequency(vfo?: VFO): Promise<number>;
|
|
505
522
|
|
|
@@ -512,11 +529,11 @@ declare class HamLib extends EventEmitter {
|
|
|
512
529
|
|
|
513
530
|
/**
|
|
514
531
|
* Get current signal strength
|
|
515
|
-
* @param vfo Optional VFO to get signal strength from ('
|
|
532
|
+
* @param vfo Optional VFO to get signal strength from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
516
533
|
* @returns Signal strength value
|
|
517
534
|
* @example
|
|
518
535
|
* const strength = await rig.getStrength(); // Get strength from current VFO
|
|
519
|
-
* const strengthA = await rig.getStrength('
|
|
536
|
+
* const strengthA = await rig.getStrength('VFOA'); // Get strength from VFOA
|
|
520
537
|
*/
|
|
521
538
|
getStrength(vfo?: VFO): Promise<number>;
|
|
522
539
|
|
|
@@ -550,10 +567,10 @@ declare class HamLib extends EventEmitter {
|
|
|
550
567
|
/**
|
|
551
568
|
* Get memory channel data
|
|
552
569
|
* @param channelNumber Memory channel number
|
|
553
|
-
* @param readOnly Whether to read in read-only mode
|
|
570
|
+
* @param readOnly Whether to read in read-only mode
|
|
554
571
|
* @returns Channel data
|
|
555
572
|
*/
|
|
556
|
-
getMemoryChannel(channelNumber: number, readOnly
|
|
573
|
+
getMemoryChannel(channelNumber: number, readOnly: boolean): Promise<MemoryChannelInfo>;
|
|
557
574
|
|
|
558
575
|
/**
|
|
559
576
|
* Select memory channel for operation
|
|
@@ -598,15 +615,8 @@ declare class HamLib extends EventEmitter {
|
|
|
598
615
|
/**
|
|
599
616
|
* Start scanning operation
|
|
600
617
|
* @param scanType Scan type ('VFO', 'MEM', 'PROG', 'DELTA', 'PRIO')
|
|
601
|
-
* @param callback Callback function
|
|
602
|
-
*/
|
|
603
|
-
startScan(scanType: ScanType): Promise<number>;
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* Start scanning operation with channel
|
|
607
618
|
* @param scanType Scan type ('VFO', 'MEM', 'PROG', 'DELTA', 'PRIO')
|
|
608
619
|
* @param channel Channel number for some scan types
|
|
609
|
-
* @param callback Callback function
|
|
610
620
|
*/
|
|
611
621
|
startScan(scanType: ScanType, channel: number): Promise<number>;
|
|
612
622
|
|
|
@@ -622,15 +632,15 @@ declare class HamLib extends EventEmitter {
|
|
|
622
632
|
* @param levelType Level type ('AF', 'RF', 'SQL', 'RFPOWER', etc.)
|
|
623
633
|
* @param value Level value (0.0-1.0 typically)
|
|
624
634
|
*/
|
|
625
|
-
setLevel(levelType: LevelType, value: number, vfo?:
|
|
635
|
+
setLevel(levelType: LevelType, value: number, vfo?: VFO): Promise<number>;
|
|
626
636
|
|
|
627
637
|
/**
|
|
628
638
|
* Get radio level
|
|
629
639
|
* @param levelType Level type ('AF', 'RF', 'SQL', 'STRENGTH', etc.)
|
|
630
|
-
* @param vfo Optional
|
|
640
|
+
* @param vfo Optional Hamlib VFO token. If not specified, uses current VFO.
|
|
631
641
|
* @returns Level value
|
|
632
642
|
*/
|
|
633
|
-
getLevel(levelType: LevelType, vfo?:
|
|
643
|
+
getLevel(levelType: LevelType, vfo?: VFO): Promise<number>;
|
|
634
644
|
|
|
635
645
|
/**
|
|
636
646
|
* Get list of supported level types
|
|
@@ -674,13 +684,13 @@ declare class HamLib extends EventEmitter {
|
|
|
674
684
|
/**
|
|
675
685
|
* Set split mode TX frequency
|
|
676
686
|
* @param txFrequency TX frequency in Hz
|
|
677
|
-
* @param vfo Optional VFO to set TX frequency on ('
|
|
687
|
+
* @param vfo Optional VFO to set TX frequency on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
678
688
|
*/
|
|
679
689
|
setSplitFreq(txFrequency: number, vfo?: VFO): Promise<number>;
|
|
680
690
|
|
|
681
691
|
/**
|
|
682
692
|
* Get split mode TX frequency
|
|
683
|
-
* @param vfo Optional VFO to get TX frequency from ('
|
|
693
|
+
* @param vfo Optional VFO to get TX frequency from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
684
694
|
* @returns TX frequency in Hz
|
|
685
695
|
*/
|
|
686
696
|
getSplitFreq(vfo?: VFO): Promise<number>;
|
|
@@ -688,7 +698,7 @@ declare class HamLib extends EventEmitter {
|
|
|
688
698
|
/**
|
|
689
699
|
* Set split mode TX mode
|
|
690
700
|
* @param txMode TX mode ('USB', 'LSB', 'FM', etc.)
|
|
691
|
-
* @param vfo Optional VFO to set TX mode on ('
|
|
701
|
+
* @param vfo Optional VFO to set TX mode on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
692
702
|
*/
|
|
693
703
|
setSplitMode(txMode: RadioMode, vfo?: VFO): Promise<number>;
|
|
694
704
|
|
|
@@ -696,13 +706,13 @@ declare class HamLib extends EventEmitter {
|
|
|
696
706
|
* Set split mode TX mode with width
|
|
697
707
|
* @param txMode TX mode ('USB', 'LSB', 'FM', etc.)
|
|
698
708
|
* @param txWidth TX bandwidth
|
|
699
|
-
* @param vfo Optional VFO to set TX mode on ('
|
|
709
|
+
* @param vfo Optional VFO to set TX mode on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
700
710
|
*/
|
|
701
711
|
setSplitMode(txMode: RadioMode, txWidth: number, vfo?: VFO): Promise<number>;
|
|
702
712
|
|
|
703
713
|
/**
|
|
704
714
|
* Get split mode TX mode
|
|
705
|
-
* @param vfo Optional VFO to get TX mode from ('
|
|
715
|
+
* @param vfo Optional VFO to get TX mode from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
706
716
|
* @returns TX mode and width
|
|
707
717
|
*/
|
|
708
718
|
getSplitMode(vfo?: VFO): Promise<SplitModeInfo>;
|
|
@@ -710,18 +720,18 @@ declare class HamLib extends EventEmitter {
|
|
|
710
720
|
/**
|
|
711
721
|
* Enable/disable split operation
|
|
712
722
|
* @param enable true to enable split, false to disable
|
|
713
|
-
* @param rxVfo Optional RX VFO ('
|
|
714
|
-
* @param txVfo Optional TX VFO ('
|
|
723
|
+
* @param rxVfo Optional RX VFO ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
724
|
+
* @param txVfo Optional TX VFO ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
715
725
|
* @example
|
|
716
726
|
* await rig.setSplit(true); // Enable split with defaults
|
|
717
|
-
* await rig.setSplit(true, '
|
|
718
|
-
* await rig.setSplit(true, '
|
|
727
|
+
* await rig.setSplit(true, 'VFOA'); // Enable split, RX on VFOA, TX on current VFO
|
|
728
|
+
* await rig.setSplit(true, 'VFOA', 'VFOB'); // Enable split, explicit RX and TX VFOs
|
|
719
729
|
*/
|
|
720
730
|
setSplit(enable: boolean, rxVfo?: VFO, txVfo?: VFO): Promise<number>;
|
|
721
731
|
|
|
722
732
|
/**
|
|
723
733
|
* Get split operation status
|
|
724
|
-
* @param vfo Optional VFO to get status from ('
|
|
734
|
+
* @param vfo Optional VFO to get status from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
725
735
|
* @returns Split status and TX VFO
|
|
726
736
|
*/
|
|
727
737
|
getSplit(vfo?: VFO): Promise<SplitStatusInfo>;
|
|
@@ -874,7 +884,7 @@ declare class HamLib extends EventEmitter {
|
|
|
874
884
|
|
|
875
885
|
/**
|
|
876
886
|
* Get current PTT status
|
|
877
|
-
* @param vfo Optional VFO to get PTT status from ('
|
|
887
|
+
* @param vfo Optional VFO to get PTT status from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
878
888
|
* @returns PTT status (true if transmitting, false if receiving)
|
|
879
889
|
* @example
|
|
880
890
|
* const isTransmitting = await rig.getPtt();
|
|
@@ -888,7 +898,7 @@ declare class HamLib extends EventEmitter {
|
|
|
888
898
|
|
|
889
899
|
/**
|
|
890
900
|
* Get current DCD (Data Carrier Detect) status
|
|
891
|
-
* @param vfo Optional VFO to get DCD status from ('
|
|
901
|
+
* @param vfo Optional VFO to get DCD status from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
892
902
|
* @returns DCD status (true if carrier detected, false if no carrier)
|
|
893
903
|
* @example
|
|
894
904
|
* const carrierDetected = await rig.getDcd();
|
|
@@ -903,7 +913,7 @@ declare class HamLib extends EventEmitter {
|
|
|
903
913
|
/**
|
|
904
914
|
* Set tuning step
|
|
905
915
|
* @param step Tuning step in Hz
|
|
906
|
-
* @param vfo Optional VFO to set tuning step on ('
|
|
916
|
+
* @param vfo Optional VFO to set tuning step on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
907
917
|
* @returns Success status
|
|
908
918
|
* @example
|
|
909
919
|
* await rig.setTuningStep(25000); // 25 kHz steps
|
|
@@ -914,7 +924,7 @@ declare class HamLib extends EventEmitter {
|
|
|
914
924
|
|
|
915
925
|
/**
|
|
916
926
|
* Get current tuning step
|
|
917
|
-
* @param vfo Optional VFO to get tuning step from ('
|
|
927
|
+
* @param vfo Optional VFO to get tuning step from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
918
928
|
* @returns Current tuning step in Hz
|
|
919
929
|
* @example
|
|
920
930
|
* const step = await rig.getTuningStep();
|
|
@@ -927,7 +937,7 @@ declare class HamLib extends EventEmitter {
|
|
|
927
937
|
/**
|
|
928
938
|
* Set repeater shift direction
|
|
929
939
|
* @param shift Repeater shift direction ('NONE', 'MINUS', 'PLUS', '-', '+')
|
|
930
|
-
* @param vfo Optional VFO to set repeater shift on ('
|
|
940
|
+
* @param vfo Optional VFO to set repeater shift on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
931
941
|
* @returns Success status
|
|
932
942
|
* @example
|
|
933
943
|
* await rig.setRepeaterShift('PLUS'); // Positive shift (+)
|
|
@@ -938,7 +948,7 @@ declare class HamLib extends EventEmitter {
|
|
|
938
948
|
|
|
939
949
|
/**
|
|
940
950
|
* Get current repeater shift direction
|
|
941
|
-
* @param vfo Optional VFO to get repeater shift from ('
|
|
951
|
+
* @param vfo Optional VFO to get repeater shift from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
942
952
|
* @returns Current repeater shift direction
|
|
943
953
|
* @example
|
|
944
954
|
* const shift = await rig.getRepeaterShift();
|
|
@@ -949,7 +959,7 @@ declare class HamLib extends EventEmitter {
|
|
|
949
959
|
/**
|
|
950
960
|
* Set repeater offset frequency
|
|
951
961
|
* @param offset Repeater offset in Hz
|
|
952
|
-
* @param vfo Optional VFO to set repeater offset on ('
|
|
962
|
+
* @param vfo Optional VFO to set repeater offset on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
953
963
|
* @returns Success status
|
|
954
964
|
* @example
|
|
955
965
|
* await rig.setRepeaterOffset(600000); // 600 kHz offset (2m band)
|
|
@@ -959,7 +969,7 @@ declare class HamLib extends EventEmitter {
|
|
|
959
969
|
|
|
960
970
|
/**
|
|
961
971
|
* Get current repeater offset frequency
|
|
962
|
-
* @param vfo Optional VFO to get repeater offset from ('
|
|
972
|
+
* @param vfo Optional VFO to get repeater offset from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
963
973
|
* @returns Current repeater offset in Hz
|
|
964
974
|
* @example
|
|
965
975
|
* const offset = await rig.getRepeaterOffset();
|
|
@@ -972,7 +982,7 @@ declare class HamLib extends EventEmitter {
|
|
|
972
982
|
/**
|
|
973
983
|
* Set CTCSS tone frequency
|
|
974
984
|
* @param tone CTCSS tone frequency in tenths of Hz (e.g., 1000 for 100.0 Hz)
|
|
975
|
-
* @param vfo Optional VFO to set tone on ('
|
|
985
|
+
* @param vfo Optional VFO to set tone on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
976
986
|
* @returns Success status
|
|
977
987
|
* @example
|
|
978
988
|
* await rig.setCtcssTone(1000); // Set 100.0 Hz CTCSS tone
|
|
@@ -982,7 +992,7 @@ declare class HamLib extends EventEmitter {
|
|
|
982
992
|
|
|
983
993
|
/**
|
|
984
994
|
* Get current CTCSS tone frequency
|
|
985
|
-
* @param vfo Optional VFO to get tone from ('
|
|
995
|
+
* @param vfo Optional VFO to get tone from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
986
996
|
* @returns Current CTCSS tone frequency in tenths of Hz
|
|
987
997
|
* @example
|
|
988
998
|
* const tone = await rig.getCtcssTone();
|
|
@@ -993,7 +1003,7 @@ declare class HamLib extends EventEmitter {
|
|
|
993
1003
|
/**
|
|
994
1004
|
* Set DCS code
|
|
995
1005
|
* @param code DCS code (e.g., 23, 174, 754)
|
|
996
|
-
* @param vfo Optional VFO to set code on ('
|
|
1006
|
+
* @param vfo Optional VFO to set code on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
997
1007
|
* @returns Success status
|
|
998
1008
|
* @example
|
|
999
1009
|
* await rig.setDcsCode(23); // Set DCS code 023
|
|
@@ -1003,7 +1013,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1003
1013
|
|
|
1004
1014
|
/**
|
|
1005
1015
|
* Get current DCS code
|
|
1006
|
-
* @param vfo Optional VFO to get code from ('
|
|
1016
|
+
* @param vfo Optional VFO to get code from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1007
1017
|
* @returns Current DCS code
|
|
1008
1018
|
* @example
|
|
1009
1019
|
* const code = await rig.getDcsCode();
|
|
@@ -1014,7 +1024,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1014
1024
|
/**
|
|
1015
1025
|
* Set CTCSS SQL (squelch) tone frequency
|
|
1016
1026
|
* @param tone CTCSS SQL tone frequency in tenths of Hz (e.g., 1000 for 100.0 Hz)
|
|
1017
|
-
* @param vfo Optional VFO to set tone on ('
|
|
1027
|
+
* @param vfo Optional VFO to set tone on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1018
1028
|
* @returns Success status
|
|
1019
1029
|
* @example
|
|
1020
1030
|
* await rig.setCtcssSql(1000); // Set 100.0 Hz CTCSS SQL tone
|
|
@@ -1023,7 +1033,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1023
1033
|
|
|
1024
1034
|
/**
|
|
1025
1035
|
* Get current CTCSS SQL tone frequency
|
|
1026
|
-
* @param vfo Optional VFO to get tone from ('
|
|
1036
|
+
* @param vfo Optional VFO to get tone from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1027
1037
|
* @returns Current CTCSS SQL tone frequency in tenths of Hz
|
|
1028
1038
|
* @example
|
|
1029
1039
|
* const tone = await rig.getCtcssSql();
|
|
@@ -1034,7 +1044,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1034
1044
|
/**
|
|
1035
1045
|
* Set DCS SQL (squelch) code
|
|
1036
1046
|
* @param code DCS SQL code (e.g., 23, 174, 754)
|
|
1037
|
-
* @param vfo Optional VFO to set code on ('
|
|
1047
|
+
* @param vfo Optional VFO to set code on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1038
1048
|
* @returns Success status
|
|
1039
1049
|
* @example
|
|
1040
1050
|
* await rig.setDcsSql(23); // Set DCS SQL code 023
|
|
@@ -1043,7 +1053,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1043
1053
|
|
|
1044
1054
|
/**
|
|
1045
1055
|
* Get current DCS SQL code
|
|
1046
|
-
* @param vfo Optional VFO to get code from ('
|
|
1056
|
+
* @param vfo Optional VFO to get code from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1047
1057
|
* @returns Current DCS SQL code
|
|
1048
1058
|
* @example
|
|
1049
1059
|
* const code = await rig.getDcsSql();
|
|
@@ -1079,7 +1089,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1079
1089
|
/**
|
|
1080
1090
|
* Send DTMF digits
|
|
1081
1091
|
* @param digits DTMF digits to send (0-9, A-D, *, #)
|
|
1082
|
-
* @param vfo Optional VFO to send from ('
|
|
1092
|
+
* @param vfo Optional VFO to send from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1083
1093
|
* @returns Success status
|
|
1084
1094
|
* @example
|
|
1085
1095
|
* await rig.sendDtmf('1234'); // Send DTMF sequence 1234
|
|
@@ -1089,20 +1099,20 @@ declare class HamLib extends EventEmitter {
|
|
|
1089
1099
|
|
|
1090
1100
|
/**
|
|
1091
1101
|
* Receive DTMF digits
|
|
1092
|
-
* @param maxLength Maximum number of digits to receive
|
|
1093
|
-
* @param vfo Optional VFO to receive from ('
|
|
1102
|
+
* @param maxLength Maximum number of digits to receive
|
|
1103
|
+
* @param vfo Optional VFO to receive from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1094
1104
|
* @returns Received DTMF digits and count
|
|
1095
1105
|
* @example
|
|
1096
1106
|
* const result = await rig.recvDtmf(10);
|
|
1097
1107
|
* console.log(`Received DTMF: ${result.digits} (${result.length} digits)`);
|
|
1098
1108
|
*/
|
|
1099
|
-
recvDtmf(maxLength
|
|
1109
|
+
recvDtmf(maxLength: number, vfo?: VFO): Promise<{digits: string, length: number}>;
|
|
1100
1110
|
|
|
1101
1111
|
// Memory Channel Advanced Operations
|
|
1102
1112
|
|
|
1103
1113
|
/**
|
|
1104
1114
|
* Get current memory channel number
|
|
1105
|
-
* @param vfo Optional VFO to get memory channel from ('
|
|
1115
|
+
* @param vfo Optional VFO to get memory channel from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1106
1116
|
* @returns Current memory channel number
|
|
1107
1117
|
* @example
|
|
1108
1118
|
* const currentChannel = await rig.getMem();
|
|
@@ -1113,7 +1123,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1113
1123
|
/**
|
|
1114
1124
|
* Set memory bank
|
|
1115
1125
|
* @param bank Bank number to select
|
|
1116
|
-
* @param vfo Optional VFO to set bank on ('
|
|
1126
|
+
* @param vfo Optional VFO to set bank on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1117
1127
|
* @returns Success status
|
|
1118
1128
|
* @example
|
|
1119
1129
|
* await rig.setBank(1); // Select memory bank 1
|
|
@@ -1135,7 +1145,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1135
1145
|
/**
|
|
1136
1146
|
* Send Morse code message
|
|
1137
1147
|
* @param message Morse code message to send (text will be converted to Morse)
|
|
1138
|
-
* @param vfo Optional VFO to send from ('
|
|
1148
|
+
* @param vfo Optional VFO to send from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1139
1149
|
* @returns Success status
|
|
1140
1150
|
* @example
|
|
1141
1151
|
* await rig.sendMorse('CQ CQ DE VK3ABC K'); // Send CQ call
|
|
@@ -1145,7 +1155,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1145
1155
|
|
|
1146
1156
|
/**
|
|
1147
1157
|
* Stop current Morse code transmission
|
|
1148
|
-
* @param vfo Optional VFO to stop ('
|
|
1158
|
+
* @param vfo Optional VFO to stop ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1149
1159
|
* @returns Success status
|
|
1150
1160
|
* @example
|
|
1151
1161
|
* await rig.stopMorse(); // Stop ongoing Morse transmission
|
|
@@ -1154,7 +1164,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1154
1164
|
|
|
1155
1165
|
/**
|
|
1156
1166
|
* Wait for Morse code transmission to complete
|
|
1157
|
-
* @param vfo Optional VFO to wait on ('
|
|
1167
|
+
* @param vfo Optional VFO to wait on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1158
1168
|
* @returns Success status when transmission completes
|
|
1159
1169
|
* @example
|
|
1160
1170
|
* await rig.sendMorse('TEST');
|
|
@@ -1167,7 +1177,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1167
1177
|
/**
|
|
1168
1178
|
* Play voice memory channel
|
|
1169
1179
|
* @param channel Voice memory channel number to play
|
|
1170
|
-
* @param vfo Optional VFO to play from ('
|
|
1180
|
+
* @param vfo Optional VFO to play from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1171
1181
|
* @returns Success status
|
|
1172
1182
|
* @example
|
|
1173
1183
|
* await rig.sendVoiceMem(1); // Play voice memory channel 1
|
|
@@ -1177,7 +1187,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1177
1187
|
|
|
1178
1188
|
/**
|
|
1179
1189
|
* Stop voice memory playback
|
|
1180
|
-
* @param vfo Optional VFO to stop ('
|
|
1190
|
+
* @param vfo Optional VFO to stop ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1181
1191
|
* @returns Success status
|
|
1182
1192
|
* @example
|
|
1183
1193
|
* await rig.stopVoiceMem(); // Stop ongoing voice memory playback
|
|
@@ -1191,7 +1201,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1191
1201
|
* @param txFrequency TX frequency in Hz
|
|
1192
1202
|
* @param txMode TX mode ('USB', 'LSB', 'FM', etc.)
|
|
1193
1203
|
* @param txWidth TX bandwidth in Hz
|
|
1194
|
-
* @param vfo Optional VFO for split operation ('
|
|
1204
|
+
* @param vfo Optional VFO for split operation ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1195
1205
|
* @returns Success status
|
|
1196
1206
|
* @example
|
|
1197
1207
|
* await rig.setSplitFreqMode(14205000, 'USB', 2400); // Set split: TX on 14.205 MHz USB 2400Hz width
|
|
@@ -1201,7 +1211,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1201
1211
|
|
|
1202
1212
|
/**
|
|
1203
1213
|
* Get split frequency and mode information
|
|
1204
|
-
* @param vfo Optional VFO to get split info from ('
|
|
1214
|
+
* @param vfo Optional VFO to get split info from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1205
1215
|
* @returns Object containing TX frequency, mode, and width
|
|
1206
1216
|
* @example
|
|
1207
1217
|
* const splitInfo = await rig.getSplitFreqMode();
|
|
@@ -1214,7 +1224,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1214
1224
|
/**
|
|
1215
1225
|
* Set antenna selection
|
|
1216
1226
|
* @param antenna Antenna number to select (1-based)
|
|
1217
|
-
* @param vfo Optional VFO to set antenna on ('
|
|
1227
|
+
* @param vfo Optional VFO to set antenna on ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1218
1228
|
* @returns Success status
|
|
1219
1229
|
* @example
|
|
1220
1230
|
* await rig.setAntenna(1); // Select antenna 1
|
|
@@ -1224,7 +1234,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1224
1234
|
|
|
1225
1235
|
/**
|
|
1226
1236
|
* Get comprehensive antenna information
|
|
1227
|
-
* @param vfo Optional VFO to get antenna info from ('
|
|
1237
|
+
* @param vfo Optional VFO to get antenna info from ('VFOA' or 'VFOB'). If not specified, uses current VFO
|
|
1228
1238
|
* @returns Antenna information object containing current, TX, RX antenna settings and option
|
|
1229
1239
|
* @example
|
|
1230
1240
|
* const antennaInfo = await rig.getAntenna();
|
|
@@ -1264,7 +1274,7 @@ declare class HamLib extends EventEmitter {
|
|
|
1264
1274
|
|
|
1265
1275
|
/**
|
|
1266
1276
|
* Reset radio to default state
|
|
1267
|
-
* @param resetType Reset type ('NONE', 'SOFT', 'VFO', 'MCALL', 'MASTER')
|
|
1277
|
+
* @param resetType Reset type ('NONE', 'SOFT', 'VFO', 'MCALL', 'MASTER')
|
|
1268
1278
|
* - NONE: No reset
|
|
1269
1279
|
* - SOFT: Soft reset (preserve some settings)
|
|
1270
1280
|
* - VFO: VFO reset
|
|
@@ -1274,9 +1284,8 @@ declare class HamLib extends EventEmitter {
|
|
|
1274
1284
|
* @example
|
|
1275
1285
|
* await rig.reset('SOFT'); // Soft reset
|
|
1276
1286
|
* await rig.reset('MASTER'); // Factory reset (CAUTION: loses all settings!)
|
|
1277
|
-
* await rig.reset(); // Default soft reset
|
|
1278
1287
|
*/
|
|
1279
|
-
reset(resetType
|
|
1288
|
+
reset(resetType: 'NONE' | 'SOFT' | 'VFO' | 'MCALL' | 'MASTER'): Promise<number>;
|
|
1280
1289
|
|
|
1281
1290
|
// ===== Rig Info / Spectrum / Conf (async) =====
|
|
1282
1291
|
|
|
@@ -1300,51 +1309,6 @@ declare class HamLib extends EventEmitter {
|
|
|
1300
1309
|
*/
|
|
1301
1310
|
getSpectrumCapabilities(): Promise<SpectrumCapabilities>;
|
|
1302
1311
|
|
|
1303
|
-
/**
|
|
1304
|
-
* Summarize whether official Hamlib spectrum streaming is usable.
|
|
1305
|
-
*/
|
|
1306
|
-
getSpectrumSupportSummary(): Promise<SpectrumSupportSummary>;
|
|
1307
|
-
|
|
1308
|
-
/**
|
|
1309
|
-
* Apply spectrum-related settings using official Hamlib level/function APIs.
|
|
1310
|
-
*/
|
|
1311
|
-
configureSpectrum(config?: SpectrumConfig): Promise<SpectrumSupportSummary>;
|
|
1312
|
-
|
|
1313
|
-
/**
|
|
1314
|
-
* Get the current spectrum edge slot if exposed by the backend.
|
|
1315
|
-
*/
|
|
1316
|
-
getSpectrumEdgeSlot(): Promise<number>;
|
|
1317
|
-
|
|
1318
|
-
/**
|
|
1319
|
-
* Set the current spectrum edge slot if exposed by the backend.
|
|
1320
|
-
*/
|
|
1321
|
-
setSpectrumEdgeSlot(slot: number): Promise<number>;
|
|
1322
|
-
|
|
1323
|
-
/**
|
|
1324
|
-
* Get supported spectrum edge slots.
|
|
1325
|
-
*/
|
|
1326
|
-
getSpectrumSupportedEdgeSlots(): Promise<number[]>;
|
|
1327
|
-
|
|
1328
|
-
/**
|
|
1329
|
-
* Read current fixed spectrum edges.
|
|
1330
|
-
*/
|
|
1331
|
-
getSpectrumFixedEdges(): Promise<{lowHz: number, highHz: number}>;
|
|
1332
|
-
|
|
1333
|
-
/**
|
|
1334
|
-
* Set current fixed spectrum edges.
|
|
1335
|
-
*/
|
|
1336
|
-
setSpectrumFixedEdges(range: {lowHz: number, highHz: number}): Promise<{lowHz: number, highHz: number}>;
|
|
1337
|
-
|
|
1338
|
-
/**
|
|
1339
|
-
* Get a normalized spectrum display state for application use.
|
|
1340
|
-
*/
|
|
1341
|
-
getSpectrumDisplayState(): Promise<SpectrumDisplayState>;
|
|
1342
|
-
|
|
1343
|
-
/**
|
|
1344
|
-
* Configure spectrum display state using a normalized application-facing shape.
|
|
1345
|
-
*/
|
|
1346
|
-
configureSpectrumDisplay(config?: SpectrumConfig): Promise<SpectrumDisplayState>;
|
|
1347
|
-
|
|
1348
1312
|
/**
|
|
1349
1313
|
* Start receiving official Hamlib spectrum line events.
|
|
1350
1314
|
*/
|
|
@@ -1355,16 +1319,6 @@ declare class HamLib extends EventEmitter {
|
|
|
1355
1319
|
*/
|
|
1356
1320
|
stopSpectrumStream(): Promise<boolean>;
|
|
1357
1321
|
|
|
1358
|
-
/**
|
|
1359
|
-
* High-level managed spectrum startup.
|
|
1360
|
-
*/
|
|
1361
|
-
startManagedSpectrum(config?: SpectrumConfig): Promise<boolean>;
|
|
1362
|
-
|
|
1363
|
-
/**
|
|
1364
|
-
* High-level managed spectrum shutdown.
|
|
1365
|
-
*/
|
|
1366
|
-
stopManagedSpectrum(): Promise<boolean>;
|
|
1367
|
-
|
|
1368
1322
|
/**
|
|
1369
1323
|
* Listen for official spectrum line events.
|
|
1370
1324
|
*/
|
|
@@ -1372,13 +1326,6 @@ declare class HamLib extends EventEmitter {
|
|
|
1372
1326
|
once(event: 'spectrumLine', listener: (line: SpectrumLine) => void): this;
|
|
1373
1327
|
off(event: 'spectrumLine', listener: (line: SpectrumLine) => void): this;
|
|
1374
1328
|
|
|
1375
|
-
/**
|
|
1376
|
-
* Listen for managed spectrum state changes.
|
|
1377
|
-
*/
|
|
1378
|
-
on(event: 'spectrumStateChanged', listener: (state: { active: boolean }) => void): this;
|
|
1379
|
-
once(event: 'spectrumStateChanged', listener: (state: { active: boolean }) => void): this;
|
|
1380
|
-
off(event: 'spectrumStateChanged', listener: (state: { active: boolean }) => void): this;
|
|
1381
|
-
|
|
1382
1329
|
/**
|
|
1383
1330
|
* Listen for asynchronous spectrum errors.
|
|
1384
1331
|
*/
|
|
@@ -1597,7 +1544,7 @@ export { ConnectionInfo, ModeInfo, SupportedRigInfo, AntennaInfo, VFO, RadioMode
|
|
|
1597
1544
|
ScanType, VfoOperationType, SerialConfigParam, SerialBaudRate, SerialParity,
|
|
1598
1545
|
SerialHandshake, SerialControlState, PttType, DcdType, SerialConfigOptions,
|
|
1599
1546
|
SpectrumScopeInfo, SpectrumModeInfo, SpectrumAverageModeInfo, SpectrumLine,
|
|
1600
|
-
SpectrumCapabilities, SpectrumSupportSummary, SpectrumConfig,
|
|
1547
|
+
SpectrumCapabilities, SpectrumSupportSummary, SpectrumConfig, SpectrumDisplayState,
|
|
1601
1548
|
ClockInfo, VfoInfo, HamLib };
|
|
1602
1549
|
|
|
1603
1550
|
// Support both CommonJS and ES module exports
|