Skip to content

Commit 31f076b

Browse files
authored
Remove references to internal Hamlib data (Tlf#480)
1 parent 3682e78 commit 31f076b

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

src/sendqrg.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ void show_rigerror(char *message, int errcode) {
9494
int init_tlf_rig(void) {
9595
freq_t rigfreq; /* frequency */
9696
vfo_t vfo;
97+
char speed_string[12];
9798
int retcode; /* generic return code from functions */
9899

99100
const struct rig_caps *caps;
@@ -115,10 +116,22 @@ int init_tlf_rig(void) {
115116
}
116117

117118
g_strchomp(rigportname); // remove trailing '\n'
118-
strncpy(my_rig->state.rigport.pathname, rigportname,
119-
TLFFILPATHLEN - 1);
119+
retcode = rig_set_conf(my_rig, rig_token_lookup(my_rig, "rig_pathname"),
120+
rigportname);
120121

121-
my_rig->state.rigport.parm.serial.rate = serial_rate;
122+
if (retcode != RIG_OK) {
123+
showmsg("Pathname not accepted!");
124+
return -1;
125+
}
126+
127+
snprintf(speed_string, sizeof speed_string, "%d", serial_rate);
128+
retcode = rig_set_conf(my_rig, rig_token_lookup(my_rig, "serial_speed"),
129+
speed_string);
130+
131+
if (retcode != RIG_OK) {
132+
showmsg("Speed not accepted!");
133+
return -1;
134+
}
122135

123136
caps = my_rig->caps;
124137

src/sendqrg.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@
2424
#include <hamlib/rig.h>
2525
#include <stdbool.h>
2626

27-
#ifdef HAMLIB_FILPATHLEN
28-
#define TLFFILPATHLEN HAMLIB_FILPATHLEN
29-
#else
30-
#ifdef FILPATHLEN
31-
#define TLFFILPATHLEN FILPATHLEN
32-
#else
33-
#error "(HAMLIB_)FILPATHLEN macro not found"
34-
#endif
35-
#endif
36-
3727
bool rig_has_send_morse();
3828
bool rig_has_stop_morse();
3929

0 commit comments

Comments
 (0)