hamlib 0.1.4 → 0.1.6
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 +181 -45
- package/index.d.ts +144 -20
- package/lib/index.js +237 -31
- 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 +769 -138
- package/src/hamlib.h +26 -1
package/src/hamlib.h
CHANGED
|
@@ -2,11 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
#include <napi.h>
|
|
4
4
|
#include <hamlib/rig.h>
|
|
5
|
+
#include <memory>
|
|
5
6
|
//forward declarations
|
|
6
7
|
//typedef struct s_rig RIG;
|
|
7
8
|
//typedef unsigned int vfo_t;
|
|
8
9
|
//typedef double freq_t;
|
|
9
10
|
|
|
11
|
+
// Forward declaration
|
|
12
|
+
class NodeHamLib;
|
|
13
|
+
|
|
14
|
+
// Base AsyncWorker class for hamlib operations
|
|
15
|
+
class HamLibAsyncWorker : public Napi::AsyncWorker {
|
|
16
|
+
public:
|
|
17
|
+
HamLibAsyncWorker(Napi::Function& callback, NodeHamLib* hamlib_instance);
|
|
18
|
+
virtual ~HamLibAsyncWorker() = default;
|
|
19
|
+
|
|
20
|
+
protected:
|
|
21
|
+
NodeHamLib* hamlib_instance_;
|
|
22
|
+
int result_code_;
|
|
23
|
+
std::string error_message_;
|
|
24
|
+
};
|
|
25
|
+
|
|
10
26
|
|
|
11
27
|
class NodeHamLib : public Napi::ObjectWrap<NodeHamLib> {
|
|
12
28
|
public:
|
|
@@ -66,6 +82,15 @@ class NodeHamLib : public Napi::ObjectWrap<NodeHamLib> {
|
|
|
66
82
|
Napi::Value SetAntenna(const Napi::CallbackInfo&);
|
|
67
83
|
Napi::Value GetAntenna(const Napi::CallbackInfo&);
|
|
68
84
|
|
|
85
|
+
// Serial Port Configuration
|
|
86
|
+
Napi::Value SetSerialConfig(const Napi::CallbackInfo&);
|
|
87
|
+
Napi::Value GetSerialConfig(const Napi::CallbackInfo&);
|
|
88
|
+
Napi::Value SetPttType(const Napi::CallbackInfo&);
|
|
89
|
+
Napi::Value GetPttType(const Napi::CallbackInfo&);
|
|
90
|
+
Napi::Value SetDcdType(const Napi::CallbackInfo&);
|
|
91
|
+
Napi::Value GetDcdType(const Napi::CallbackInfo&);
|
|
92
|
+
Napi::Value GetSupportedSerialConfigs(const Napi::CallbackInfo&);
|
|
93
|
+
|
|
69
94
|
// Static method to get supported rig models
|
|
70
95
|
static Napi::Value GetSupportedRigs(const Napi::CallbackInfo&);
|
|
71
96
|
|
|
@@ -73,7 +98,7 @@ class NodeHamLib : public Napi::ObjectWrap<NodeHamLib> {
|
|
|
73
98
|
|
|
74
99
|
static int freq_change_cb(RIG*, vfo_t, freq_t, void*);
|
|
75
100
|
|
|
76
|
-
|
|
101
|
+
public:
|
|
77
102
|
RIG *my_rig;
|
|
78
103
|
bool rig_is_open = false;
|
|
79
104
|
bool is_network_rig = false; // Flag to indicate if using network connection
|