hamlib 0.1.23 → 0.1.25

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 CHANGED
@@ -23,10 +23,12 @@
23
23
  # Linux configuration
24
24
  ["OS==\"linux\"", {
25
25
  "include_dirs": [
26
+ "<!@(node -e \"if(process.env.HAMLIB_PREFIX) console.log(process.env.HAMLIB_PREFIX + '/include')\")",
26
27
  "/usr/include",
27
28
  "/usr/local/include"
28
29
  ],
29
30
  "libraries": [
31
+ "<!@(node -e \"if(process.env.HAMLIB_PREFIX) console.log('-L' + process.env.HAMLIB_PREFIX + '/lib')\")",
30
32
  "-L/usr/lib",
31
33
  "-L/usr/local/lib",
32
34
  "-lhamlib"
@@ -38,10 +40,12 @@
38
40
  # macOS configuration
39
41
  ["OS==\"mac\"", {
40
42
  "include_dirs": [
43
+ "<!@(node -e \"if(process.env.HAMLIB_PREFIX) console.log(process.env.HAMLIB_PREFIX + '/include')\")",
41
44
  "/usr/local/include",
42
45
  "/opt/homebrew/include"
43
46
  ],
44
47
  "libraries": [
48
+ "<!@(node -e \"if(process.env.HAMLIB_PREFIX) console.log('-L' + process.env.HAMLIB_PREFIX + '/lib')\")",
45
49
  "-L/usr/local/lib",
46
50
  "-L/opt/homebrew/lib",
47
51
  "-lhamlib"
package/index.d.ts CHANGED
@@ -265,6 +265,17 @@ declare class HamLib {
265
265
  */
266
266
  static getSupportedRigs(): SupportedRigInfo[];
267
267
 
268
+ /**
269
+ * Get Hamlib library version information
270
+ * @returns Hamlib version string including version number, build date, and architecture
271
+ * @static
272
+ * @example
273
+ * const version = HamLib.getHamlibVersion();
274
+ * console.log(`Hamlib version: ${version}`);
275
+ * // Output: "Hamlib 4.5.5 2024-01-15 12:00:00 64-bit"
276
+ */
277
+ static getHamlibVersion(): string;
278
+
268
279
  /**
269
280
  * Open connection to device
270
281
  * Must be called before other operations
@@ -482,6 +493,15 @@ declare class HamLib {
482
493
  */
483
494
  getSupportedFunctions(): string[];
484
495
 
496
+ /**
497
+ * Get list of supported radio modes
498
+ * @returns Array of supported mode strings
499
+ * @example
500
+ * const modes = rig.getSupportedModes();
501
+ * console.log('Supported modes:', modes); // ['USB', 'LSB', 'CW', 'FM', 'AM', ...]
502
+ */
503
+ getSupportedModes(): string[];
504
+
485
505
  // Split Operations
486
506
 
487
507
  /**
package/lib/index.js CHANGED
@@ -30,6 +30,15 @@ class HamLib {
30
30
  return nativeModule.HamLib.getSupportedRigs();
31
31
  }
32
32
 
33
+ /**
34
+ * Get Hamlib library version information
35
+ * @returns {string} Hamlib version string (e.g., "Hamlib 4.5.5 2024-01-15 12:00:00 64-bit")
36
+ * @static
37
+ */
38
+ static getHamlibVersion() {
39
+ return nativeModule.HamLib.getHamlibVersion();
40
+ }
41
+
33
42
  /**
34
43
  * Open connection to the radio device
35
44
  * Must be called before other operations
@@ -307,6 +316,17 @@ class HamLib {
307
316
  return this._nativeInstance.getSupportedFunctions();
308
317
  }
309
318
 
319
+ /**
320
+ * Get list of supported radio modes
321
+ * @returns {Array<string>} Array of supported mode strings
322
+ * @example
323
+ * const modes = rig.getSupportedModes();
324
+ * console.log('Supported modes:', modes); // ['USB', 'LSB', 'CW', 'FM', 'AM', ...]
325
+ */
326
+ getSupportedModes() {
327
+ return this._nativeInstance.getSupportedModes();
328
+ }
329
+
310
330
  // Split Operations
311
331
 
312
332
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hamlib",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "Node.js wrapper for hamlib radio control library",
5
5
  "main": "index.js",
6
6
  "module": "lib/index.mjs",
@@ -39,23 +39,30 @@
39
39
  "scripts": {
40
40
  "install": "node-gyp-build",
41
41
  "build": "node-gyp configure && node-gyp build",
42
+ "build:all": "node scripts/build-all.js",
42
43
  "rebuild": "node-gyp rebuild",
43
44
  "clean": "node-gyp clean",
44
45
  "test": "node test/test_loader.js",
45
46
  "test:network": "node test/test_network.js",
47
+ "test:dummy": "node test/test_dummy_complete.js",
48
+ "test:serial": "node test/test_serial_config.js",
46
49
  "prebuild": "prebuildify --napi --strip",
47
50
  "prepare": "",
51
+ "bundle": "node scripts/bundle-deps.js",
48
52
  "bundle:macos": "bash scripts/bundle-macos.sh",
49
53
  "bundle:linux": "bash scripts/bundle-linux.sh",
50
54
  "bundle:windows": "node scripts/bundle-windows.js",
51
- "verify": "node scripts/verify-dependencies.js"
55
+ "verify": "node scripts/verify.js",
56
+ "verify:all": "node scripts/verify.js --all"
52
57
  },
53
58
  "dependencies": {
54
59
  "node-addon-api": "^4.3.0",
55
60
  "node-gyp-build": "^4.8.0"
56
61
  },
57
62
  "devDependencies": {
63
+ "chalk": "^4.1.2",
58
64
  "node-gyp": "^9.4.0",
65
+ "ora": "^5.4.1",
59
66
  "prebuildify": "^5.0.0"
60
67
  },
61
68
  "preferUnplugged": true,
@@ -1,7 +1,7 @@
1
1
  Node-HamLib Precompiled Binaries
2
2
  ================================
3
- Build Time: Sun Oct 19 05:09:54 UTC 2025
4
- Git Commit: 300713b7df0efe245e97518a6051327cfd4ac7aa
3
+ Build Time: Fri Nov 7 15:55:21 UTC 2025
4
+ Git Commit: f1ca54f7a364218f4d5a8f58778c67295fea66a5
5
5
  Git Ref: refs/heads/main
6
6
 
7
7
  Supported Platforms:
Binary file
Binary file
Binary file
package/src/hamlib.cpp CHANGED
@@ -3246,6 +3246,32 @@ Napi::Value NodeHamLib::GetSupportedFunctions(const Napi::CallbackInfo & info) {
3246
3246
  return funcArray;
3247
3247
  }
3248
3248
 
3249
+ // Mode Query
3250
+ Napi::Value NodeHamLib::GetSupportedModes(const Napi::CallbackInfo & info) {
3251
+ Napi::Env env = info.Env();
3252
+
3253
+ // Get mode list from rig state (populated during rig_open from rx/tx range lists)
3254
+ rmode_t modes = my_rig->state.mode_list;
3255
+ Napi::Array modeArray = Napi::Array::New(env);
3256
+ uint32_t index = 0;
3257
+
3258
+ // Iterate through all possible mode bits (similar to rig_sprintf_mode)
3259
+ for (unsigned int i = 0; i < HAMLIB_MAX_MODES; i++) {
3260
+ rmode_t mode_bit = modes & (1ULL << i);
3261
+
3262
+ if (mode_bit) {
3263
+ const char* mode_str = rig_strrmode(mode_bit);
3264
+
3265
+ // Skip empty or unknown modes
3266
+ if (mode_str && mode_str[0] != '\0') {
3267
+ modeArray[index++] = Napi::String::New(env, mode_str);
3268
+ }
3269
+ }
3270
+ }
3271
+
3272
+ return modeArray;
3273
+ }
3274
+
3249
3275
  // Split Operations
3250
3276
  Napi::Value NodeHamLib::SetSplitFreq(const Napi::CallbackInfo & info) {
3251
3277
  Napi::Env env = info.Env();
@@ -3600,7 +3626,10 @@ Napi::Function NodeHamLib::GetClass(Napi::Env env) {
3600
3626
  NodeHamLib::InstanceMethod("setFunction", & NodeHamLib::SetFunction),
3601
3627
  NodeHamLib::InstanceMethod("getFunction", & NodeHamLib::GetFunction),
3602
3628
  NodeHamLib::InstanceMethod("getSupportedFunctions", & NodeHamLib::GetSupportedFunctions),
3603
-
3629
+
3630
+ // Mode Query
3631
+ NodeHamLib::InstanceMethod("getSupportedModes", & NodeHamLib::GetSupportedModes),
3632
+
3604
3633
  // Split Operations
3605
3634
  NodeHamLib::InstanceMethod("setSplitFreq", & NodeHamLib::SetSplitFreq),
3606
3635
  NodeHamLib::InstanceMethod("getSplitFreq", & NodeHamLib::GetSplitFreq),
@@ -3691,9 +3720,10 @@ Napi::Function NodeHamLib::GetClass(Napi::Env env) {
3691
3720
  NodeHamLib::InstanceMethod("close", & NodeHamLib::Close),
3692
3721
  NodeHamLib::InstanceMethod("destroy", & NodeHamLib::Destroy),
3693
3722
  NodeHamLib::InstanceMethod("getConnectionInfo", & NodeHamLib::GetConnectionInfo),
3694
-
3695
- // Static method to get supported rig models
3723
+
3724
+ // Static methods
3696
3725
  NodeHamLib::StaticMethod("getSupportedRigs", & NodeHamLib::GetSupportedRigs),
3726
+ NodeHamLib::StaticMethod("getHamlibVersion", & NodeHamLib::GetHamlibVersion),
3697
3727
  });
3698
3728
  constructor = Napi::Persistent(ret);
3699
3729
  constructor.SuppressDestruct();
@@ -3803,6 +3833,16 @@ Napi::Value NodeHamLib::GetSupportedRigs(const Napi::CallbackInfo& info) {
3803
3833
  return rigArray;
3804
3834
  }
3805
3835
 
3836
+ // Get Hamlib version information
3837
+ Napi::Value NodeHamLib::GetHamlibVersion(const Napi::CallbackInfo& info) {
3838
+ Napi::Env env = info.Env();
3839
+
3840
+ // Reference to external hamlib_version2 variable
3841
+ extern const char* hamlib_version2;
3842
+
3843
+ return Napi::String::New(env, hamlib_version2);
3844
+ }
3845
+
3806
3846
  // Serial Port Configuration Methods
3807
3847
 
3808
3848
  // Set serial configuration parameter (data_bits, stop_bits, parity, handshake, etc.)
package/src/hamlib.h CHANGED
@@ -71,7 +71,10 @@ class NodeHamLib : public Napi::ObjectWrap<NodeHamLib> {
71
71
  Napi::Value SetFunction(const Napi::CallbackInfo&);
72
72
  Napi::Value GetFunction(const Napi::CallbackInfo&);
73
73
  Napi::Value GetSupportedFunctions(const Napi::CallbackInfo&);
74
-
74
+
75
+ // Mode Query
76
+ Napi::Value GetSupportedModes(const Napi::CallbackInfo&);
77
+
75
78
  // Split Operations
76
79
  Napi::Value SetSplitFreq(const Napi::CallbackInfo&);
77
80
  Napi::Value GetSplitFreq(const Napi::CallbackInfo&);
@@ -161,7 +164,10 @@ class NodeHamLib : public Napi::ObjectWrap<NodeHamLib> {
161
164
 
162
165
  // Static method to get supported rig models
163
166
  static Napi::Value GetSupportedRigs(const Napi::CallbackInfo&);
164
-
167
+
168
+ // Static method to get Hamlib version
169
+ static Napi::Value GetHamlibVersion(const Napi::CallbackInfo&);
170
+
165
171
  static Napi::Function GetClass(Napi::Env);
166
172
 
167
173
  static int freq_change_cb(RIG*, vfo_t, freq_t, void*);
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file