hamlib 0.2.7 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -6
- package/binding.gyp +8 -2
- package/docs/build-hamlib-from-source.md +640 -0
- package/docs/prebuilt-bundling.md +347 -0
- package/index.d.ts +126 -6
- package/lib/index.js +162 -1
- package/package.json +5 -2
- package/prebuilds/darwin-arm64/libhamlib.4.dylib +0 -0
- package/prebuilds/darwin-arm64/node.napi.node +0 -0
- package/prebuilds/darwin-x64/libhamlib.4.dylib +0 -0
- package/prebuilds/darwin-x64/node.napi.node +0 -0
- package/prebuilds/linux-arm64/libhamlib.so +0 -0
- package/prebuilds/linux-arm64/libhamlib.so.4 +0 -0
- package/prebuilds/linux-arm64/libhamlib.so.4.0.7 +0 -0
- package/prebuilds/linux-arm64/node.napi.node +0 -0
- package/prebuilds/linux-x64/libhamlib.so +0 -0
- package/prebuilds/linux-x64/libhamlib.so.4 +0 -0
- package/prebuilds/linux-x64/libhamlib.so.4.0.7 +0 -0
- package/prebuilds/linux-x64/node.napi.node +0 -0
- package/prebuilds/win32-x64/hamlib_shim.dll +0 -0
- package/prebuilds/win32-x64/node.napi.node +0 -0
- package/src/hamlib.cpp +291 -10
- package/src/hamlib.h +14 -0
- package/src/shim/hamlib_shim.c +135 -0
- package/src/shim/hamlib_shim.h +54 -0
package/src/shim/hamlib_shim.h
CHANGED
|
@@ -199,6 +199,14 @@ typedef void* hamlib_shim_handle_t;
|
|
|
199
199
|
#define SHIM_RIG_LEVEL_MONITOR_GAIN (1ULL << 37)
|
|
200
200
|
#define SHIM_RIG_LEVEL_NB (1ULL << 38)
|
|
201
201
|
#define SHIM_RIG_LEVEL_RFPOWER_METER_WATTS (1ULL << 39)
|
|
202
|
+
#define SHIM_RIG_LEVEL_SPECTRUM_MODE (1ULL << 40)
|
|
203
|
+
#define SHIM_RIG_LEVEL_SPECTRUM_SPAN (1ULL << 41)
|
|
204
|
+
#define SHIM_RIG_LEVEL_SPECTRUM_EDGE_LOW (1ULL << 42)
|
|
205
|
+
#define SHIM_RIG_LEVEL_SPECTRUM_EDGE_HIGH (1ULL << 43)
|
|
206
|
+
#define SHIM_RIG_LEVEL_SPECTRUM_SPEED (1ULL << 44)
|
|
207
|
+
#define SHIM_RIG_LEVEL_SPECTRUM_REF (1ULL << 45)
|
|
208
|
+
#define SHIM_RIG_LEVEL_SPECTRUM_AVG (1ULL << 46)
|
|
209
|
+
#define SHIM_RIG_LEVEL_SPECTRUM_ATT (1ULL << 47)
|
|
202
210
|
#define SHIM_RIG_LEVEL_TEMP_METER (1ULL << 48)
|
|
203
211
|
|
|
204
212
|
/* ===== Function constants (bit positions for setting_t / uint64_t) ===== */
|
|
@@ -234,6 +242,12 @@ typedef void* hamlib_shim_handle_t;
|
|
|
234
242
|
#define SHIM_RIG_FUNC_TBURST (1ULL << 29)
|
|
235
243
|
#define SHIM_RIG_FUNC_TUNER (1ULL << 30)
|
|
236
244
|
#define SHIM_RIG_FUNC_XIT (1ULL << 31)
|
|
245
|
+
#define SHIM_RIG_FUNC_TRANSCEIVE (1ULL << 42)
|
|
246
|
+
#define SHIM_RIG_FUNC_SPECTRUM (1ULL << 43)
|
|
247
|
+
#define SHIM_RIG_FUNC_SPECTRUM_HOLD (1ULL << 44)
|
|
248
|
+
#define SHIM_RIG_FUNC_SEND_MORSE (1ULL << 45)
|
|
249
|
+
#define SHIM_RIG_FUNC_SEND_VOICE_MEM (1ULL << 46)
|
|
250
|
+
#define SHIM_RIG_FUNC_OVF_STATUS (1ULL << 47)
|
|
237
251
|
|
|
238
252
|
/* ===== VFO operation constants ===== */
|
|
239
253
|
#define SHIM_RIG_OP_CPY (1<<0)
|
|
@@ -279,6 +293,31 @@ typedef struct {
|
|
|
279
293
|
int rig_type;
|
|
280
294
|
} shim_rig_info_t;
|
|
281
295
|
|
|
296
|
+
typedef struct {
|
|
297
|
+
int id;
|
|
298
|
+
char name[64];
|
|
299
|
+
} shim_spectrum_scope_t;
|
|
300
|
+
|
|
301
|
+
typedef struct {
|
|
302
|
+
int id;
|
|
303
|
+
char name[64];
|
|
304
|
+
} shim_spectrum_avg_mode_t;
|
|
305
|
+
|
|
306
|
+
typedef struct {
|
|
307
|
+
int id;
|
|
308
|
+
int data_level_min;
|
|
309
|
+
int data_level_max;
|
|
310
|
+
double signal_strength_min;
|
|
311
|
+
double signal_strength_max;
|
|
312
|
+
int spectrum_mode;
|
|
313
|
+
double center_freq;
|
|
314
|
+
double span_freq;
|
|
315
|
+
double low_edge_freq;
|
|
316
|
+
double high_edge_freq;
|
|
317
|
+
int data_length;
|
|
318
|
+
unsigned char data[2048];
|
|
319
|
+
} shim_spectrum_line_t;
|
|
320
|
+
|
|
282
321
|
/* ===== Callback types ===== */
|
|
283
322
|
|
|
284
323
|
/* Frequency change callback: (handle, vfo, freq, arg) -> int */
|
|
@@ -287,6 +326,9 @@ typedef int (*shim_freq_cb_t)(void* handle, int vfo, double freq, void* arg);
|
|
|
287
326
|
/* PTT change callback: (handle, vfo, ptt, arg) -> int */
|
|
288
327
|
typedef int (*shim_ptt_cb_t)(void* handle, int vfo, int ptt, void* arg);
|
|
289
328
|
|
|
329
|
+
/* Spectrum line callback: (handle, line, arg) -> int */
|
|
330
|
+
typedef int (*shim_spectrum_cb_t)(void* handle, const shim_spectrum_line_t* line, void* arg);
|
|
331
|
+
|
|
290
332
|
/* Rig list callback: (info, data) -> int */
|
|
291
333
|
typedef int (*shim_rig_list_cb_t)(const shim_rig_info_t* info, void* data);
|
|
292
334
|
|
|
@@ -392,6 +434,7 @@ SHIM_API int shim_rig_set_level_f(hamlib_shim_handle_t h, int vfo, uint64_t leve
|
|
|
392
434
|
SHIM_API int shim_rig_set_level_i(hamlib_shim_handle_t h, int vfo, uint64_t level, int value);
|
|
393
435
|
SHIM_API int shim_rig_get_level_f(hamlib_shim_handle_t h, int vfo, uint64_t level, float* value);
|
|
394
436
|
SHIM_API int shim_rig_get_level_i(hamlib_shim_handle_t h, int vfo, uint64_t level, int* value);
|
|
437
|
+
SHIM_API int shim_rig_level_is_float(uint64_t level);
|
|
395
438
|
/* Auto-detect int/float level type, returns value as double */
|
|
396
439
|
SHIM_API int shim_rig_get_level_auto(hamlib_shim_handle_t h, int vfo, uint64_t level, double* value);
|
|
397
440
|
|
|
@@ -510,6 +553,7 @@ SHIM_API int shim_rig_reset(hamlib_shim_handle_t h, int reset_type);
|
|
|
510
553
|
|
|
511
554
|
SHIM_API int shim_rig_set_freq_callback(hamlib_shim_handle_t h, shim_freq_cb_t cb, void* arg);
|
|
512
555
|
SHIM_API int shim_rig_set_ptt_callback(hamlib_shim_handle_t h, shim_ptt_cb_t cb, void* arg);
|
|
556
|
+
SHIM_API int shim_rig_set_spectrum_callback(hamlib_shim_handle_t h, shim_spectrum_cb_t cb, void* arg);
|
|
513
557
|
SHIM_API int shim_rig_set_trn(hamlib_shim_handle_t h, int trn);
|
|
514
558
|
|
|
515
559
|
/* ===== Capability queries (replaces direct caps-> access) ===== */
|
|
@@ -519,6 +563,16 @@ SHIM_API uint64_t shim_rig_get_caps_has_get_level(hamlib_shim_handle_t h);
|
|
|
519
563
|
SHIM_API uint64_t shim_rig_get_caps_has_set_level(hamlib_shim_handle_t h);
|
|
520
564
|
SHIM_API uint64_t shim_rig_get_caps_has_get_func(hamlib_shim_handle_t h);
|
|
521
565
|
SHIM_API uint64_t shim_rig_get_caps_has_set_func(hamlib_shim_handle_t h);
|
|
566
|
+
SHIM_API int shim_rig_is_async_data_supported(hamlib_shim_handle_t h);
|
|
567
|
+
SHIM_API int shim_rig_get_caps_spectrum_scope_count(hamlib_shim_handle_t h);
|
|
568
|
+
SHIM_API int shim_rig_get_caps_spectrum_scope(hamlib_shim_handle_t h, int index, shim_spectrum_scope_t* out);
|
|
569
|
+
SHIM_API int shim_rig_get_caps_spectrum_mode_count(hamlib_shim_handle_t h);
|
|
570
|
+
SHIM_API int shim_rig_get_caps_spectrum_mode(hamlib_shim_handle_t h, int index, int* out);
|
|
571
|
+
SHIM_API int shim_rig_get_caps_spectrum_span_count(hamlib_shim_handle_t h);
|
|
572
|
+
SHIM_API int shim_rig_get_caps_spectrum_span(hamlib_shim_handle_t h, int index, double* out);
|
|
573
|
+
SHIM_API int shim_rig_get_caps_spectrum_avg_mode_count(hamlib_shim_handle_t h);
|
|
574
|
+
SHIM_API int shim_rig_get_caps_spectrum_avg_mode(hamlib_shim_handle_t h, int index, shim_spectrum_avg_mode_t* out);
|
|
575
|
+
SHIM_API const char* shim_rig_str_spectrum_mode(int mode);
|
|
522
576
|
|
|
523
577
|
/* Format mode bitmask to string list */
|
|
524
578
|
SHIM_API int shim_rig_sprintf_mode(uint64_t modes, char* buf, int buflen);
|