hamlib 0.2.1 → 0.2.2
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/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/node.napi.node +0 -0
- package/src/hamlib.cpp +16 -15
- package/src/shim/hamlib_shim.h +4 -3
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
|
|
Binary file
|
|
Binary file
|
package/src/hamlib.cpp
CHANGED
|
@@ -2191,19 +2191,17 @@ NodeHamLib::NodeHamLib(const Napi::CallbackInfo & info): ObjectWrap(info) {
|
|
|
2191
2191
|
return;
|
|
2192
2192
|
}
|
|
2193
2193
|
|
|
2194
|
-
// Set default port path if not provided
|
|
2195
|
-
strncpy(port_path, "/dev/ttyUSB0", SHIM_HAMLIB_FILPATHLEN - 1);
|
|
2196
|
-
port_path[SHIM_HAMLIB_FILPATHLEN - 1] = '\0';
|
|
2197
|
-
|
|
2198
2194
|
// Check if port path is provided as second argument
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2195
|
+
bool has_port = false;
|
|
2196
|
+
port_path[0] = '\0';
|
|
2197
|
+
|
|
2198
|
+
if (info.Length() >= 2 && info[1].IsString()) {
|
|
2199
|
+
std::string portStr = info[1].As<Napi::String>().Utf8Value();
|
|
2200
|
+
if (!portStr.empty()) {
|
|
2202
2201
|
strncpy(port_path, portStr.c_str(), SHIM_HAMLIB_FILPATHLEN - 1);
|
|
2203
2202
|
port_path[SHIM_HAMLIB_FILPATHLEN - 1] = '\0';
|
|
2203
|
+
has_port = true;
|
|
2204
2204
|
}
|
|
2205
|
-
// Note: Debug level is now controlled globally via HamLib.setDebugLevel()
|
|
2206
|
-
// and set to RIG_DEBUG_NONE by default in addon initialization
|
|
2207
2205
|
}
|
|
2208
2206
|
//unsigned int myrig_model;
|
|
2209
2207
|
// hamlib_port_t myport;
|
|
@@ -2242,13 +2240,16 @@ NodeHamLib::NodeHamLib(const Napi::CallbackInfo & info): ObjectWrap(info) {
|
|
|
2242
2240
|
Napi::TypeError::New(env, errorMsg).ThrowAsJavaScriptException();
|
|
2243
2241
|
}
|
|
2244
2242
|
|
|
2245
|
-
//
|
|
2246
|
-
|
|
2243
|
+
// Only set port path and type when user explicitly provided a port.
|
|
2244
|
+
// Otherwise, let rig_init() defaults take effect (e.g., dummy rig uses RIG_PORT_NONE).
|
|
2245
|
+
if (has_port) {
|
|
2246
|
+
shim_rig_set_port_path(my_rig, port_path);
|
|
2247
2247
|
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2248
|
+
if (is_network_rig) {
|
|
2249
|
+
shim_rig_set_port_type(my_rig, SHIM_RIG_PORT_NETWORK);
|
|
2250
|
+
} else {
|
|
2251
|
+
shim_rig_set_port_type(my_rig, SHIM_RIG_PORT_SERIAL);
|
|
2252
|
+
}
|
|
2252
2253
|
}
|
|
2253
2254
|
|
|
2254
2255
|
// this->freq_emit_cb = [info](double freq) {
|
package/src/shim/hamlib_shim.h
CHANGED
|
@@ -71,9 +71,10 @@ typedef void* hamlib_shim_handle_t;
|
|
|
71
71
|
/* Passband constants */
|
|
72
72
|
#define SHIM_RIG_PASSBAND_NORMAL 0
|
|
73
73
|
|
|
74
|
-
/* Port types */
|
|
75
|
-
#define
|
|
76
|
-
#define
|
|
74
|
+
/* Port types (must match hamlib rig_port_e enum) */
|
|
75
|
+
#define SHIM_RIG_PORT_NONE 0
|
|
76
|
+
#define SHIM_RIG_PORT_SERIAL 1
|
|
77
|
+
#define SHIM_RIG_PORT_NETWORK 2
|
|
77
78
|
|
|
78
79
|
/* Scan types */
|
|
79
80
|
#define SHIM_RIG_SCAN_STOP 0
|