Skip to content

Commit cf7026a

Browse files
boybookclaude
andcommitted
fix: use RIG_VFO_NONE for getLevel/setLevel to fix ICOM serial rigs
ICOM rigs (e.g. IC-705) fail when rig_get_level is called with RIG_VFO_CURR because Hamlib's ICOM backend internally calls icom_set_vfo which returns "unsupported VFO" for CI-V protocol. Using RIG_VFO_NONE (0) tells Hamlib to operate on the current VFO without attempting a VFO switch, which is the correct behavior for meter reading operations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9947772 commit cf7026a

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hamlib",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "Node.js wrapper for hamlib radio control library",
55
"main": "index.js",
66
"module": "lib/index.mjs",

src/hamlib.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class SetLevelAsyncWorker : public HamLibAsyncWorker {
280280
void Execute() override {
281281
CHECK_RIG_VALID();
282282

283-
result_code_ = shim_rig_set_level_f(hamlib_instance_->my_rig, SHIM_RIG_VFO_CURR, level_type_, value_);
283+
result_code_ = shim_rig_set_level_f(hamlib_instance_->my_rig, SHIM_RIG_VFO_NONE, level_type_, value_);
284284
if (result_code_ != SHIM_RIG_OK) {
285285
error_message_ = shim_rigerror(result_code_);
286286
}
@@ -313,7 +313,9 @@ class GetLevelAsyncWorker : public HamLibAsyncWorker {
313313
void Execute() override {
314314
CHECK_RIG_VALID();
315315

316-
result_code_ = shim_rig_get_level_f(hamlib_instance_->my_rig, SHIM_RIG_VFO_CURR, level_type_, &value_);
316+
// Use RIG_VFO_NONE to avoid unnecessary VFO switching that fails on
317+
// ICOM rigs (e.g. IC-705) where icom_set_vfo returns "unsupported VFO"
318+
result_code_ = shim_rig_get_level_f(hamlib_instance_->my_rig, SHIM_RIG_VFO_NONE, level_type_, &value_);
317319
if (result_code_ != SHIM_RIG_OK) {
318320
error_message_ = shim_rigerror(result_code_);
319321
}

0 commit comments

Comments
 (0)