hamlib 0.1.27 → 0.2.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/binding.gyp +18 -85
- package/index.d.ts +259 -4
- package/lib/index.js +234 -0
- package/package.json +1 -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/libhamlib-4.dll +0 -0
- package/prebuilds/win32-x64/node.napi.node +0 -0
- package/src/addon.cpp +2 -2
- package/src/hamlib.cpp +1868 -1126
- package/src/hamlib.h +79 -37
- package/src/shim/hamlib_shim.c +1169 -0
- package/src/shim/hamlib_shim.h +601 -0
- package/prebuilds/BUILD_INFO.txt +0 -14
- package/src/hamlib_compat.h +0 -44
package/binding.gyp
CHANGED
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
"targets": [
|
|
3
3
|
{
|
|
4
4
|
"target_name": "hamlib",
|
|
5
|
-
"sources": [
|
|
5
|
+
"sources": [
|
|
6
6
|
"src/hamlib.cpp",
|
|
7
7
|
"src/decoder.cpp",
|
|
8
8
|
"src/addon.cpp"
|
|
9
9
|
],
|
|
10
10
|
"include_dirs": [
|
|
11
11
|
"include",
|
|
12
|
+
"src/shim",
|
|
12
13
|
"<!@(node -p \"require('node-addon-api').include\")"
|
|
13
14
|
],
|
|
14
15
|
"dependencies": [
|
|
15
16
|
"<!(node -p \"require('node-addon-api').gyp\")"
|
|
16
17
|
],
|
|
17
|
-
"defines": [
|
|
18
|
+
"defines": [
|
|
18
19
|
"NAPI_DISABLE_CPP_EXCEPTIONS"
|
|
19
20
|
],
|
|
20
21
|
"cflags!": [ "-fno-exceptions" ],
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
"/usr/local/include"
|
|
29
30
|
],
|
|
30
31
|
"libraries": [
|
|
32
|
+
"<(module_root_dir)/shim-build/libhamlib_shim.a",
|
|
31
33
|
"<!@(node -e \"if(process.env.HAMLIB_PREFIX) console.log('-L' + process.env.HAMLIB_PREFIX + '/lib')\")",
|
|
32
34
|
"-L/usr/lib",
|
|
33
35
|
"-L/usr/local/lib",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
"/opt/homebrew/opt/libusb/include"
|
|
50
52
|
],
|
|
51
53
|
"libraries": [
|
|
54
|
+
"<(module_root_dir)/shim-build/libhamlib_shim.a",
|
|
52
55
|
"<!@(node -e \"if(process.env.HAMLIB_PREFIX) console.log('-L' + process.env.HAMLIB_PREFIX + '/lib')\")",
|
|
53
56
|
"-L/usr/local/lib",
|
|
54
57
|
"-L/usr/local/opt/hamlib/lib",
|
|
@@ -75,89 +78,19 @@
|
|
|
75
78
|
],
|
|
76
79
|
"conditions": [
|
|
77
80
|
["target_arch==\"x64\"", {
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
],
|
|
92
|
-
"cflags": [
|
|
93
|
-
"-I/mingw64/include"
|
|
94
|
-
],
|
|
95
|
-
"ldflags": [
|
|
96
|
-
"-L/mingw64/lib",
|
|
97
|
-
"-static-libgcc",
|
|
98
|
-
"-static-libstdc++"
|
|
99
|
-
]
|
|
100
|
-
}, {
|
|
101
|
-
# Traditional Windows build with Visual C++
|
|
102
|
-
"include_dirs": [
|
|
103
|
-
# Try environment variable in different formats
|
|
104
|
-
"<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/include')\")",
|
|
105
|
-
# Fallback paths
|
|
106
|
-
"C:/hamlib/include",
|
|
107
|
-
"C:/Program Files/Hamlib/include",
|
|
108
|
-
"C:/Program Files (x86)/Hamlib/include"
|
|
109
|
-
],
|
|
110
|
-
"library_dirs": [
|
|
111
|
-
# Try environment variable paths
|
|
112
|
-
"<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/bin')\")",
|
|
113
|
-
"<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/lib')\")",
|
|
114
|
-
"<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/lib/gcc')\")",
|
|
115
|
-
"<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/lib/x64')\")",
|
|
116
|
-
"<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/lib/msvc')\")",
|
|
117
|
-
# Fallback paths
|
|
118
|
-
"C:/hamlib/bin",
|
|
119
|
-
"C:/hamlib/lib",
|
|
120
|
-
"C:/hamlib/lib/gcc",
|
|
121
|
-
"C:/hamlib/lib/x64",
|
|
122
|
-
"C:/hamlib/lib/Release",
|
|
123
|
-
"C:/Program Files/Hamlib/bin",
|
|
124
|
-
"C:/Program Files/Hamlib/lib",
|
|
125
|
-
"C:/Program Files/Hamlib/lib/gcc",
|
|
126
|
-
"C:/Program Files (x86)/Hamlib/bin",
|
|
127
|
-
"C:/Program Files (x86)/Hamlib/lib"
|
|
128
|
-
],
|
|
129
|
-
"libraries": [
|
|
130
|
-
# Link against the import library present in hamlib-w64 zip
|
|
131
|
-
"libhamlib-4.lib",
|
|
132
|
-
# Common Win32 system libs used by hamlib
|
|
133
|
-
"Ws2_32.lib",
|
|
134
|
-
"Winmm.lib"
|
|
135
|
-
],
|
|
136
|
-
"conditions": [
|
|
137
|
-
# Add pthread paths only if PTHREAD_ROOT is set
|
|
138
|
-
["\"<!(node -e \"console.log(process.env.PTHREAD_ROOT || '')\")\"!=\"\"", {
|
|
139
|
-
"include_dirs": [
|
|
140
|
-
# Headers are placed directly under PTHREAD_ROOT to match this include path
|
|
141
|
-
"<!(node -e \"console.log((process.env.PTHREAD_ROOT || 'C:/pthread-win32'))\")"
|
|
142
|
-
],
|
|
143
|
-
"library_dirs": [
|
|
144
|
-
"<!(node -e \"console.log((process.env.PTHREAD_ROOT || 'C:/pthread-win32') + '/lib/x64')\")",
|
|
145
|
-
"<!(node -e \"console.log((process.env.PTHREAD_ROOT || 'C:/pthread-win32') + '/lib')\")"
|
|
146
|
-
],
|
|
147
|
-
"libraries": [
|
|
148
|
-
# Only link the MSVC import library we download from Sourceware
|
|
149
|
-
"pthreadVC2.lib"
|
|
150
|
-
]
|
|
151
|
-
}]
|
|
152
|
-
],
|
|
153
|
-
"msvs_settings": {
|
|
154
|
-
"VCCLCompilerTool": {
|
|
155
|
-
"ExceptionHandling": 1,
|
|
156
|
-
"AdditionalOptions": ["/std:c++14"]
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}]
|
|
160
|
-
]
|
|
81
|
+
"library_dirs": [
|
|
82
|
+
"<(module_root_dir)/shim-build"
|
|
83
|
+
],
|
|
84
|
+
"libraries": [
|
|
85
|
+
"hamlib_shim.lib",
|
|
86
|
+
"Ws2_32.lib"
|
|
87
|
+
],
|
|
88
|
+
"msvs_settings": {
|
|
89
|
+
"VCCLCompilerTool": {
|
|
90
|
+
"ExceptionHandling": 1,
|
|
91
|
+
"AdditionalOptions": ["/std:c++14"]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
161
94
|
}]
|
|
162
95
|
]
|
|
163
96
|
}]
|
package/index.d.ts
CHANGED
|
@@ -66,6 +66,46 @@ type VFO = 'VFO-A' | 'VFO-B';
|
|
|
66
66
|
*/
|
|
67
67
|
type RadioMode = 'USB' | 'LSB' | 'FM' | 'PKTFM' | 'AM' | 'CW' | 'RTTY' | 'DIG' | string;
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Frequency range information
|
|
71
|
+
*/
|
|
72
|
+
interface FrequencyRange {
|
|
73
|
+
/** Start frequency in Hz */
|
|
74
|
+
startFreq: number;
|
|
75
|
+
/** End frequency in Hz */
|
|
76
|
+
endFreq: number;
|
|
77
|
+
/** Supported modes for this range */
|
|
78
|
+
modes: RadioMode[];
|
|
79
|
+
/** Minimum power in mW */
|
|
80
|
+
lowPower: number;
|
|
81
|
+
/** Maximum power in mW */
|
|
82
|
+
highPower: number;
|
|
83
|
+
/** VFO bitmask */
|
|
84
|
+
vfo: number;
|
|
85
|
+
/** Antenna bitmask */
|
|
86
|
+
antenna: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Tuning step information
|
|
91
|
+
*/
|
|
92
|
+
interface TuningStepInfo {
|
|
93
|
+
/** Modes this step applies to */
|
|
94
|
+
modes: RadioMode[];
|
|
95
|
+
/** Step size in Hz */
|
|
96
|
+
stepHz: number;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Filter information
|
|
101
|
+
*/
|
|
102
|
+
interface FilterInfo {
|
|
103
|
+
/** Modes this filter applies to */
|
|
104
|
+
modes: RadioMode[];
|
|
105
|
+
/** Filter width in Hz */
|
|
106
|
+
width: number;
|
|
107
|
+
}
|
|
108
|
+
|
|
69
109
|
/**
|
|
70
110
|
* Hamlib debug level type
|
|
71
111
|
* Controls the verbosity of Hamlib library debug output
|
|
@@ -1151,6 +1191,220 @@ declare class HamLib {
|
|
|
1151
1191
|
* await rig.reset(); // Default soft reset
|
|
1152
1192
|
*/
|
|
1153
1193
|
reset(resetType?: 'NONE' | 'SOFT' | 'VFO' | 'MCALL' | 'MASTER'): Promise<number>;
|
|
1194
|
+
|
|
1195
|
+
// ===== Rig Info / Raw / Conf (async) =====
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
* Get rig identification info (model, firmware version, etc.)
|
|
1199
|
+
* @returns Rig info string from the backend
|
|
1200
|
+
*/
|
|
1201
|
+
getInfo(): Promise<string>;
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* Send raw command bytes and receive reply
|
|
1205
|
+
* @param data Raw command data to send
|
|
1206
|
+
* @param replyMaxLen Maximum reply length in bytes
|
|
1207
|
+
* @param terminator Optional terminator bytes
|
|
1208
|
+
* @returns Reply data as Buffer
|
|
1209
|
+
*/
|
|
1210
|
+
sendRaw(data: Buffer, replyMaxLen: number, terminator?: Buffer): Promise<Buffer>;
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* Set a backend configuration parameter
|
|
1214
|
+
* @param name Configuration token name
|
|
1215
|
+
* @param value Configuration value
|
|
1216
|
+
* @returns Success status
|
|
1217
|
+
*/
|
|
1218
|
+
setConf(name: string, value: string): Promise<number>;
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Get a backend configuration parameter
|
|
1222
|
+
* @param name Configuration token name
|
|
1223
|
+
* @returns Configuration value
|
|
1224
|
+
*/
|
|
1225
|
+
getConf(name: string): Promise<string>;
|
|
1226
|
+
|
|
1227
|
+
// ===== Passband / Resolution (sync) =====
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* Get normal passband width for a given mode
|
|
1231
|
+
* @param mode Radio mode
|
|
1232
|
+
* @returns Normal passband width in Hz
|
|
1233
|
+
*/
|
|
1234
|
+
getPassbandNormal(mode: RadioMode): number;
|
|
1235
|
+
|
|
1236
|
+
/**
|
|
1237
|
+
* Get narrow passband width for a given mode
|
|
1238
|
+
* @param mode Radio mode
|
|
1239
|
+
* @returns Narrow passband width in Hz
|
|
1240
|
+
*/
|
|
1241
|
+
getPassbandNarrow(mode: RadioMode): number;
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* Get wide passband width for a given mode
|
|
1245
|
+
* @param mode Radio mode
|
|
1246
|
+
* @returns Wide passband width in Hz
|
|
1247
|
+
*/
|
|
1248
|
+
getPassbandWide(mode: RadioMode): number;
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Get frequency resolution (step) for a given mode
|
|
1252
|
+
* @param mode Radio mode
|
|
1253
|
+
* @returns Resolution in Hz
|
|
1254
|
+
*/
|
|
1255
|
+
getResolution(mode: RadioMode): number;
|
|
1256
|
+
|
|
1257
|
+
// ===== Capability queries (sync) =====
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* Get list of supported parameter types
|
|
1261
|
+
* @returns Array of supported parameter type names
|
|
1262
|
+
*/
|
|
1263
|
+
getSupportedParms(): string[];
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* Get list of supported VFO operations
|
|
1267
|
+
* @returns Array of supported VFO operation types
|
|
1268
|
+
*/
|
|
1269
|
+
getSupportedVfoOps(): VfoOperationType[];
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* Get list of supported scan types
|
|
1273
|
+
* @returns Array of supported scan types
|
|
1274
|
+
*/
|
|
1275
|
+
getSupportedScanTypes(): ScanType[];
|
|
1276
|
+
|
|
1277
|
+
// ===== Capability Queries - Batch 2 (sync) =====
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* Get supported preamplifier values
|
|
1281
|
+
* @returns Array of preamp dB values
|
|
1282
|
+
*/
|
|
1283
|
+
getPreampValues(): number[];
|
|
1284
|
+
|
|
1285
|
+
/**
|
|
1286
|
+
* Get supported attenuator values
|
|
1287
|
+
* @returns Array of attenuator dB values
|
|
1288
|
+
*/
|
|
1289
|
+
getAttenuatorValues(): number[];
|
|
1290
|
+
|
|
1291
|
+
/**
|
|
1292
|
+
* Get maximum RIT offset supported
|
|
1293
|
+
* @returns Maximum RIT offset in Hz
|
|
1294
|
+
*/
|
|
1295
|
+
getMaxRit(): number;
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* Get maximum XIT offset supported
|
|
1299
|
+
* @returns Maximum XIT offset in Hz
|
|
1300
|
+
*/
|
|
1301
|
+
getMaxXit(): number;
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* Get maximum IF shift supported
|
|
1305
|
+
* @returns Maximum IF shift in Hz
|
|
1306
|
+
*/
|
|
1307
|
+
getMaxIfShift(): number;
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* Get list of available CTCSS tone frequencies
|
|
1311
|
+
* @returns Array of CTCSS tones in Hz
|
|
1312
|
+
*/
|
|
1313
|
+
getAvailableCtcssTones(): number[];
|
|
1314
|
+
|
|
1315
|
+
/**
|
|
1316
|
+
* Get list of available DCS codes
|
|
1317
|
+
* @returns Array of DCS codes
|
|
1318
|
+
*/
|
|
1319
|
+
getAvailableDcsCodes(): number[];
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* Get supported frequency ranges for RX and TX
|
|
1323
|
+
*/
|
|
1324
|
+
getFrequencyRanges(): { rx: FrequencyRange[]; tx: FrequencyRange[] };
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Get supported tuning steps per mode
|
|
1328
|
+
*/
|
|
1329
|
+
getTuningSteps(): TuningStepInfo[];
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* Get supported filter widths per mode
|
|
1333
|
+
*/
|
|
1334
|
+
getFilterList(): FilterInfo[];
|
|
1335
|
+
|
|
1336
|
+
// ===== Static: Copyright / License =====
|
|
1337
|
+
|
|
1338
|
+
/**
|
|
1339
|
+
* Get Hamlib copyright information
|
|
1340
|
+
* @static
|
|
1341
|
+
*/
|
|
1342
|
+
static getCopyright(): string;
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* Get Hamlib license information
|
|
1346
|
+
* @static
|
|
1347
|
+
*/
|
|
1348
|
+
static getLicense(): string;
|
|
1349
|
+
|
|
1350
|
+
// ===== Lock Mode (Hamlib >= 4.7.0) =====
|
|
1351
|
+
|
|
1352
|
+
/**
|
|
1353
|
+
* Set lock mode to prevent accidental front-panel changes
|
|
1354
|
+
* @param lock - 0 to unlock, 1 to lock
|
|
1355
|
+
*/
|
|
1356
|
+
setLockMode(lock: number): Promise<number>;
|
|
1357
|
+
|
|
1358
|
+
/**
|
|
1359
|
+
* Get current lock mode status
|
|
1360
|
+
* @returns 0 if unlocked, 1 if locked
|
|
1361
|
+
*/
|
|
1362
|
+
getLockMode(): Promise<number>;
|
|
1363
|
+
|
|
1364
|
+
// ===== Clock (Hamlib >= 4.7.0) =====
|
|
1365
|
+
|
|
1366
|
+
/**
|
|
1367
|
+
* Set the rig's internal clock
|
|
1368
|
+
*/
|
|
1369
|
+
setClock(clock: ClockInfo): Promise<number>;
|
|
1370
|
+
|
|
1371
|
+
/**
|
|
1372
|
+
* Get the rig's internal clock
|
|
1373
|
+
*/
|
|
1374
|
+
getClock(): Promise<ClockInfo>;
|
|
1375
|
+
|
|
1376
|
+
// ===== VFO Info (Hamlib >= 4.7.0) =====
|
|
1377
|
+
|
|
1378
|
+
/**
|
|
1379
|
+
* Get comprehensive VFO information in a single call
|
|
1380
|
+
* @param vfo - Optional VFO to query (defaults to current)
|
|
1381
|
+
*/
|
|
1382
|
+
getVfoInfo(vfo?: VFO): Promise<VfoInfo>;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
/**
|
|
1386
|
+
* Clock information for rig's internal clock
|
|
1387
|
+
*/
|
|
1388
|
+
interface ClockInfo {
|
|
1389
|
+
year: number;
|
|
1390
|
+
month: number;
|
|
1391
|
+
day: number;
|
|
1392
|
+
hour: number;
|
|
1393
|
+
min: number;
|
|
1394
|
+
sec: number;
|
|
1395
|
+
msec: number;
|
|
1396
|
+
utcOffset: number;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
/**
|
|
1400
|
+
* VFO information returned by getVfoInfo()
|
|
1401
|
+
*/
|
|
1402
|
+
interface VfoInfo {
|
|
1403
|
+
frequency: number;
|
|
1404
|
+
mode: string;
|
|
1405
|
+
bandwidth: number;
|
|
1406
|
+
split: boolean;
|
|
1407
|
+
satMode: boolean;
|
|
1154
1408
|
}
|
|
1155
1409
|
|
|
1156
1410
|
/**
|
|
@@ -1161,10 +1415,11 @@ declare const nodeHamlib: {
|
|
|
1161
1415
|
};
|
|
1162
1416
|
|
|
1163
1417
|
// Export types for use elsewhere
|
|
1164
|
-
export { ConnectionInfo, ModeInfo, SupportedRigInfo, AntennaInfo, VFO, RadioMode, MemoryChannelData,
|
|
1165
|
-
MemoryChannelInfo, SplitModeInfo, SplitStatusInfo, LevelType, FunctionType,
|
|
1166
|
-
ScanType, VfoOperationType, SerialConfigParam, SerialBaudRate, SerialParity,
|
|
1167
|
-
SerialHandshake, SerialControlState, PttType, DcdType, SerialConfigOptions,
|
|
1418
|
+
export { ConnectionInfo, ModeInfo, SupportedRigInfo, AntennaInfo, VFO, RadioMode, MemoryChannelData,
|
|
1419
|
+
MemoryChannelInfo, SplitModeInfo, SplitStatusInfo, LevelType, FunctionType,
|
|
1420
|
+
ScanType, VfoOperationType, SerialConfigParam, SerialBaudRate, SerialParity,
|
|
1421
|
+
SerialHandshake, SerialControlState, PttType, DcdType, SerialConfigOptions,
|
|
1422
|
+
ClockInfo, VfoInfo, HamLib };
|
|
1168
1423
|
|
|
1169
1424
|
// Support both CommonJS and ES module exports
|
|
1170
1425
|
// @ts-ignore
|
package/lib/index.js
CHANGED
|
@@ -1126,6 +1126,240 @@ class HamLib {
|
|
|
1126
1126
|
async reset(resetType = 'SOFT') {
|
|
1127
1127
|
return this._nativeInstance.reset(resetType);
|
|
1128
1128
|
}
|
|
1129
|
+
|
|
1130
|
+
// Rig Info (async)
|
|
1131
|
+
|
|
1132
|
+
/**
|
|
1133
|
+
* Get rig identification info (model, firmware version, etc.)
|
|
1134
|
+
* @returns {Promise<string>} Rig info string
|
|
1135
|
+
*/
|
|
1136
|
+
async getInfo() {
|
|
1137
|
+
return this._nativeInstance.getInfo();
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* Send raw command bytes and receive reply
|
|
1142
|
+
* @param {Buffer} data - Raw command data to send
|
|
1143
|
+
* @param {number} replyMaxLen - Maximum reply length
|
|
1144
|
+
* @param {Buffer} [terminator] - Optional terminator bytes
|
|
1145
|
+
* @returns {Promise<Buffer>} Reply data
|
|
1146
|
+
*/
|
|
1147
|
+
async sendRaw(data, replyMaxLen, terminator) {
|
|
1148
|
+
if (terminator !== undefined) {
|
|
1149
|
+
return this._nativeInstance.sendRaw(data, replyMaxLen, terminator);
|
|
1150
|
+
}
|
|
1151
|
+
return this._nativeInstance.sendRaw(data, replyMaxLen);
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* Set a backend configuration parameter
|
|
1156
|
+
* @param {string} name - Configuration token name
|
|
1157
|
+
* @param {string} value - Configuration value
|
|
1158
|
+
* @returns {Promise<number>} Success status
|
|
1159
|
+
*/
|
|
1160
|
+
async setConf(name, value) {
|
|
1161
|
+
return this._nativeInstance.setConf(name, value);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
/**
|
|
1165
|
+
* Get a backend configuration parameter
|
|
1166
|
+
* @param {string} name - Configuration token name
|
|
1167
|
+
* @returns {Promise<string>} Configuration value
|
|
1168
|
+
*/
|
|
1169
|
+
async getConf(name) {
|
|
1170
|
+
return this._nativeInstance.getConf(name);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
// Passband / Resolution (sync)
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* Get normal passband width for a given mode
|
|
1177
|
+
* @param {string} mode - Radio mode ('USB', 'LSB', 'FM', etc.)
|
|
1178
|
+
* @returns {number} Normal passband width in Hz
|
|
1179
|
+
*/
|
|
1180
|
+
getPassbandNormal(mode) {
|
|
1181
|
+
return this._nativeInstance.getPassbandNormal(mode);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* Get narrow passband width for a given mode
|
|
1186
|
+
* @param {string} mode - Radio mode ('USB', 'LSB', 'FM', etc.)
|
|
1187
|
+
* @returns {number} Narrow passband width in Hz
|
|
1188
|
+
*/
|
|
1189
|
+
getPassbandNarrow(mode) {
|
|
1190
|
+
return this._nativeInstance.getPassbandNarrow(mode);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Get wide passband width for a given mode
|
|
1195
|
+
* @param {string} mode - Radio mode ('USB', 'LSB', 'FM', etc.)
|
|
1196
|
+
* @returns {number} Wide passband width in Hz
|
|
1197
|
+
*/
|
|
1198
|
+
getPassbandWide(mode) {
|
|
1199
|
+
return this._nativeInstance.getPassbandWide(mode);
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* Get frequency resolution (step) for a given mode
|
|
1204
|
+
* @param {string} mode - Radio mode ('USB', 'LSB', 'FM', etc.)
|
|
1205
|
+
* @returns {number} Resolution in Hz
|
|
1206
|
+
*/
|
|
1207
|
+
getResolution(mode) {
|
|
1208
|
+
return this._nativeInstance.getResolution(mode);
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* Get list of supported parameter types
|
|
1213
|
+
* @returns {Array<string>} Array of supported parameter types
|
|
1214
|
+
*/
|
|
1215
|
+
getSupportedParms() {
|
|
1216
|
+
return this._nativeInstance.getSupportedParms();
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* Get list of supported VFO operations
|
|
1221
|
+
* @returns {Array<string>} Array of supported VFO operation types
|
|
1222
|
+
*/
|
|
1223
|
+
getSupportedVfoOps() {
|
|
1224
|
+
return this._nativeInstance.getSupportedVfoOps();
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* Get list of supported scan types
|
|
1229
|
+
* @returns {Array<string>} Array of supported scan types
|
|
1230
|
+
*/
|
|
1231
|
+
getSupportedScanTypes() {
|
|
1232
|
+
return this._nativeInstance.getSupportedScanTypes();
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
// Capability Query - Batch 2 (sync)
|
|
1236
|
+
|
|
1237
|
+
/**
|
|
1238
|
+
* Get supported preamplifier values
|
|
1239
|
+
* @returns {number[]} Array of preamp dB values (e.g., [10, 20])
|
|
1240
|
+
*/
|
|
1241
|
+
getPreampValues() {
|
|
1242
|
+
return this._nativeInstance.getPreampValues();
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Get supported attenuator values
|
|
1247
|
+
* @returns {number[]} Array of attenuator dB values (e.g., [10, 20, 30])
|
|
1248
|
+
*/
|
|
1249
|
+
getAttenuatorValues() {
|
|
1250
|
+
return this._nativeInstance.getAttenuatorValues();
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* Get maximum RIT offset supported
|
|
1255
|
+
* @returns {number} Maximum RIT offset in Hz
|
|
1256
|
+
*/
|
|
1257
|
+
getMaxRit() {
|
|
1258
|
+
return this._nativeInstance.getMaxRit();
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
/**
|
|
1262
|
+
* Get maximum XIT offset supported
|
|
1263
|
+
* @returns {number} Maximum XIT offset in Hz
|
|
1264
|
+
*/
|
|
1265
|
+
getMaxXit() {
|
|
1266
|
+
return this._nativeInstance.getMaxXit();
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* Get maximum IF shift supported
|
|
1271
|
+
* @returns {number} Maximum IF shift in Hz
|
|
1272
|
+
*/
|
|
1273
|
+
getMaxIfShift() {
|
|
1274
|
+
return this._nativeInstance.getMaxIfShift();
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* Get list of available CTCSS tone frequencies
|
|
1279
|
+
* @returns {number[]} Array of CTCSS tones in Hz (e.g., [67.0, 71.9, ...])
|
|
1280
|
+
*/
|
|
1281
|
+
getAvailableCtcssTones() {
|
|
1282
|
+
return this._nativeInstance.getAvailableCtcssTones();
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
/**
|
|
1286
|
+
* Get list of available DCS codes
|
|
1287
|
+
* @returns {number[]} Array of DCS codes (integer values)
|
|
1288
|
+
*/
|
|
1289
|
+
getAvailableDcsCodes() {
|
|
1290
|
+
return this._nativeInstance.getAvailableDcsCodes();
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
/**
|
|
1294
|
+
* Get supported frequency ranges for RX and TX
|
|
1295
|
+
* @returns {{ rx: FrequencyRange[], tx: FrequencyRange[] }} RX and TX frequency ranges
|
|
1296
|
+
*/
|
|
1297
|
+
getFrequencyRanges() {
|
|
1298
|
+
return this._nativeInstance.getFrequencyRanges();
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
/**
|
|
1302
|
+
* Get supported tuning steps per mode
|
|
1303
|
+
* @returns {TuningStepInfo[]} Array of tuning step info objects
|
|
1304
|
+
*/
|
|
1305
|
+
getTuningSteps() {
|
|
1306
|
+
return this._nativeInstance.getTuningSteps();
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* Get supported filter widths per mode
|
|
1311
|
+
* @returns {FilterInfo[]} Array of filter info objects
|
|
1312
|
+
*/
|
|
1313
|
+
getFilterList() {
|
|
1314
|
+
return this._nativeInstance.getFilterList();
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* Get Hamlib copyright information
|
|
1319
|
+
* @returns {string} Copyright string
|
|
1320
|
+
* @static
|
|
1321
|
+
*/
|
|
1322
|
+
static getCopyright() {
|
|
1323
|
+
return nativeModule.HamLib.getCopyright();
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Get Hamlib license information
|
|
1328
|
+
* @returns {string} License string
|
|
1329
|
+
* @static
|
|
1330
|
+
*/
|
|
1331
|
+
static getLicense() {
|
|
1332
|
+
return nativeModule.HamLib.getLicense();
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
// Lock Mode (Hamlib >= 4.7.0)
|
|
1336
|
+
|
|
1337
|
+
async setLockMode(lock) {
|
|
1338
|
+
return this._nativeInstance.setLockMode(lock);
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
async getLockMode() {
|
|
1342
|
+
return this._nativeInstance.getLockMode();
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
// Clock (Hamlib >= 4.7.0)
|
|
1346
|
+
|
|
1347
|
+
async setClock({ year, month, day, hour, min, sec, msec, utcOffset }) {
|
|
1348
|
+
return this._nativeInstance.setClock({ year, month, day, hour, min, sec, msec, utcOffset });
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
async getClock() {
|
|
1352
|
+
return this._nativeInstance.getClock();
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
// VFO Info (Hamlib >= 4.7.0)
|
|
1356
|
+
|
|
1357
|
+
async getVfoInfo(vfo) {
|
|
1358
|
+
if (vfo) {
|
|
1359
|
+
return this._nativeInstance.getVfoInfo(vfo);
|
|
1360
|
+
}
|
|
1361
|
+
return this._nativeInstance.getVfoInfo();
|
|
1362
|
+
}
|
|
1129
1363
|
}
|
|
1130
1364
|
|
|
1131
1365
|
// Set debug level to NONE by default to prevent unwanted output
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|