I would like to override the default values of hamlib (for the serial interface, the baud rate, etc.), but I don't know where to store them and where to write them down. There are several programs (for example sgcontrol) which rely on these settings. Where can I change and store them?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The structure rig_state contains the modifiable values. The defaults are set from the rig_caps structures found in the individual backends. The application calls the frontend function rig_init which reads the rig_cap from the back end. The application then modifies the rig_state to change any defaults it wants.
eg (taken from rigctl.c)
if (ptt_type != RIG_PTT_NONE)
my_rig->state.pttport.type.ptt = ptt_type;
if (dcd_type != RIG_DCD_NONE)
my_rig->state.dcdport.type.dcd = dcd_type;
if (ptt_file)
strncpy(my_rig->state.pttport.pathname, ptt_file, FILPATHLEN);
if (dcd_file)
strncpy(my_rig->state.dcdport.pathname, dcd_file, FILPATHLEN);
/* FIXME: bound checking and port type == serial */
if (serial_rate != 0)
my_rig->state.rigport.parm.serial.rate = serial_rate;
Or if you mean permanently you would have to modify the rig_cap table.
hope this helps
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everybody,
I would like to override the default values of hamlib (for the serial interface, the baud rate, etc.), but I don't know where to store them and where to write them down. There are several programs (for example sgcontrol) which rely on these settings. Where can I change and store them?
The structure rig_state contains the modifiable values. The defaults are set from the rig_caps structures found in the individual backends. The application calls the frontend function rig_init which reads the rig_cap from the back end. The application then modifies the rig_state to change any defaults it wants.
eg (taken from rigctl.c)
if (ptt_type != RIG_PTT_NONE)
my_rig->state.pttport.type.ptt = ptt_type;
if (dcd_type != RIG_DCD_NONE)
my_rig->state.dcdport.type.dcd = dcd_type;
if (ptt_file)
strncpy(my_rig->state.pttport.pathname, ptt_file, FILPATHLEN);
if (dcd_file)
strncpy(my_rig->state.dcdport.pathname, dcd_file, FILPATHLEN);
/* FIXME: bound checking and port type == serial */
if (serial_rate != 0)
my_rig->state.rigport.parm.serial.rate = serial_rate;
Or if you mean permanently you would have to modify the rig_cap table.
hope this helps