hamlib 0.1.5 → 0.1.7
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 +273 -0
- package/index.d.ts +540 -74
- package/lib/index.js +653 -68
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/hamlib.node +0 -0
- package/prebuilds/linux-arm64/hamlib.node +0 -0
- package/prebuilds/linux-x64/hamlib.node +0 -0
- package/src/hamlib.cpp +3915 -972
- package/src/hamlib.h +84 -1
- package/src/hamlib_compat.h +44 -0
- package/Readme.md +0 -560
package/index.d.ts
CHANGED
|
@@ -42,6 +42,20 @@ interface SupportedRigInfo {
|
|
|
42
42
|
rigType: string;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Antenna information interface
|
|
47
|
+
*/
|
|
48
|
+
interface AntennaInfo {
|
|
49
|
+
/** Currently selected antenna */
|
|
50
|
+
currentAntenna: number;
|
|
51
|
+
/** TX antenna selection */
|
|
52
|
+
txAntenna: number;
|
|
53
|
+
/** RX antenna selection */
|
|
54
|
+
rxAntenna: number;
|
|
55
|
+
/** Additional antenna option/parameter */
|
|
56
|
+
option: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
45
59
|
/**
|
|
46
60
|
* VFO type
|
|
47
61
|
*/
|
|
@@ -224,86 +238,90 @@ declare class HamLib {
|
|
|
224
238
|
* Must be called before other operations
|
|
225
239
|
* @throws Throws error when connection fails
|
|
226
240
|
*/
|
|
227
|
-
open():
|
|
241
|
+
open(): Promise<number>;
|
|
228
242
|
|
|
229
243
|
/**
|
|
230
244
|
* Set VFO (Variable Frequency Oscillator)
|
|
231
245
|
* @param vfo VFO identifier, typically 'VFO-A' or 'VFO-B'
|
|
232
246
|
* @throws Throws error when device doesn't support or operation fails
|
|
233
247
|
*/
|
|
234
|
-
setVfo(vfo: VFO):
|
|
248
|
+
setVfo(vfo: VFO): Promise<number>;
|
|
235
249
|
|
|
236
250
|
/**
|
|
237
251
|
* Set frequency
|
|
238
252
|
* @param frequency Frequency value in hertz
|
|
239
253
|
* @param vfo Optional VFO to set frequency on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
240
254
|
* @example
|
|
241
|
-
* rig.setFrequency(144390000); // Set to 144.39MHz on current VFO
|
|
242
|
-
* rig.setFrequency(144390000, 'VFO-A'); // Set to 144.39MHz on VFO-A
|
|
243
|
-
* rig.setFrequency(144390000, 'VFO-B'); // Set to 144.39MHz on VFO-B
|
|
255
|
+
* await rig.setFrequency(144390000); // Set to 144.39MHz on current VFO
|
|
256
|
+
* await rig.setFrequency(144390000, 'VFO-A'); // Set to 144.39MHz on VFO-A
|
|
257
|
+
* await rig.setFrequency(144390000, 'VFO-B'); // Set to 144.39MHz on VFO-B
|
|
244
258
|
*/
|
|
245
|
-
setFrequency(frequency: number, vfo?: VFO):
|
|
259
|
+
setFrequency(frequency: number, vfo?: VFO): Promise<number>;
|
|
246
260
|
|
|
247
261
|
/**
|
|
248
262
|
* Set radio mode
|
|
249
263
|
* @param mode Radio mode (such as 'USB', 'LSB', 'FM', 'PKTFM')
|
|
250
264
|
* @param bandwidth Optional bandwidth setting ('narrow', 'wide', or default)
|
|
251
|
-
* @
|
|
265
|
+
* @param vfo Optional VFO to set mode on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
252
266
|
* @example
|
|
253
|
-
* rig.setMode('USB');
|
|
254
|
-
* rig.setMode('FM', 'narrow');
|
|
267
|
+
* await rig.setMode('USB');
|
|
268
|
+
* await rig.setMode('FM', 'narrow');
|
|
269
|
+
* await rig.setMode('USB', 'wide', 'VFO-A');
|
|
255
270
|
*/
|
|
256
|
-
setMode(mode: RadioMode, bandwidth?: 'narrow' | 'wide'):
|
|
271
|
+
setMode(mode: RadioMode, bandwidth?: 'narrow' | 'wide', vfo?: VFO): Promise<number>;
|
|
257
272
|
|
|
258
273
|
/**
|
|
259
274
|
* Set PTT (Push-to-Talk) status
|
|
260
275
|
* @param state true to enable PTT, false to disable PTT
|
|
261
276
|
* @note Operates on the current VFO (RIG_VFO_CURR)
|
|
262
277
|
*/
|
|
263
|
-
setPtt(state: boolean):
|
|
278
|
+
setPtt(state: boolean): Promise<number>;
|
|
264
279
|
|
|
265
280
|
/**
|
|
266
281
|
* Get current VFO
|
|
267
282
|
* @returns Current VFO identifier
|
|
268
283
|
*/
|
|
269
|
-
getVfo(): string
|
|
284
|
+
getVfo(): Promise<string>;
|
|
270
285
|
|
|
271
286
|
/**
|
|
272
287
|
* Get current frequency
|
|
273
288
|
* @param vfo Optional VFO to get frequency from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
274
289
|
* @returns Current frequency value in hertz
|
|
275
290
|
* @example
|
|
276
|
-
* rig.getFrequency(); // Get frequency from current VFO
|
|
277
|
-
* rig.getFrequency('VFO-A'); // Get frequency from VFO-A
|
|
278
|
-
* rig.getFrequency('VFO-B'); // Get frequency from VFO-B
|
|
291
|
+
* await rig.getFrequency(); // Get frequency from current VFO
|
|
292
|
+
* await rig.getFrequency('VFO-A'); // Get frequency from VFO-A
|
|
293
|
+
* await rig.getFrequency('VFO-B'); // Get frequency from VFO-B
|
|
279
294
|
*/
|
|
280
|
-
getFrequency(vfo?: VFO): number
|
|
295
|
+
getFrequency(vfo?: VFO): Promise<number>;
|
|
281
296
|
|
|
282
297
|
/**
|
|
283
298
|
* Get current radio mode
|
|
284
299
|
* @returns Object containing mode and bandwidth information
|
|
285
300
|
* @note Operates on the current VFO (RIG_VFO_CURR)
|
|
286
301
|
*/
|
|
287
|
-
getMode(): ModeInfo
|
|
302
|
+
getMode(): Promise<ModeInfo>;
|
|
288
303
|
|
|
289
304
|
/**
|
|
290
305
|
* Get current signal strength
|
|
306
|
+
* @param vfo Optional VFO to get signal strength from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
291
307
|
* @returns Signal strength value
|
|
292
|
-
* @
|
|
308
|
+
* @example
|
|
309
|
+
* const strength = await rig.getStrength(); // Get strength from current VFO
|
|
310
|
+
* const strengthA = await rig.getStrength('VFO-A'); // Get strength from VFO-A
|
|
293
311
|
*/
|
|
294
|
-
getStrength(): number
|
|
312
|
+
getStrength(vfo?: VFO): Promise<number>;
|
|
295
313
|
|
|
296
314
|
/**
|
|
297
315
|
* Close connection to device
|
|
298
316
|
* Does not destroy object, can re-establish connection by calling open()
|
|
299
317
|
*/
|
|
300
|
-
close():
|
|
318
|
+
close(): Promise<number>;
|
|
301
319
|
|
|
302
320
|
/**
|
|
303
321
|
* Destroy connection to device
|
|
304
322
|
* Should delete object reference after calling to enable garbage collection
|
|
305
323
|
*/
|
|
306
|
-
destroy():
|
|
324
|
+
destroy(): Promise<number>;
|
|
307
325
|
|
|
308
326
|
/**
|
|
309
327
|
* Get connection information
|
|
@@ -318,7 +336,7 @@ declare class HamLib {
|
|
|
318
336
|
* @param channelNumber Memory channel number
|
|
319
337
|
* @param channelData Channel data (frequency, mode, description, etc.)
|
|
320
338
|
*/
|
|
321
|
-
setMemoryChannel(channelNumber: number, channelData: MemoryChannelData):
|
|
339
|
+
setMemoryChannel(channelNumber: number, channelData: MemoryChannelData): Promise<number>;
|
|
322
340
|
|
|
323
341
|
/**
|
|
324
342
|
* Get memory channel data
|
|
@@ -326,13 +344,13 @@ declare class HamLib {
|
|
|
326
344
|
* @param readOnly Whether to read in read-only mode (default: true)
|
|
327
345
|
* @returns Channel data
|
|
328
346
|
*/
|
|
329
|
-
getMemoryChannel(channelNumber: number, readOnly?: boolean): MemoryChannelInfo
|
|
347
|
+
getMemoryChannel(channelNumber: number, readOnly?: boolean): Promise<MemoryChannelInfo>;
|
|
330
348
|
|
|
331
349
|
/**
|
|
332
350
|
* Select memory channel for operation
|
|
333
351
|
* @param channelNumber Memory channel number to select
|
|
334
352
|
*/
|
|
335
|
-
selectMemoryChannel(channelNumber: number):
|
|
353
|
+
selectMemoryChannel(channelNumber: number): Promise<number>;
|
|
336
354
|
|
|
337
355
|
// RIT/XIT Control
|
|
338
356
|
|
|
@@ -340,45 +358,53 @@ declare class HamLib {
|
|
|
340
358
|
* Set RIT (Receiver Incremental Tuning) offset
|
|
341
359
|
* @param offsetHz RIT offset in Hz
|
|
342
360
|
*/
|
|
343
|
-
setRit(offsetHz: number):
|
|
361
|
+
setRit(offsetHz: number): Promise<number>;
|
|
344
362
|
|
|
345
363
|
/**
|
|
346
364
|
* Get current RIT offset
|
|
347
365
|
* @returns RIT offset in Hz
|
|
348
366
|
*/
|
|
349
|
-
getRit(): number
|
|
367
|
+
getRit(): Promise<number>;
|
|
350
368
|
|
|
351
369
|
/**
|
|
352
370
|
* Set XIT (Transmitter Incremental Tuning) offset
|
|
353
371
|
* @param offsetHz XIT offset in Hz
|
|
354
372
|
*/
|
|
355
|
-
setXit(offsetHz: number):
|
|
373
|
+
setXit(offsetHz: number): Promise<number>;
|
|
356
374
|
|
|
357
375
|
/**
|
|
358
376
|
* Get current XIT offset
|
|
359
377
|
* @returns XIT offset in Hz
|
|
360
378
|
*/
|
|
361
|
-
getXit(): number
|
|
379
|
+
getXit(): Promise<number>;
|
|
362
380
|
|
|
363
381
|
/**
|
|
364
382
|
* Clear both RIT and XIT offsets
|
|
365
383
|
* @returns Success status
|
|
366
384
|
*/
|
|
367
|
-
clearRitXit():
|
|
385
|
+
clearRitXit(): Promise<number>;
|
|
368
386
|
|
|
369
387
|
// Scanning Operations
|
|
370
388
|
|
|
371
389
|
/**
|
|
372
390
|
* Start scanning operation
|
|
373
391
|
* @param scanType Scan type ('VFO', 'MEM', 'PROG', 'DELTA', 'PRIO')
|
|
374
|
-
* @param
|
|
392
|
+
* @param callback Callback function
|
|
375
393
|
*/
|
|
376
|
-
startScan(scanType: ScanType
|
|
394
|
+
startScan(scanType: ScanType): Promise<number>;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Start scanning operation with channel
|
|
398
|
+
* @param scanType Scan type ('VFO', 'MEM', 'PROG', 'DELTA', 'PRIO')
|
|
399
|
+
* @param channel Channel number for some scan types
|
|
400
|
+
* @param callback Callback function
|
|
401
|
+
*/
|
|
402
|
+
startScan(scanType: ScanType, channel: number): Promise<number>;
|
|
377
403
|
|
|
378
404
|
/**
|
|
379
405
|
* Stop scanning operation
|
|
380
406
|
*/
|
|
381
|
-
stopScan():
|
|
407
|
+
stopScan(): Promise<number>;
|
|
382
408
|
|
|
383
409
|
// Level Controls
|
|
384
410
|
|
|
@@ -387,14 +413,14 @@ declare class HamLib {
|
|
|
387
413
|
* @param levelType Level type ('AF', 'RF', 'SQL', 'RFPOWER', etc.)
|
|
388
414
|
* @param value Level value (0.0-1.0 typically)
|
|
389
415
|
*/
|
|
390
|
-
setLevel(levelType: LevelType, value: number):
|
|
416
|
+
setLevel(levelType: LevelType, value: number): Promise<number>;
|
|
391
417
|
|
|
392
418
|
/**
|
|
393
419
|
* Get radio level
|
|
394
420
|
* @param levelType Level type ('AF', 'RF', 'SQL', 'STRENGTH', etc.)
|
|
395
421
|
* @returns Level value
|
|
396
422
|
*/
|
|
397
|
-
getLevel(levelType: LevelType): number
|
|
423
|
+
getLevel(levelType: LevelType): Promise<number>;
|
|
398
424
|
|
|
399
425
|
/**
|
|
400
426
|
* Get list of supported level types
|
|
@@ -409,14 +435,14 @@ declare class HamLib {
|
|
|
409
435
|
* @param functionType Function type ('NB', 'COMP', 'VOX', 'TONE', etc.)
|
|
410
436
|
* @param enable true to enable, false to disable
|
|
411
437
|
*/
|
|
412
|
-
setFunction(functionType: FunctionType, enable: boolean):
|
|
438
|
+
setFunction(functionType: FunctionType, enable: boolean): Promise<number>;
|
|
413
439
|
|
|
414
440
|
/**
|
|
415
441
|
* Get radio function status
|
|
416
442
|
* @param functionType Function type ('NB', 'COMP', 'VOX', 'TONE', etc.)
|
|
417
443
|
* @returns Function enabled status
|
|
418
444
|
*/
|
|
419
|
-
getFunction(functionType: FunctionType): boolean
|
|
445
|
+
getFunction(functionType: FunctionType): Promise<boolean>;
|
|
420
446
|
|
|
421
447
|
/**
|
|
422
448
|
* Get list of supported function types
|
|
@@ -429,40 +455,57 @@ declare class HamLib {
|
|
|
429
455
|
/**
|
|
430
456
|
* Set split mode TX frequency
|
|
431
457
|
* @param txFrequency TX frequency in Hz
|
|
458
|
+
* @param vfo Optional VFO to set TX frequency on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
432
459
|
*/
|
|
433
|
-
setSplitFreq(txFrequency: number):
|
|
460
|
+
setSplitFreq(txFrequency: number, vfo?: VFO): Promise<number>;
|
|
434
461
|
|
|
435
462
|
/**
|
|
436
463
|
* Get split mode TX frequency
|
|
464
|
+
* @param vfo Optional VFO to get TX frequency from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
437
465
|
* @returns TX frequency in Hz
|
|
438
466
|
*/
|
|
439
|
-
getSplitFreq(): number
|
|
467
|
+
getSplitFreq(vfo?: VFO): Promise<number>;
|
|
440
468
|
|
|
441
469
|
/**
|
|
442
470
|
* Set split mode TX mode
|
|
443
471
|
* @param txMode TX mode ('USB', 'LSB', 'FM', etc.)
|
|
444
|
-
* @param
|
|
472
|
+
* @param vfo Optional VFO to set TX mode on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
473
|
+
*/
|
|
474
|
+
setSplitMode(txMode: RadioMode, vfo?: VFO): Promise<number>;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Set split mode TX mode with width
|
|
478
|
+
* @param txMode TX mode ('USB', 'LSB', 'FM', etc.)
|
|
479
|
+
* @param txWidth TX bandwidth
|
|
480
|
+
* @param vfo Optional VFO to set TX mode on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
445
481
|
*/
|
|
446
|
-
setSplitMode(txMode: RadioMode, txWidth?:
|
|
482
|
+
setSplitMode(txMode: RadioMode, txWidth: number, vfo?: VFO): Promise<number>;
|
|
447
483
|
|
|
448
484
|
/**
|
|
449
485
|
* Get split mode TX mode
|
|
486
|
+
* @param vfo Optional VFO to get TX mode from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
450
487
|
* @returns TX mode and width
|
|
451
488
|
*/
|
|
452
|
-
getSplitMode(): SplitModeInfo
|
|
489
|
+
getSplitMode(vfo?: VFO): Promise<SplitModeInfo>;
|
|
453
490
|
|
|
454
491
|
/**
|
|
455
492
|
* Enable/disable split operation
|
|
456
493
|
* @param enable true to enable split, false to disable
|
|
457
|
-
* @param
|
|
494
|
+
* @param rxVfo Optional RX VFO ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
495
|
+
* @param txVfo Optional TX VFO ('VFO-A' or 'VFO-B'). If not specified, uses VFO-B
|
|
496
|
+
* @example
|
|
497
|
+
* await rig.setSplit(true); // Enable split with defaults
|
|
498
|
+
* await rig.setSplit(true, 'VFO-A'); // Enable split, RX on VFO-A, TX on VFO-B
|
|
499
|
+
* await rig.setSplit(true, 'VFO-A', 'VFO-B'); // Enable split, explicit RX and TX VFOs
|
|
458
500
|
*/
|
|
459
|
-
setSplit(enable: boolean, txVfo?: VFO):
|
|
501
|
+
setSplit(enable: boolean, rxVfo?: VFO, txVfo?: VFO): Promise<number>;
|
|
460
502
|
|
|
461
503
|
/**
|
|
462
504
|
* Get split operation status
|
|
505
|
+
* @param vfo Optional VFO to get status from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
463
506
|
* @returns Split status and TX VFO
|
|
464
507
|
*/
|
|
465
|
-
getSplit(): SplitStatusInfo
|
|
508
|
+
getSplit(vfo?: VFO): Promise<SplitStatusInfo>;
|
|
466
509
|
|
|
467
510
|
// VFO Operations
|
|
468
511
|
|
|
@@ -470,21 +513,11 @@ declare class HamLib {
|
|
|
470
513
|
* Perform VFO operation
|
|
471
514
|
* @param operation VFO operation ('CPY', 'XCHG', 'FROM_VFO', 'TO_VFO', etc.)
|
|
472
515
|
*/
|
|
473
|
-
vfoOperation(operation: VfoOperationType):
|
|
516
|
+
vfoOperation(operation: VfoOperationType): Promise<number>;
|
|
474
517
|
|
|
475
518
|
// Antenna Selection
|
|
476
519
|
|
|
477
|
-
|
|
478
|
-
* Set antenna
|
|
479
|
-
* @param antenna Antenna number (1, 2, 3, etc.)
|
|
480
|
-
*/
|
|
481
|
-
setAntenna(antenna: number): void;
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* Get current antenna
|
|
485
|
-
* @returns Current antenna number
|
|
486
|
-
*/
|
|
487
|
-
getAntenna(): number;
|
|
520
|
+
// Note: setAntenna and getAntenna are defined later with full VFO support
|
|
488
521
|
|
|
489
522
|
// Serial Port Configuration
|
|
490
523
|
|
|
@@ -494,15 +527,15 @@ declare class HamLib {
|
|
|
494
527
|
* @param paramValue Parameter value
|
|
495
528
|
* @example
|
|
496
529
|
* // Set data bits to 8
|
|
497
|
-
* hamlib.setSerialConfig('data_bits', '8');
|
|
530
|
+
* await hamlib.setSerialConfig('data_bits', '8');
|
|
498
531
|
*
|
|
499
532
|
* // Set parity to even
|
|
500
|
-
* hamlib.setSerialConfig('serial_parity', 'Even');
|
|
533
|
+
* await hamlib.setSerialConfig('serial_parity', 'Even');
|
|
501
534
|
*
|
|
502
535
|
* // Set handshake to hardware
|
|
503
|
-
* hamlib.setSerialConfig('serial_handshake', 'Hardware');
|
|
536
|
+
* await hamlib.setSerialConfig('serial_handshake', 'Hardware');
|
|
504
537
|
*/
|
|
505
|
-
setSerialConfig(paramName: SerialConfigParam, paramValue: string):
|
|
538
|
+
setSerialConfig(paramName: SerialConfigParam, paramValue: string): Promise<number>;
|
|
506
539
|
|
|
507
540
|
/**
|
|
508
541
|
* Get serial port configuration parameter
|
|
@@ -510,54 +543,54 @@ declare class HamLib {
|
|
|
510
543
|
* @returns Parameter value
|
|
511
544
|
* @example
|
|
512
545
|
* // Get current data bits setting
|
|
513
|
-
* const dataBits = hamlib.getSerialConfig('data_bits');
|
|
546
|
+
* const dataBits = await hamlib.getSerialConfig('data_bits');
|
|
514
547
|
*
|
|
515
548
|
* // Get current parity setting
|
|
516
|
-
* const parity = hamlib.getSerialConfig('serial_parity');
|
|
549
|
+
* const parity = await hamlib.getSerialConfig('serial_parity');
|
|
517
550
|
*/
|
|
518
|
-
getSerialConfig(paramName: SerialConfigParam): string
|
|
551
|
+
getSerialConfig(paramName: SerialConfigParam): Promise<string>;
|
|
519
552
|
|
|
520
553
|
/**
|
|
521
554
|
* Set PTT (Push-to-Talk) type
|
|
522
555
|
* @param pttType PTT type ('RIG', 'DTR', 'RTS', 'PARALLEL', 'CM108', 'GPIO', 'GPION', 'NONE')
|
|
523
556
|
* @example
|
|
524
557
|
* // Use DTR line for PTT
|
|
525
|
-
* hamlib.setPttType('DTR');
|
|
558
|
+
* await hamlib.setPttType('DTR');
|
|
526
559
|
*
|
|
527
560
|
* // Use RTS line for PTT
|
|
528
|
-
* hamlib.setPttType('RTS');
|
|
561
|
+
* await hamlib.setPttType('RTS');
|
|
529
562
|
*
|
|
530
563
|
* // Use CAT command for PTT
|
|
531
|
-
* hamlib.setPttType('RIG');
|
|
564
|
+
* await hamlib.setPttType('RIG');
|
|
532
565
|
*/
|
|
533
|
-
setPttType(pttType: PttType):
|
|
566
|
+
setPttType(pttType: PttType): Promise<number>;
|
|
534
567
|
|
|
535
568
|
/**
|
|
536
569
|
* Get current PTT type
|
|
537
570
|
* @returns Current PTT type
|
|
538
571
|
*/
|
|
539
|
-
getPttType(): string
|
|
572
|
+
getPttType(): Promise<string>;
|
|
540
573
|
|
|
541
574
|
/**
|
|
542
575
|
* Set DCD (Data Carrier Detect) type
|
|
543
576
|
* @param dcdType DCD type ('RIG', 'DSR', 'CTS', 'CD', 'PARALLEL', 'CM108', 'GPIO', 'GPION', 'NONE')
|
|
544
577
|
* @example
|
|
545
578
|
* // Use DSR line for DCD
|
|
546
|
-
* hamlib.setDcdType('DSR');
|
|
579
|
+
* await hamlib.setDcdType('DSR');
|
|
547
580
|
*
|
|
548
581
|
* // Use CTS line for DCD
|
|
549
|
-
* hamlib.setDcdType('CTS');
|
|
582
|
+
* await hamlib.setDcdType('CTS');
|
|
550
583
|
*
|
|
551
584
|
* // Use CAT command for DCD
|
|
552
|
-
* hamlib.setDcdType('RIG');
|
|
585
|
+
* await hamlib.setDcdType('RIG');
|
|
553
586
|
*/
|
|
554
|
-
setDcdType(dcdType: DcdType):
|
|
587
|
+
setDcdType(dcdType: DcdType): Promise<number>;
|
|
555
588
|
|
|
556
589
|
/**
|
|
557
590
|
* Get current DCD type
|
|
558
591
|
* @returns Current DCD type
|
|
559
592
|
*/
|
|
560
|
-
getDcdType(): string
|
|
593
|
+
getDcdType(): Promise<string>;
|
|
561
594
|
|
|
562
595
|
/**
|
|
563
596
|
* Get supported serial configuration options
|
|
@@ -568,6 +601,438 @@ declare class HamLib {
|
|
|
568
601
|
* console.log('Supported PTT types:', configs.ptt_type);
|
|
569
602
|
*/
|
|
570
603
|
getSupportedSerialConfigs(): SerialConfigOptions;
|
|
604
|
+
|
|
605
|
+
// Power Control
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Set radio power status
|
|
609
|
+
* @param status Power status (0=OFF, 1=ON, 2=STANDBY, 4=OPERATE, 8=UNKNOWN)
|
|
610
|
+
* @returns Success status
|
|
611
|
+
* @example
|
|
612
|
+
* await rig.setPowerstat(1); // Power on
|
|
613
|
+
* await rig.setPowerstat(0); // Power off
|
|
614
|
+
* await rig.setPowerstat(2); // Standby mode
|
|
615
|
+
*/
|
|
616
|
+
setPowerstat(status: number): Promise<number>;
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Get current radio power status
|
|
620
|
+
* @returns Power status (0=OFF, 1=ON, 2=STANDBY, 4=OPERATE, 8=UNKNOWN)
|
|
621
|
+
* @example
|
|
622
|
+
* const powerStatus = await rig.getPowerstat();
|
|
623
|
+
* if (powerStatus === 1) {
|
|
624
|
+
* console.log('Radio is powered on');
|
|
625
|
+
* }
|
|
626
|
+
*/
|
|
627
|
+
getPowerstat(): Promise<number>;
|
|
628
|
+
|
|
629
|
+
// PTT Status Detection
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Get current PTT status
|
|
633
|
+
* @param vfo Optional VFO to get PTT status from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
634
|
+
* @returns PTT status (true if transmitting, false if receiving)
|
|
635
|
+
* @example
|
|
636
|
+
* const isTransmitting = await rig.getPtt();
|
|
637
|
+
* if (isTransmitting) {
|
|
638
|
+
* console.log('Radio is transmitting');
|
|
639
|
+
* }
|
|
640
|
+
*/
|
|
641
|
+
getPtt(vfo?: VFO): Promise<boolean>;
|
|
642
|
+
|
|
643
|
+
// Data Carrier Detect
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Get current DCD (Data Carrier Detect) status
|
|
647
|
+
* @param vfo Optional VFO to get DCD status from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
648
|
+
* @returns DCD status (true if carrier detected, false if no carrier)
|
|
649
|
+
* @example
|
|
650
|
+
* const carrierDetected = await rig.getDcd();
|
|
651
|
+
* if (carrierDetected) {
|
|
652
|
+
* console.log('Carrier detected');
|
|
653
|
+
* }
|
|
654
|
+
*/
|
|
655
|
+
getDcd(vfo?: VFO): Promise<boolean>;
|
|
656
|
+
|
|
657
|
+
// Tuning Step Control
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Set tuning step
|
|
661
|
+
* @param step Tuning step in Hz
|
|
662
|
+
* @param vfo Optional VFO to set tuning step on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
663
|
+
* @returns Success status
|
|
664
|
+
* @example
|
|
665
|
+
* await rig.setTuningStep(25000); // 25 kHz steps
|
|
666
|
+
* await rig.setTuningStep(12500); // 12.5 kHz steps
|
|
667
|
+
* await rig.setTuningStep(100); // 100 Hz steps for HF
|
|
668
|
+
*/
|
|
669
|
+
setTuningStep(step: number, vfo?: VFO): Promise<number>;
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Get current tuning step
|
|
673
|
+
* @param vfo Optional VFO to get tuning step from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
674
|
+
* @returns Current tuning step in Hz
|
|
675
|
+
* @example
|
|
676
|
+
* const step = await rig.getTuningStep();
|
|
677
|
+
* console.log(`Current tuning step: ${step} Hz`);
|
|
678
|
+
*/
|
|
679
|
+
getTuningStep(vfo?: VFO): Promise<number>;
|
|
680
|
+
|
|
681
|
+
// Repeater Control
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Set repeater shift direction
|
|
685
|
+
* @param shift Repeater shift direction ('NONE', 'MINUS', 'PLUS', '-', '+')
|
|
686
|
+
* @param vfo Optional VFO to set repeater shift on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
687
|
+
* @returns Success status
|
|
688
|
+
* @example
|
|
689
|
+
* await rig.setRepeaterShift('PLUS'); // Positive shift (+)
|
|
690
|
+
* await rig.setRepeaterShift('MINUS'); // Negative shift (-)
|
|
691
|
+
* await rig.setRepeaterShift('NONE'); // No shift (simplex)
|
|
692
|
+
*/
|
|
693
|
+
setRepeaterShift(shift: 'NONE' | 'MINUS' | 'PLUS' | '-' | '+' | 'none' | 'minus' | 'plus', vfo?: VFO): Promise<number>;
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Get current repeater shift direction
|
|
697
|
+
* @param vfo Optional VFO to get repeater shift from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
698
|
+
* @returns Current repeater shift direction
|
|
699
|
+
* @example
|
|
700
|
+
* const shift = await rig.getRepeaterShift();
|
|
701
|
+
* console.log(`Repeater shift: ${shift}`); // 'None', 'Minus', or 'Plus'
|
|
702
|
+
*/
|
|
703
|
+
getRepeaterShift(vfo?: VFO): Promise<string>;
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Set repeater offset frequency
|
|
707
|
+
* @param offset Repeater offset in Hz
|
|
708
|
+
* @param vfo Optional VFO to set repeater offset on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
709
|
+
* @returns Success status
|
|
710
|
+
* @example
|
|
711
|
+
* await rig.setRepeaterOffset(600000); // 600 kHz offset (2m band)
|
|
712
|
+
* await rig.setRepeaterOffset(5000000); // 5 MHz offset (70cm band)
|
|
713
|
+
*/
|
|
714
|
+
setRepeaterOffset(offset: number, vfo?: VFO): Promise<number>;
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Get current repeater offset frequency
|
|
718
|
+
* @param vfo Optional VFO to get repeater offset from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
719
|
+
* @returns Current repeater offset in Hz
|
|
720
|
+
* @example
|
|
721
|
+
* const offset = await rig.getRepeaterOffset();
|
|
722
|
+
* console.log(`Repeater offset: ${offset} Hz`);
|
|
723
|
+
*/
|
|
724
|
+
getRepeaterOffset(vfo?: VFO): Promise<number>;
|
|
725
|
+
|
|
726
|
+
// CTCSS/DCS Tone Control
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Set CTCSS tone frequency
|
|
730
|
+
* @param tone CTCSS tone frequency in tenths of Hz (e.g., 1000 for 100.0 Hz)
|
|
731
|
+
* @param vfo Optional VFO to set tone on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
732
|
+
* @returns Success status
|
|
733
|
+
* @example
|
|
734
|
+
* await rig.setCtcssTone(1000); // Set 100.0 Hz CTCSS tone
|
|
735
|
+
* await rig.setCtcssTone(1318); // Set 131.8 Hz CTCSS tone
|
|
736
|
+
*/
|
|
737
|
+
setCtcssTone(tone: number, vfo?: VFO): Promise<number>;
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Get current CTCSS tone frequency
|
|
741
|
+
* @param vfo Optional VFO to get tone from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
742
|
+
* @returns Current CTCSS tone frequency in tenths of Hz
|
|
743
|
+
* @example
|
|
744
|
+
* const tone = await rig.getCtcssTone();
|
|
745
|
+
* console.log(`CTCSS tone: ${tone / 10} Hz`);
|
|
746
|
+
*/
|
|
747
|
+
getCtcssTone(vfo?: VFO): Promise<number>;
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Set DCS code
|
|
751
|
+
* @param code DCS code (e.g., 23, 174, 754)
|
|
752
|
+
* @param vfo Optional VFO to set code on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
753
|
+
* @returns Success status
|
|
754
|
+
* @example
|
|
755
|
+
* await rig.setDcsCode(23); // Set DCS code 023
|
|
756
|
+
* await rig.setDcsCode(174); // Set DCS code 174
|
|
757
|
+
*/
|
|
758
|
+
setDcsCode(code: number, vfo?: VFO): Promise<number>;
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Get current DCS code
|
|
762
|
+
* @param vfo Optional VFO to get code from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
763
|
+
* @returns Current DCS code
|
|
764
|
+
* @example
|
|
765
|
+
* const code = await rig.getDcsCode();
|
|
766
|
+
* console.log(`DCS code: ${code.toString().padStart(3, '0')}`);
|
|
767
|
+
*/
|
|
768
|
+
getDcsCode(vfo?: VFO): Promise<number>;
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* Set CTCSS SQL (squelch) tone frequency
|
|
772
|
+
* @param tone CTCSS SQL tone frequency in tenths of Hz (e.g., 1000 for 100.0 Hz)
|
|
773
|
+
* @param vfo Optional VFO to set tone on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
774
|
+
* @returns Success status
|
|
775
|
+
* @example
|
|
776
|
+
* await rig.setCtcssSql(1000); // Set 100.0 Hz CTCSS SQL tone
|
|
777
|
+
*/
|
|
778
|
+
setCtcssSql(tone: number, vfo?: VFO): Promise<number>;
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Get current CTCSS SQL tone frequency
|
|
782
|
+
* @param vfo Optional VFO to get tone from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
783
|
+
* @returns Current CTCSS SQL tone frequency in tenths of Hz
|
|
784
|
+
* @example
|
|
785
|
+
* const tone = await rig.getCtcssSql();
|
|
786
|
+
* console.log(`CTCSS SQL tone: ${tone / 10} Hz`);
|
|
787
|
+
*/
|
|
788
|
+
getCtcssSql(vfo?: VFO): Promise<number>;
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Set DCS SQL (squelch) code
|
|
792
|
+
* @param code DCS SQL code (e.g., 23, 174, 754)
|
|
793
|
+
* @param vfo Optional VFO to set code on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
794
|
+
* @returns Success status
|
|
795
|
+
* @example
|
|
796
|
+
* await rig.setDcsSql(23); // Set DCS SQL code 023
|
|
797
|
+
*/
|
|
798
|
+
setDcsSql(code: number, vfo?: VFO): Promise<number>;
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Get current DCS SQL code
|
|
802
|
+
* @param vfo Optional VFO to get code from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
803
|
+
* @returns Current DCS SQL code
|
|
804
|
+
* @example
|
|
805
|
+
* const code = await rig.getDcsSql();
|
|
806
|
+
* console.log(`DCS SQL code: ${code.toString().padStart(3, '0')}`);
|
|
807
|
+
*/
|
|
808
|
+
getDcsSql(vfo?: VFO): Promise<number>;
|
|
809
|
+
|
|
810
|
+
// Parameter Control
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Set radio parameter
|
|
814
|
+
* @param paramName Parameter name (e.g., 'ANN', 'APO', 'BACKLIGHT', 'BEEP', 'TIME', 'BAT')
|
|
815
|
+
* @param value Parameter value (numeric)
|
|
816
|
+
* @returns Success status
|
|
817
|
+
* @example
|
|
818
|
+
* await rig.setParm('BACKLIGHT', 0.5); // Set backlight to 50%
|
|
819
|
+
* await rig.setParm('BEEP', 1); // Enable beep
|
|
820
|
+
*/
|
|
821
|
+
setParm(paramName: string, value: number): Promise<number>;
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Get radio parameter value
|
|
825
|
+
* @param paramName Parameter name (e.g., 'ANN', 'APO', 'BACKLIGHT', 'BEEP', 'TIME', 'BAT')
|
|
826
|
+
* @returns Parameter value
|
|
827
|
+
* @example
|
|
828
|
+
* const backlight = await rig.getParm('BACKLIGHT');
|
|
829
|
+
* const beep = await rig.getParm('BEEP');
|
|
830
|
+
*/
|
|
831
|
+
getParm(paramName: string): Promise<number>;
|
|
832
|
+
|
|
833
|
+
// DTMF Support
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Send DTMF digits
|
|
837
|
+
* @param digits DTMF digits to send (0-9, A-D, *, #)
|
|
838
|
+
* @param vfo Optional VFO to send from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
839
|
+
* @returns Success status
|
|
840
|
+
* @example
|
|
841
|
+
* await rig.sendDtmf('1234'); // Send DTMF sequence 1234
|
|
842
|
+
* await rig.sendDtmf('*70#'); // Send *70# sequence
|
|
843
|
+
*/
|
|
844
|
+
sendDtmf(digits: string, vfo?: VFO): Promise<number>;
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Receive DTMF digits
|
|
848
|
+
* @param maxLength Maximum number of digits to receive (default: 32)
|
|
849
|
+
* @param vfo Optional VFO to receive from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
850
|
+
* @returns Received DTMF digits and count
|
|
851
|
+
* @example
|
|
852
|
+
* const result = await rig.recvDtmf(10);
|
|
853
|
+
* console.log(`Received DTMF: ${result.digits} (${result.length} digits)`);
|
|
854
|
+
*/
|
|
855
|
+
recvDtmf(maxLength?: number, vfo?: VFO): Promise<{digits: string, length: number}>;
|
|
856
|
+
|
|
857
|
+
// Memory Channel Advanced Operations
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* Get current memory channel number
|
|
861
|
+
* @param vfo Optional VFO to get memory channel from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
862
|
+
* @returns Current memory channel number
|
|
863
|
+
* @example
|
|
864
|
+
* const currentChannel = await rig.getMem();
|
|
865
|
+
* console.log(`Current memory channel: ${currentChannel}`);
|
|
866
|
+
*/
|
|
867
|
+
getMem(vfo?: VFO): Promise<number>;
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Set memory bank
|
|
871
|
+
* @param bank Bank number to select
|
|
872
|
+
* @param vfo Optional VFO to set bank on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
873
|
+
* @returns Success status
|
|
874
|
+
* @example
|
|
875
|
+
* await rig.setBank(1); // Select memory bank 1
|
|
876
|
+
* await rig.setBank(2); // Select memory bank 2
|
|
877
|
+
*/
|
|
878
|
+
setBank(bank: number, vfo?: VFO): Promise<number>;
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* Get total number of memory channels available
|
|
882
|
+
* @returns Total number of memory channels
|
|
883
|
+
* @example
|
|
884
|
+
* const totalChannels = await rig.memCount();
|
|
885
|
+
* console.log(`Total memory channels: ${totalChannels}`);
|
|
886
|
+
*/
|
|
887
|
+
memCount(): Promise<number>;
|
|
888
|
+
|
|
889
|
+
// Morse Code Support
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* Send Morse code message
|
|
893
|
+
* @param message Morse code message to send (text will be converted to Morse)
|
|
894
|
+
* @param vfo Optional VFO to send from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
895
|
+
* @returns Success status
|
|
896
|
+
* @example
|
|
897
|
+
* await rig.sendMorse('CQ CQ DE VK3ABC K'); // Send CQ call
|
|
898
|
+
* await rig.sendMorse('TEST MSG'); // Send test message
|
|
899
|
+
*/
|
|
900
|
+
sendMorse(message: string, vfo?: VFO): Promise<number>;
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Stop current Morse code transmission
|
|
904
|
+
* @param vfo Optional VFO to stop ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
905
|
+
* @returns Success status
|
|
906
|
+
* @example
|
|
907
|
+
* await rig.stopMorse(); // Stop ongoing Morse transmission
|
|
908
|
+
*/
|
|
909
|
+
stopMorse(vfo?: VFO): Promise<number>;
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Wait for Morse code transmission to complete
|
|
913
|
+
* @param vfo Optional VFO to wait on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
914
|
+
* @returns Success status when transmission completes
|
|
915
|
+
* @example
|
|
916
|
+
* await rig.sendMorse('TEST');
|
|
917
|
+
* await rig.waitMorse(); // Wait for transmission to complete
|
|
918
|
+
*/
|
|
919
|
+
waitMorse(vfo?: VFO): Promise<number>;
|
|
920
|
+
|
|
921
|
+
// Voice Memory Support
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Play voice memory channel
|
|
925
|
+
* @param channel Voice memory channel number to play
|
|
926
|
+
* @param vfo Optional VFO to play from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
927
|
+
* @returns Success status
|
|
928
|
+
* @example
|
|
929
|
+
* await rig.sendVoiceMem(1); // Play voice memory channel 1
|
|
930
|
+
* await rig.sendVoiceMem(3); // Play voice memory channel 3
|
|
931
|
+
*/
|
|
932
|
+
sendVoiceMem(channel: number, vfo?: VFO): Promise<number>;
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* Stop voice memory playback
|
|
936
|
+
* @param vfo Optional VFO to stop ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
937
|
+
* @returns Success status
|
|
938
|
+
* @example
|
|
939
|
+
* await rig.stopVoiceMem(); // Stop ongoing voice memory playback
|
|
940
|
+
*/
|
|
941
|
+
stopVoiceMem(vfo?: VFO): Promise<number>;
|
|
942
|
+
|
|
943
|
+
// Complex Split Frequency/Mode Operations
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Set split frequency and mode simultaneously
|
|
947
|
+
* @param txFrequency TX frequency in Hz
|
|
948
|
+
* @param txMode TX mode ('USB', 'LSB', 'FM', etc.)
|
|
949
|
+
* @param txWidth TX bandwidth in Hz
|
|
950
|
+
* @param vfo Optional VFO for split operation ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
951
|
+
* @returns Success status
|
|
952
|
+
* @example
|
|
953
|
+
* await rig.setSplitFreqMode(14205000, 'USB', 2400); // Set split: TX on 14.205 MHz USB 2400Hz width
|
|
954
|
+
* await rig.setSplitFreqMode(145520000, 'FM', 15000); // Set split: TX on 145.52 MHz FM 15kHz width
|
|
955
|
+
*/
|
|
956
|
+
setSplitFreqMode(txFrequency: number, txMode: RadioMode, txWidth: number, vfo?: VFO): Promise<number>;
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* Get split frequency and mode information
|
|
960
|
+
* @param vfo Optional VFO to get split info from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
961
|
+
* @returns Object containing TX frequency, mode, and width
|
|
962
|
+
* @example
|
|
963
|
+
* const splitInfo = await rig.getSplitFreqMode();
|
|
964
|
+
* console.log(`Split TX: ${splitInfo.txFrequency} Hz, Mode: ${splitInfo.txMode}, Width: ${splitInfo.txWidth} Hz`);
|
|
965
|
+
*/
|
|
966
|
+
getSplitFreqMode(vfo?: VFO): Promise<{txFrequency: number, txMode: string, txWidth: number}>;
|
|
967
|
+
|
|
968
|
+
// Antenna Control
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Set antenna selection
|
|
972
|
+
* @param antenna Antenna number to select (1-based)
|
|
973
|
+
* @param vfo Optional VFO to set antenna on ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
974
|
+
* @returns Success status
|
|
975
|
+
* @example
|
|
976
|
+
* await rig.setAntenna(1); // Select antenna 1
|
|
977
|
+
* await rig.setAntenna(2); // Select antenna 2
|
|
978
|
+
*/
|
|
979
|
+
setAntenna(antenna: number, vfo?: VFO): Promise<number>;
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* Get comprehensive antenna information
|
|
983
|
+
* @param vfo Optional VFO to get antenna info from ('VFO-A' or 'VFO-B'). If not specified, uses current VFO
|
|
984
|
+
* @returns Antenna information object containing current, TX, RX antenna settings and option
|
|
985
|
+
* @example
|
|
986
|
+
* const antennaInfo = await rig.getAntenna();
|
|
987
|
+
* console.log(`Current: ${antennaInfo.currentAntenna}`);
|
|
988
|
+
* console.log(`TX: ${antennaInfo.txAntenna}, RX: ${antennaInfo.rxAntenna}`);
|
|
989
|
+
* console.log(`Option: ${antennaInfo.option}`);
|
|
990
|
+
*/
|
|
991
|
+
getAntenna(vfo?: VFO): Promise<AntennaInfo>;
|
|
992
|
+
|
|
993
|
+
// Power Conversion Functions
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* Convert power level to milliwatts
|
|
997
|
+
* @param power Power level (0.0-1.0, where 1.0 = 100% power)
|
|
998
|
+
* @param frequency Frequency in Hz
|
|
999
|
+
* @param mode Radio mode ('USB', 'LSB', 'FM', 'AM', etc.)
|
|
1000
|
+
* @returns Power in milliwatts
|
|
1001
|
+
* @example
|
|
1002
|
+
* const milliwatts = await rig.power2mW(0.5, 14205000, 'USB');
|
|
1003
|
+
* console.log(`50% power = ${milliwatts} mW`);
|
|
1004
|
+
*/
|
|
1005
|
+
power2mW(power: number, frequency: number, mode: RadioMode): Promise<number>;
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* Convert milliwatts to power level
|
|
1009
|
+
* @param milliwatts Power in milliwatts
|
|
1010
|
+
* @param frequency Frequency in Hz
|
|
1011
|
+
* @param mode Radio mode ('USB', 'LSB', 'FM', 'AM', etc.)
|
|
1012
|
+
* @returns Power level (0.0-1.0, where 1.0 = 100% power)
|
|
1013
|
+
* @example
|
|
1014
|
+
* const powerLevel = await rig.mW2power(5000, 14205000, 'USB');
|
|
1015
|
+
* console.log(`5000 mW = ${(powerLevel * 100).toFixed(1)}% power`);
|
|
1016
|
+
*/
|
|
1017
|
+
mW2power(milliwatts: number, frequency: number, mode: RadioMode): Promise<number>;
|
|
1018
|
+
|
|
1019
|
+
// Reset Function
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* Reset radio to default state
|
|
1023
|
+
* @param resetType Reset type ('NONE', 'SOFT', 'VFO', 'MCALL', 'MASTER'). Default: 'SOFT'
|
|
1024
|
+
* - NONE: No reset
|
|
1025
|
+
* - SOFT: Soft reset (preserve some settings)
|
|
1026
|
+
* - VFO: VFO reset
|
|
1027
|
+
* - MCALL: Memory clear
|
|
1028
|
+
* - MASTER: Master reset (complete factory reset)
|
|
1029
|
+
* @returns Success status
|
|
1030
|
+
* @example
|
|
1031
|
+
* await rig.reset('SOFT'); // Soft reset
|
|
1032
|
+
* await rig.reset('MASTER'); // Factory reset (CAUTION: loses all settings!)
|
|
1033
|
+
* await rig.reset(); // Default soft reset
|
|
1034
|
+
*/
|
|
1035
|
+
reset(resetType?: 'NONE' | 'SOFT' | 'VFO' | 'MCALL' | 'MASTER'): Promise<number>;
|
|
571
1036
|
}
|
|
572
1037
|
|
|
573
1038
|
/**
|
|
@@ -578,10 +1043,11 @@ declare const nodeHamlib: {
|
|
|
578
1043
|
};
|
|
579
1044
|
|
|
580
1045
|
// Export types for use elsewhere
|
|
581
|
-
export { ConnectionInfo, ModeInfo, SupportedRigInfo, VFO, RadioMode, MemoryChannelData,
|
|
1046
|
+
export { ConnectionInfo, ModeInfo, SupportedRigInfo, AntennaInfo, VFO, RadioMode, MemoryChannelData,
|
|
582
1047
|
MemoryChannelInfo, SplitModeInfo, SplitStatusInfo, LevelType, FunctionType,
|
|
583
1048
|
ScanType, VfoOperationType, SerialConfigParam, PttType, DcdType, SerialConfigOptions, HamLib };
|
|
584
1049
|
|
|
585
1050
|
// Support both CommonJS and ES module exports
|
|
1051
|
+
// @ts-ignore
|
|
586
1052
|
export = nodeHamlib;
|
|
587
1053
|
export default nodeHamlib;
|