From 1ea7e2323579890afee9a34de0756ad949ead8f0 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Mon, 29 May 2023 22:11:14 -0500 Subject: [PATCH] Reduce get_vfo anytone command to 1 instead of 2 sequences with new command found --- rigs/anytone/anytone.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/rigs/anytone/anytone.c b/rigs/anytone/anytone.c index c1f16032b..b42f7f257 100644 --- a/rigs/anytone/anytone.c +++ b/rigs/anytone/anytone.c @@ -331,6 +331,7 @@ int anytone_close(RIG *rig) int anytone_get_vfo(RIG *rig, vfo_t *vfo) { int retval = RIG_OK; + char cmd[] = { 0x41, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x06 }; ENTERFUNC; // Check Params @@ -343,14 +344,7 @@ int anytone_get_vfo(RIG *rig, vfo_t *vfo) { anytone_priv_data_ptr p = (anytone_priv_data_ptr) rig->state.priv; - if (p->vfo_curr == - RIG_VFO_NONE) // then we need to find out what our current VFO is - { - // only way we know to do this is switch VFOS twice so we can get the reply - anytone_set_vfo(rig, - RIG_VFO_B); // it's just toggle right now so VFO doesn't really matter - anytone_set_vfo(rig, RIG_VFO_A); - } + anytone_transaction(rig, cmd, sizeof(cmd), 16); *vfo = p->vfo_curr; }