hamlib 0.1.5 → 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 +78 -45
- package/index.d.ts +19 -19
- package/lib/index.js +140 -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 +503 -138
- package/src/hamlib.h +17 -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:
|
|
@@ -82,7 +98,7 @@ class NodeHamLib : public Napi::ObjectWrap<NodeHamLib> {
|
|
|
82
98
|
|
|
83
99
|
static int freq_change_cb(RIG*, vfo_t, freq_t, void*);
|
|
84
100
|
|
|
85
|
-
|
|
101
|
+
public:
|
|
86
102
|
RIG *my_rig;
|
|
87
103
|
bool rig_is_open = false;
|
|
88
104
|
bool is_network_rig = false; // Flag to indicate if using network connection
|