forked from dthompso99/node-hamlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
1779 lines (1556 loc) · 50.4 KB
/
index.d.ts
File metadata and controls
1779 lines (1556 loc) · 50.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { EventEmitter } from 'events';
/**
* Connection information interface
*/
interface ConnectionInfo {
/** Connection type: serial or network */
connectionType: 'serial' | 'network';
/** Port path or network address */
portPath: string;
/** Connection status */
isOpen: boolean;
/** Original model number */
originalModel: number;
/** Actual model number used */
currentModel: number;
/** @deprecated Use isOpen */
connected?: boolean;
/** @deprecated Use currentModel */
actualModel?: number;
}
/**
* Radio mode information interface
*/
interface ModeInfo {
/** Radio mode character */
mode: string;
/** Bandwidth in Hz */
bandwidth: number;
}
/**
* Supported rig information interface
*/
interface SupportedRigInfo {
/** Rig model number */
rigModel: number;
/** Model name */
modelName: string;
/** Manufacturer name */
mfgName: string;
/** Driver version */
version: string;
/** Driver status (Alpha, Beta, Stable, etc.) */
status: string;
/** Rig type (Transceiver, Handheld, Mobile, etc.) */
rigType: string;
}
interface SupportedRotatorInfo {
rotModel: number;
modelName: string;
mfgName: string;
version: string;
status: string;
rotType: 'azimuth' | 'elevation' | 'azel' | 'other';
rotTypeMask: number;
}
/**
* Antenna information interface
*/
interface AntennaInfo {
/** Currently selected antenna */
currentAntenna: number;
/** TX antenna selection */
txAntenna: number;
/** RX antenna selection */
rxAntenna: number;
/** Additional antenna option/parameter */
option: number;
}
interface RotatorConnectionInfo {
connectionType: 'serial' | 'network';
portPath: string;
isOpen: boolean;
originalModel: number;
currentModel: number;
}
interface RotatorPosition {
azimuth: number;
elevation: number;
}
interface RotatorStatus {
mask: number;
flags: string[];
}
type RotatorDirection =
| 'UP'
| 'DOWN'
| 'LEFT'
| 'RIGHT'
| 'CCW'
| 'CW'
| 'UP_LEFT'
| 'UP_RIGHT'
| 'DOWN_LEFT'
| 'DOWN_RIGHT'
| 'UP_CCW'
| 'UP_CW'
| 'DOWN_CCW'
| 'DOWN_CW'
| number;
type RotatorResetType = 'ALL' | number;
interface RotatorCaps {
rotType: 'azimuth' | 'elevation' | 'azel' | 'other';
rotTypeMask: number;
minAz: number;
maxAz: number;
minEl: number;
maxEl: number;
supportedStatuses: string[];
}
/**
* Hamlib VFO token.
* 实际支持的 token 取决于具体 backend / 电台型号。
*/
type VFO =
| 'VFOA'
| 'VFOB'
| 'VFOC'
| 'currVFO'
| 'VFO'
| 'MEM'
| 'Main'
| 'Sub'
| 'TX'
| 'RX'
| 'MainA'
| 'MainB'
| 'MainC'
| 'SubA'
| 'SubB'
| 'SubC'
| 'Other';
/**
* Radio mode type
*/
type RadioMode = 'USB' | 'LSB' | 'FM' | 'PKTFM' | 'AM' | 'CW' | 'RTTY' | 'DIG' | string;
type PassbandSelector = 'narrow' | 'wide' | 'normal' | 'nochange' | number;
interface PassbandConstants {
NORMAL: 0;
NOCHANGE: -1;
}
/**
* Frequency range information
*/
interface FrequencyRange {
/** Start frequency in Hz */
startFreq: number;
/** End frequency in Hz */
endFreq: number;
/** Supported modes for this range */
modes: RadioMode[];
/** Minimum power in mW */
lowPower: number;
/** Maximum power in mW */
highPower: number;
/** VFO bitmask */
vfo: number;
/** Antenna bitmask */
antenna: number;
}
/**
* Tuning step information
*/
interface TuningStepInfo {
/** Modes this step applies to */
modes: RadioMode[];
/** Step size in Hz */
stepHz: number;
}
/**
* Filter information
*/
interface FilterInfo {
/** Modes this filter applies to */
modes: RadioMode[];
/** Filter width in Hz */
width: number;
}
interface LevelGranularityInfo {
min: number;
max: number;
step: number;
kind: 'float' | 'int';
source: string;
}
interface RfPowerRigUnitRange {
current: number;
min: number;
max: number;
}
interface RfPowerStepInfo {
normalized: number;
milliwatts: number;
watts: number;
rigUnitRange?: RfPowerRigUnitRange;
}
/**
* Hamlib debug level type
* Controls the verbosity of Hamlib library debug output
*/
type RigDebugLevel = 0 | 1 | 2 | 3 | 4 | 5;
/**
* Memory channel data interface
*/
interface MemoryChannelData {
/** Channel frequency in Hz */
frequency?: number;
/** Radio mode */
mode?: RadioMode;
/** Bandwidth */
bandwidth?: number;
/** Channel description */
description?: string;
/** TX frequency for split operation */
txFrequency?: number;
/** CTCSS tone frequency */
ctcssTone?: number;
}
/**
* Memory channel info interface
*/
interface MemoryChannelInfo {
/** Channel number */
channelNumber: number;
/** Channel frequency */
frequency: number;
/** Radio mode */
mode: string;
/** Bandwidth */
bandwidth: number;
/** Channel description */
description: string;
/** Split operation enabled */
split: boolean;
/** TX frequency (if split enabled) */
txFrequency?: number;
/** CTCSS tone frequency */
ctcssTone?: number;
}
interface SpectrumScopeInfo {
id: number;
name: string;
}
interface SpectrumModeInfo {
id: number;
name: string;
}
interface SpectrumAverageModeInfo {
id: number;
name: string;
}
interface SpectrumLine {
scopeId: number;
dataLevelMin: number;
dataLevelMax: number;
signalStrengthMin: number;
signalStrengthMax: number;
mode: number;
centerFreq: number;
spanHz: number;
lowEdgeFreq: number;
highEdgeFreq: number;
dataLength: number;
data: Buffer;
timestamp: number;
}
interface SpectrumCapabilities {
asyncDataSupported?: boolean;
scopes: SpectrumScopeInfo[];
modes: SpectrumModeInfo[];
spans: number[];
avgModes: SpectrumAverageModeInfo[];
}
interface SpectrumSupportSummary extends SpectrumCapabilities {
supported: boolean;
asyncDataSupported: boolean;
hasSpectrumFunction: boolean;
hasSpectrumHoldFunction: boolean;
hasTransceiveFunction: boolean;
configurableLevels: string[];
supportsFixedEdges: boolean;
supportsEdgeSlotSelection: boolean;
supportedEdgeSlots: number[];
}
type SpectrumDisplayMode = 'center' | 'fixed' | 'scroll-center' | 'scroll-fixed';
interface SpectrumConfig {
hold?: boolean;
mode?: number | SpectrumDisplayMode;
spanHz?: number;
edgeSlot?: number;
edgeLowHz?: number;
edgeHighHz?: number;
speed?: number;
referenceLevel?: number;
averageMode?: number;
}
interface SpectrumDisplayState {
mode: SpectrumDisplayMode | null;
modeId: number | null;
modeName: string | null;
spanHz: number | null;
edgeSlot: number | null;
edgeLowHz: number | null;
edgeHighHz: number | null;
supportedModes: SpectrumModeInfo[];
supportedSpans: number[];
supportedEdgeSlots: number[];
supportsFixedEdges: boolean;
supportsEdgeSlotSelection: boolean;
}
/**
* Split mode info interface
*/
interface SplitModeInfo {
/** TX mode */
mode: string;
/** TX bandwidth */
width: number;
}
/**
* Split status info interface
*/
interface SplitStatusInfo {
/** Split enabled status */
enabled: boolean;
/** TX VFO */
txVfo: VFO;
}
/**
* Level type
*/
type LevelType = 'AF' | 'PREAMP' | 'ATT' | 'RF' | 'SQL' | 'RFPOWER' | 'MICGAIN' | 'IF' | 'APF' | 'NR' |
'PBT_IN' | 'PBT_OUT' | 'CWPITCH' | 'KEYSPD' | 'NOTCHF' | 'COMP' |
'AGC' | 'BKINDL' | 'BALANCE' | 'VOXGAIN' | 'VOXDELAY' | 'ANTIVOX' | 'MONITOR_GAIN' |
'STRENGTH' | 'RAWSTR' | 'SWR' | 'ALC' | 'RFPOWER_METER' | 'RFPOWER_METER_WATTS' |
'COMP_METER' | 'VD_METER' | 'ID_METER' | 'TEMP_METER' |
'SPECTRUM_MODE' | 'SPECTRUM_SPAN' | 'SPECTRUM_EDGE_LOW' | 'SPECTRUM_EDGE_HIGH' |
'SPECTRUM_SPEED' | 'SPECTRUM_REF' | 'SPECTRUM_AVG' | 'SPECTRUM_ATT' | string;
/**
* Function type
*/
type FunctionType = 'FAGC' | 'NB' | 'COMP' | 'VOX' | 'TONE' | 'TSQL' | 'SBKIN' |
'FBKIN' | 'ANF' | 'NR' | 'AIP' | 'APF' | 'TUNER' | 'XIT' |
'RIT' | 'LOCK' | 'MUTE' | 'VSC' | 'REV' | 'SQL' | 'ABM' |
'BC' | 'MBC' | 'AFC' | 'SATMODE' | 'SCOPE' | 'RESUME' | 'TRANSCEIVE' |
'SPECTRUM' | 'SPECTRUM_HOLD' |
'TBURST' | string;
/**
* Scan type
*/
type ScanType = 'VFO' | 'MEM' | 'PROG' | 'DELTA' | 'PRIO';
/**
* VFO operation type
*/
type VfoOperationType = 'CPY' | 'XCHG' | 'FROM_VFO' | 'TO_VFO' | 'MCL' | 'UP' |
'DOWN' | 'BAND_UP' | 'BAND_DOWN' | 'LEFT' | 'RIGHT' |
'TUNE' | 'TOGGLE';
/**
* Supported baud rates for serial communication
*/
type SerialBaudRate = '150' | '300' | '600' | '1200' | '2400' | '4800' | '9600' | '19200' |
'38400' | '57600' | '115200' | '230400' | '460800' | '500000' |
'576000' | '921600' | '1000000' | '1152000' | '1500000' | '2000000' |
'2500000' | '3000000' | '3500000' | '4000000';
/**
* Serial parity values
*/
type SerialParity = 'None' | 'Even' | 'Odd' | 'Mark' | 'Space';
/**
* Serial handshake values
*/
type SerialHandshake = 'None' | 'Hardware' | 'Software';
/**
* Serial control signal states
*/
type SerialControlState = 'ON' | 'OFF' | 'UNSET';
/**
* Serial configuration parameter names
*/
type SerialConfigParam =
// Basic serial settings
'data_bits' | 'stop_bits' | 'serial_parity' | 'serial_handshake' |
// Control signals
'rts_state' | 'dtr_state' |
// Communication settings
'rate' | 'timeout' | 'retry' |
// Timing control
'write_delay' | 'post_write_delay' |
// Advanced features
'flushx';
/**
* PTT (Push-to-Talk) types
*/
type PttType = 'RIG' | 'DTR' | 'RTS' | 'PARALLEL' | 'CM108' | 'GPIO' | 'GPION' | 'NONE';
/**
* DCD (Data Carrier Detect) types
*/
type DcdType = 'RIG' | 'DSR' | 'CTS' | 'CD' | 'PARALLEL' | 'CM108' | 'GPIO' | 'GPION' | 'NONE';
/**
* Serial configuration options interface
*/
interface SerialConfigOptions {
/** Serial port basic parameters */
serial: {
/** Data bits options */
data_bits: string[];
/** Stop bits options */
stop_bits: string[];
/** Parity options */
serial_parity: string[];
/** Handshake options */
serial_handshake: string[];
/** RTS state options */
rts_state: string[];
/** DTR state options */
dtr_state: string[];
};
/** PTT type options */
ptt_type: string[];
/** DCD type options */
dcd_type: string[];
}
type HamlibConfigFieldType =
| 'string'
| 'combo'
| 'numeric'
| 'checkbutton'
| 'button'
| 'binary'
| 'int'
| 'unknown';
interface HamlibConfigFieldDescriptor {
token: number;
name: string;
label: string;
tooltip: string;
defaultValue: string;
type: HamlibConfigFieldType;
numeric?: {
min: number;
max: number;
step: number;
};
options?: string[];
}
type HamlibPortType =
| 'none'
| 'serial'
| 'network'
| 'device'
| 'packet'
| 'dtmf'
| 'ultra'
| 'rpc'
| 'parallel'
| 'usb'
| 'udp-network'
| 'cm108'
| 'gpio'
| 'gpion'
| 'other';
interface HamlibPortCaps {
portType: HamlibPortType;
serialRateMin?: number;
serialRateMax?: number;
serialDataBits?: number;
serialStopBits?: number;
serialParity?: string;
serialHandshake?: string;
writeDelay: number;
postWriteDelay: number;
timeout: number;
retry: number;
}
/**
* HamLib class - for controlling amateur radio devices
*/
declare class HamLib extends EventEmitter {
/**
* Constructor
* @param model Radio model number (execute rigctl -l to find your device model number)
* @param port Optional port path
* - Serial connection: '/dev/ttyUSB0' (Linux default), '/dev/cu.usbserial-XXXX' (macOS), 'COM1' (Windows)
* - Network connection: 'localhost:4532' or '192.168.1.100:4532' (automatically switches to NETRIGCTL mode)
*
* @example
* // Use default serial port
* const rig = new HamLib(1035);
*
* // Use custom serial port
* const rig = new HamLib(1035, '/dev/ttyUSB1');
*
* // Network connection to rigctld
* const rig = new HamLib(1035, 'localhost:4532');
*/
constructor(model: number, port?: string);
/**
* Get list of all supported radio models
* @returns Array of supported radio models with details
* @static
* @example
* const supportedRigs = HamLib.getSupportedRigs();
* console.log(`Found ${supportedRigs.length} supported rigs`);
* supportedRigs.forEach(rig => {
* console.log(`${rig.rigModel}: ${rig.mfgName} ${rig.modelName} (${rig.status})`);
* });
*/
static getSupportedRigs(): SupportedRigInfo[];
/**
* Get Hamlib library version information
* @returns Hamlib version string including version number, build date, and architecture
* @static
* @example
* const version = HamLib.getHamlibVersion();
* console.log(`Hamlib version: ${version}`);
* // Output: "Hamlib 4.5.5 2024-01-15 12:00:00 64-bit"
*/
static getHamlibVersion(): string;
/**
* Set Hamlib debug level (affects all instances globally)
* Controls the verbosity of Hamlib library debug output.
*
* @param level Debug level:
* - 0 = NONE (no debug output)
* - 1 = BUG (serious bug messages only)
* - 2 = ERR (error messages)
* - 3 = WARN (warning messages)
* - 4 = VERBOSE (verbose messages)
* - 5 = TRACE (trace messages - very detailed)
* @static
* @example
* // Disable all debug output
* HamLib.setDebugLevel(0);
*
* // Enable verbose debugging for troubleshooting
* HamLib.setDebugLevel(4);
*
* // Enable full trace debugging for development
* HamLib.setDebugLevel(5);
*/
static setDebugLevel(level: RigDebugLevel): void;
/**
* Get current Hamlib debug level
* Note: This method is not supported by Hamlib API and will throw an error.
* Applications should track the debug level they set using setDebugLevel().
*
* @static
* @throws Always throws error as Hamlib doesn't provide API to query debug level
*/
static getDebugLevel(): never;
/**
* Open connection to device
* Must be called before other operations
* @throws Throws error when connection fails
*/
open(): Promise<number>;
/**
* Set VFO (Variable Frequency Oscillator)
* @param vfo VFO identifier, typically 'VFOA' or 'VFOB'
* @throws Throws error when device doesn't support or operation fails
*/
setVfo(vfo: VFO): Promise<number>;
/**
* Set frequency
* @param frequency Frequency value in hertz
* @param vfo Optional VFO to set frequency on ('VFOA' or 'VFOB'). If not specified, uses current VFO
* @example
* await rig.setFrequency(144390000); // Set to 144.39MHz on current VFO
* await rig.setFrequency(144390000, 'VFOA'); // Set to 144.39MHz on VFOA
* await rig.setFrequency(144390000, 'VFOB'); // Set to 144.39MHz on VFOB
*/
setFrequency(frequency: number, vfo?: VFO): Promise<number>;
/**
* Set radio mode
* @param mode Radio mode (such as 'USB', 'LSB', 'FM', 'PKTFM')
* @param bandwidth Optional bandwidth selector ('narrow', 'wide', 'normal', 'nochange') or width in Hz
* @param vfo Optional VFO to set mode on ('VFOA' or 'VFOB'). If not specified, uses current VFO
* @example
* await rig.setMode('USB');
* await rig.setMode('FM', 'narrow');
* await rig.setMode('USB', 'nochange');
* await rig.setMode('USB', PASSBAND.NOCHANGE);
* await rig.setMode('USB', 'wide', 'VFOA');
*/
setMode(mode: RadioMode, bandwidth?: PassbandSelector, vfo?: VFO): Promise<number>;
/**
* Set PTT (Push-to-Talk) status
* @param state true to enable PTT, false to disable PTT
* @note Operates on the current VFO (RIG_VFO_CURR)
*/
setPtt(state: boolean): Promise<number>;
/**
* Get current VFO
* @returns Current VFO identifier
*/
getVfo(): Promise<VFO>;
/**
* Get current frequency
* @param vfo Optional VFO to get frequency from ('VFOA' or 'VFOB'). If not specified, uses current VFO
* @returns Current frequency value in hertz
* @example
* await rig.getFrequency(); // Get frequency from current VFO
* await rig.getFrequency('VFOA'); // Get frequency from VFOA
* await rig.getFrequency('VFOB'); // Get frequency from VFOB
*/
getFrequency(vfo?: VFO): Promise<number>;
/**
* Get current radio mode
* @returns Object containing mode and bandwidth information
* @note Operates on the current VFO (RIG_VFO_CURR)
*/
getMode(): Promise<ModeInfo>;
/**
* Get current signal strength
* @param vfo Optional VFO to get signal strength from ('VFOA' or 'VFOB'). If not specified, uses current VFO
* @returns Signal strength value
* @example
* const strength = await rig.getStrength(); // Get strength from current VFO
* const strengthA = await rig.getStrength('VFOA'); // Get strength from VFOA
*/
getStrength(vfo?: VFO): Promise<number>;
/**
* Close connection to device
* Does not destroy object, can re-establish connection by calling open()
*/
close(): Promise<number>;
/**
* Destroy connection to device
* Should delete object reference after calling to enable garbage collection
*/
destroy(): Promise<number>;
/**
* Get connection information
* @returns Object containing connection type, port path, connection status, and model numbers
*/
getConnectionInfo(): ConnectionInfo;
// Memory Channel Management
/**
* Set memory channel data
* @param channelNumber Memory channel number
* @param channelData Channel data (frequency, mode, description, etc.)
*/
setMemoryChannel(channelNumber: number, channelData: MemoryChannelData): Promise<number>;
/**
* Get memory channel data
* @param channelNumber Memory channel number
* @param readOnly Whether to read in read-only mode
* @returns Channel data
*/
getMemoryChannel(channelNumber: number, readOnly: boolean): Promise<MemoryChannelInfo>;
/**
* Select memory channel for operation
* @param channelNumber Memory channel number to select
*/
selectMemoryChannel(channelNumber: number): Promise<number>;
// RIT/XIT Control
/**
* Set RIT (Receiver Incremental Tuning) offset
* @param offsetHz RIT offset in Hz
*/
setRit(offsetHz: number): Promise<number>;
/**
* Get current RIT offset
* @returns RIT offset in Hz
*/
getRit(): Promise<number>;
/**
* Set XIT (Transmitter Incremental Tuning) offset
* @param offsetHz XIT offset in Hz
*/
setXit(offsetHz: number): Promise<number>;
/**
* Get current XIT offset
* @returns XIT offset in Hz
*/
getXit(): Promise<number>;
/**
* Clear both RIT and XIT offsets
* @returns Success status
*/
clearRitXit(): Promise<number>;
// Scanning Operations
/**
* Start scanning operation
* @param scanType Scan type ('VFO', 'MEM', 'PROG', 'DELTA', 'PRIO')
* @param scanType Scan type ('VFO', 'MEM', 'PROG', 'DELTA', 'PRIO')
* @param channel Channel number for some scan types
*/
startScan(scanType: ScanType, channel: number): Promise<number>;
/**
* Stop scanning operation
*/
stopScan(): Promise<number>;
// Level Controls
/**
* Set radio level (gain, volume, etc.)
* @param levelType Level type ('AF', 'RF', 'SQL', 'RFPOWER', etc.)
* @param value Level value (0.0-1.0 typically)
*/
setLevel(levelType: LevelType, value: number, vfo?: VFO): Promise<number>;
/**
* Get radio level
* @param levelType Level type ('AF', 'RF', 'SQL', 'STRENGTH', etc.)
* @param vfo Optional Hamlib VFO token. If not specified, uses current VFO.
* @returns Level value
*/
getLevel(levelType: LevelType, vfo?: VFO): Promise<number>;
/**
* Get list of supported level types
* @returns Array of supported level types
*/
getSupportedLevels(): string[];
// Function Controls
/**
* Set radio function on/off
* @param functionType Function type ('NB', 'COMP', 'VOX', 'TONE', etc.)
* @param enable true to enable, false to disable
*/
setFunction(functionType: FunctionType, enable: boolean): Promise<number>;
/**
* Get radio function status
* @param functionType Function type ('NB', 'COMP', 'VOX', 'TONE', etc.)
* @returns Function enabled status
*/
getFunction(functionType: FunctionType): Promise<boolean>;
/**
* Get list of supported function types
* @returns Array of supported function types
*/
getSupportedFunctions(): string[];
/**
* Get list of supported radio modes
* @returns Array of supported mode strings
* @example
* const modes = rig.getSupportedModes();
* console.log('Supported modes:', modes); // ['USB', 'LSB', 'CW', 'FM', 'AM', ...]
*/
getSupportedModes(): string[];
// Split Operations
/**
* Set split mode TX frequency
* @param txFrequency TX frequency in Hz
* @param vfo Optional VFO to set TX frequency on ('VFOA' or 'VFOB'). If not specified, uses current VFO
*/
setSplitFreq(txFrequency: number, vfo?: VFO): Promise<number>;
/**
* Get split mode TX frequency
* @param vfo Optional VFO to get TX frequency from ('VFOA' or 'VFOB'). If not specified, uses current VFO
* @returns TX frequency in Hz
*/
getSplitFreq(vfo?: VFO): Promise<number>;
/**
* Set split mode TX mode
* @param txMode TX mode ('USB', 'LSB', 'FM', etc.)
* @param vfo Optional VFO to set TX mode on ('VFOA' or 'VFOB'). If not specified, uses current VFO
*/
setSplitMode(txMode: RadioMode, vfo?: VFO): Promise<number>;
/**
* Set split mode TX mode with width
* @param txMode TX mode ('USB', 'LSB', 'FM', etc.)
* @param txWidth TX bandwidth
* @param vfo Optional VFO to set TX mode on ('VFOA' or 'VFOB'). If not specified, uses current VFO
*/
setSplitMode(txMode: RadioMode, txWidth: number, vfo?: VFO): Promise<number>;
/**
* Get split mode TX mode
* @param vfo Optional VFO to get TX mode from ('VFOA' or 'VFOB'). If not specified, uses current VFO
* @returns TX mode and width
*/
getSplitMode(vfo?: VFO): Promise<SplitModeInfo>;
/**
* Enable/disable split operation
* @param enable true to enable split, false to disable
* @param rxVfo Optional RX VFO ('VFOA' or 'VFOB'). If not specified, uses current VFO
* @param txVfo Optional TX VFO ('VFOA' or 'VFOB'). If not specified, uses current VFO
* @example
* await rig.setSplit(true); // Enable split with defaults
* await rig.setSplit(true, 'VFOA'); // Enable split, RX on VFOA, TX on current VFO
* await rig.setSplit(true, 'VFOA', 'VFOB'); // Enable split, explicit RX and TX VFOs
*/
setSplit(enable: boolean, rxVfo?: VFO, txVfo?: VFO): Promise<number>;
/**
* Get split operation status
* @param vfo Optional VFO to get status from ('VFOA' or 'VFOB'). If not specified, uses current VFO
* @returns Split status and TX VFO
*/
getSplit(vfo?: VFO): Promise<SplitStatusInfo>;
// VFO Operations
/**
* Perform VFO operation
* @param operation VFO operation ('CPY', 'XCHG', 'FROM_VFO', 'TO_VFO', etc.)
*/
vfoOperation(operation: VfoOperationType): Promise<number>;
// Antenna Selection
// Note: setAntenna and getAntenna are defined later with full VFO support
// Serial Port Configuration
/**
* Set serial port configuration parameter
* @param paramName Parameter name for serial configuration
* @param paramValue Parameter value as string
* @example
* // Basic serial settings
* await hamlib.setSerialConfig('data_bits', '8');
* await hamlib.setSerialConfig('stop_bits', '1');
* await hamlib.setSerialConfig('serial_parity', 'Even');
* await hamlib.setSerialConfig('serial_handshake', 'Hardware');
*
* // Control signals
* await hamlib.setSerialConfig('rts_state', 'ON');
* await hamlib.setSerialConfig('dtr_state', 'OFF');
*
* // Communication settings
* await hamlib.setSerialConfig('rate', '115200');
* await hamlib.setSerialConfig('timeout', '1000');
* await hamlib.setSerialConfig('retry', '3');
*
* // Timing control
* await hamlib.setSerialConfig('write_delay', '10');
* await hamlib.setSerialConfig('post_write_delay', '50');
*
* // Advanced features
* await hamlib.setSerialConfig('flushx', 'true');
*/
setSerialConfig(paramName: SerialConfigParam, paramValue: string): Promise<number>;
/**
* Get serial port configuration parameter
* @param paramName Parameter name to retrieve (any SerialConfigParam)
* @returns Parameter value as string
* @example
* // Get basic serial settings
* const dataBits = await hamlib.getSerialConfig('data_bits');
* const parity = await hamlib.getSerialConfig('serial_parity');
* const handshake = await hamlib.getSerialConfig('serial_handshake');
*
* // Get communication settings
* const rate = await hamlib.getSerialConfig('rate');
* const timeout = await hamlib.getSerialConfig('timeout');
* const retry = await hamlib.getSerialConfig('retry');
*
* // Get control signals
* const rtsState = await hamlib.getSerialConfig('rts_state');
* const dtrState = await hamlib.getSerialConfig('dtr_state');
*
* // Get timing and advanced settings
* const writeDelay = await hamlib.getSerialConfig('write_delay');
* const flushx = await hamlib.getSerialConfig('flushx');
*/
getSerialConfig(paramName: SerialConfigParam): Promise<string>;
/**
* Set PTT (Push-to-Talk) type
* @param pttType PTT type ('RIG', 'DTR', 'RTS', 'PARALLEL', 'CM108', 'GPIO', 'GPION', 'NONE')
* @example
* // Use DTR line for PTT
* await hamlib.setPttType('DTR');
*
* // Use RTS line for PTT
* await hamlib.setPttType('RTS');
*
* // Use CAT command for PTT
* await hamlib.setPttType('RIG');
*/
setPttType(pttType: PttType): Promise<number>;
/**
* Get current PTT type
* @returns Current PTT type
*/
getPttType(): Promise<string>;
/**
* Set DCD (Data Carrier Detect) type
* @param dcdType DCD type ('RIG', 'DSR', 'CTS', 'CD', 'PARALLEL', 'CM108', 'GPIO', 'GPION', 'NONE')
* @example
* // Use DSR line for DCD
* await hamlib.setDcdType('DSR');
*
* // Use CTS line for DCD
* await hamlib.setDcdType('CTS');
*
* // Use CAT command for DCD
* await hamlib.setDcdType('RIG');
*/
setDcdType(dcdType: DcdType): Promise<number>;
/**
* Get current DCD type
* @returns Current DCD type
*/
getDcdType(): Promise<string>;
/**
* Get supported serial configuration options
* @returns Object containing all supported configuration parameters and their possible values
* @example
* const configs = hamlib.getSupportedSerialConfigs();