Rewrote power2mW to work with modern rigctl and rigctld.

Added mW2power for conversion the other way from power2mW.

Text label edits to dumpcaps



git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2824 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.11
Nate Bargmann, N0NB 2010-02-06 15:05:17 +00:00
rodzic c6af376927
commit fb4f7258bc
3 zmienionych plików z 258 dodań i 179 usunięć

Wyświetl plik

@ -385,41 +385,41 @@ int dumpcaps (RIG* rig, FILE *fout)
*
* TODO: keep me up-to-date with API call list!
*/
fprintf(fout, "Has init:\t%c\n", caps->rig_init != NULL ? 'Y' : 'N');
fprintf(fout, "Has cleanup:\t%c\n", caps->rig_cleanup != NULL ? 'Y' : 'N');
fprintf(fout, "Has open:\t%c\n", caps->rig_open != NULL ? 'Y' : 'N');
fprintf(fout, "Has close:\t%c\n", caps->rig_close != NULL ? 'Y' : 'N');
fprintf(fout, "Can set conf:\t%c\n", caps->set_conf != NULL ? 'Y' : 'N');
fprintf(fout, "Can get conf:\t%c\n", caps->get_conf != NULL ? 'Y' : 'N');
fprintf(fout, "Can set frequency:\t%c\n", caps->set_freq != NULL ? 'Y' : 'N');
fprintf(fout, "Can get frequency:\t%c\n", caps->get_freq != NULL ? 'Y' : 'N');
fprintf(fout, "Can set mode:\t%c\n", caps->set_mode != NULL ? 'Y' : 'N');
fprintf(fout, "Can get mode:\t%c\n", caps->get_mode != NULL ? 'Y' : 'N');
fprintf(fout, "Can set vfo:\t%c\n", caps->set_vfo != NULL ? 'Y' : 'N');
fprintf(fout, "Can get vfo:\t%c\n", caps->get_vfo != NULL ? 'Y' : 'N');
fprintf(fout, "Can set ptt:\t%c\n", caps->set_ptt != NULL ? 'Y' : 'N');
fprintf(fout, "Can get ptt:\t%c\n", caps->get_ptt != NULL ? 'Y' : 'N');
fprintf(fout, "Can get dcd:\t%c\n", caps->get_dcd != NULL ? 'Y' : 'N');
fprintf(fout, "Can set repeater duplex:\t%c\n", caps->set_rptr_shift != NULL ? 'Y' : 'N');
fprintf(fout, "Can get repeater duplex:\t%c\n", caps->get_rptr_shift != NULL ? 'Y' : 'N');
fprintf(fout, "Can set repeater offset:\t%c\n", caps->set_rptr_offs != NULL ? 'Y' : 'N');
fprintf(fout, "Can get repeater offset:\t%c\n", caps->get_rptr_offs != NULL ? 'Y' : 'N');
fprintf(fout, "Has Init:\t%c\n", caps->rig_init != NULL ? 'Y' : 'N');
fprintf(fout, "Has Cleanup:\t%c\n", caps->rig_cleanup != NULL ? 'Y' : 'N');
fprintf(fout, "Has Open:\t%c\n", caps->rig_open != NULL ? 'Y' : 'N');
fprintf(fout, "Has Close:\t%c\n", caps->rig_close != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Conf:\t%c\n", caps->set_conf != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Conf:\t%c\n", caps->get_conf != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Frequency:\t%c\n", caps->set_freq != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Frequency:\t%c\n", caps->get_freq != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Mode:\t%c\n", caps->set_mode != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Mode:\t%c\n", caps->get_mode != NULL ? 'Y' : 'N');
fprintf(fout, "Can set VFO:\t%c\n", caps->set_vfo != NULL ? 'Y' : 'N');
fprintf(fout, "Can get VFO:\t%c\n", caps->get_vfo != NULL ? 'Y' : 'N');
fprintf(fout, "Can set PTT:\t%c\n", caps->set_ptt != NULL ? 'Y' : 'N');
fprintf(fout, "Can get PTT:\t%c\n", caps->get_ptt != NULL ? 'Y' : 'N');
fprintf(fout, "Can get DCD:\t%c\n", caps->get_dcd != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Repeater Duplex:\t%c\n", caps->set_rptr_shift != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Repeater Duplex:\t%c\n", caps->get_rptr_shift != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Repeater Offset:\t%c\n", caps->set_rptr_offs != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Repeater Offset:\t%c\n", caps->get_rptr_offs != NULL ? 'Y' : 'N');
can_esplit = caps->set_vfo ||
(rig_has_vfo_op(rig, RIG_OP_TOGGLE) && caps->vfo_op);
fprintf(fout, "Can set split freq:\t%c\n", caps->set_split_freq != NULL ? 'Y' :
fprintf(fout, "Can set Split Freq:\t%c\n", caps->set_split_freq != NULL ? 'Y' :
(can_esplit && caps->set_freq ? 'E' : 'N'));
fprintf(fout, "Can get split freq:\t%c\n", caps->get_split_freq != NULL ? 'Y' :
fprintf(fout, "Can get Split Freq:\t%c\n", caps->get_split_freq != NULL ? 'Y' :
(can_esplit && caps->get_freq ? 'E' : 'N'));
fprintf(fout, "Can set split mode:\t%c\n", caps->set_split_mode != NULL ? 'Y' :
fprintf(fout, "Can set Split Mode:\t%c\n", caps->set_split_mode != NULL ? 'Y' :
(can_esplit && caps->set_mode ? 'E' : 'N'));
fprintf(fout, "Can get split mode:\t%c\n", caps->get_split_mode != NULL ? 'Y' :
fprintf(fout, "Can get Split Mode:\t%c\n", caps->get_split_mode != NULL ? 'Y' :
(can_esplit && caps->get_mode ? 'E' : 'N'));
fprintf(fout, "Can set split vfo:\t%c\n", caps->set_split_vfo != NULL ? 'Y' : 'N');
fprintf(fout, "Can get split vfo:\t%c\n", caps->get_split_vfo != NULL ? 'Y' : 'N');
fprintf(fout, "Can set tuning step:\t%c\n", caps->set_ts != NULL ? 'Y' : 'N');
fprintf(fout, "Can get tuning step:\t%c\n", caps->get_ts != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Split VFO:\t%c\n", caps->set_split_vfo != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Split VFO:\t%c\n", caps->get_split_vfo != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Tuning Step:\t%c\n", caps->set_ts != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Tuning Step:\t%c\n", caps->get_ts != NULL ? 'Y' : 'N');
fprintf(fout, "Can set RIT:\t%c\n", caps->set_rit != NULL ? 'Y' : 'N');
fprintf(fout, "Can get RIT:\t%c\n", caps->get_rit != NULL ? 'Y' : 'N');
fprintf(fout, "Can set XIT:\t%c\n", caps->set_xit != NULL ? 'Y' : 'N');
@ -428,40 +428,42 @@ int dumpcaps (RIG* rig, FILE *fout)
fprintf(fout, "Can get CTCSS:\t%c\n", caps->get_ctcss_tone != NULL ? 'Y' : 'N');
fprintf(fout, "Can set DCS:\t%c\n", caps->set_dcs_code != NULL ? 'Y' : 'N');
fprintf(fout, "Can get DCS:\t%c\n", caps->get_dcs_code != NULL ? 'Y' : 'N');
fprintf(fout, "Can set CTCSS squelch:\t%c\n", caps->set_ctcss_sql != NULL ? 'Y' : 'N');
fprintf(fout, "Can get CTCSS squelch:\t%c\n", caps->get_ctcss_sql != NULL ? 'Y' : 'N');
fprintf(fout, "Can set DCS squelch:\t%c\n", caps->set_dcs_sql != NULL ? 'Y' : 'N');
fprintf(fout, "Can get DCS squelch:\t%c\n", caps->get_dcs_sql != NULL ? 'Y' : 'N');
fprintf(fout, "Can set power stat:\t%c\n", caps->set_powerstat != NULL ? 'Y' : 'N');
fprintf(fout, "Can get power stat:\t%c\n", caps->get_powerstat != NULL ? 'Y' : 'N');
fprintf(fout, "Can reset:\t%c\n", caps->reset != NULL ? 'Y' : 'N');
fprintf(fout, "Can get ant:\t%c\n", caps->get_ant != NULL ? 'Y' : 'N');
fprintf(fout, "Can set ant:\t%c\n", caps->set_ant != NULL ? 'Y' : 'N');
fprintf(fout, "Can set transceive:\t%c\n", caps->set_trn != NULL ? 'Y' : 'N');
fprintf(fout, "Can get transceive:\t%c\n", caps->get_trn != NULL ? 'Y' : 'N');
fprintf(fout, "Can set func:\t%c\n", caps->set_func != NULL ? 'Y' : 'N');
fprintf(fout, "Can get func:\t%c\n", caps->get_func != NULL ? 'Y' : 'N');
fprintf(fout, "Can set level:\t%c\n", caps->set_level != NULL ? 'Y' : 'N');
fprintf(fout, "Can get level:\t%c\n", caps->get_level != NULL ? 'Y' : 'N');
fprintf(fout, "Can set param:\t%c\n", caps->set_parm != NULL ? 'Y' : 'N');
fprintf(fout, "Can get param:\t%c\n", caps->get_parm != NULL ? 'Y' : 'N');
fprintf(fout, "Can set CTCSS Squelch:\t%c\n", caps->set_ctcss_sql != NULL ? 'Y' : 'N');
fprintf(fout, "Can get CTCSS Squelch:\t%c\n", caps->get_ctcss_sql != NULL ? 'Y' : 'N');
fprintf(fout, "Can set DCS Squelch:\t%c\n", caps->set_dcs_sql != NULL ? 'Y' : 'N');
fprintf(fout, "Can get DCS Squelch:\t%c\n", caps->get_dcs_sql != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Power Stat:\t%c\n", caps->set_powerstat != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Power Stat:\t%c\n", caps->get_powerstat != NULL ? 'Y' : 'N');
fprintf(fout, "Can Reset:\t%c\n", caps->reset != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Ant:\t%c\n", caps->get_ant != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Ant:\t%c\n", caps->set_ant != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Transceive:\t%c\n", caps->set_trn != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Transceive:\t%c\n", caps->get_trn != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Func:\t%c\n", caps->set_func != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Func:\t%c\n", caps->get_func != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Level:\t%c\n", caps->set_level != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Level:\t%c\n", caps->get_level != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Param:\t%c\n", caps->set_parm != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Param:\t%c\n", caps->get_parm != NULL ? 'Y' : 'N');
fprintf(fout, "Can send DTMF:\t%c\n", caps->send_dtmf != NULL ? 'Y ': 'N');
fprintf(fout, "Can recv DTMF:\t%c\n", caps->recv_dtmf != NULL ? 'Y' : 'N');
fprintf(fout, "Can send Morse:\t%c\n", caps->send_morse != NULL ? 'Y' : 'N');
fprintf(fout, "Can decode events:\t%c\n", caps->decode_event != NULL ? 'Y' : 'N');
fprintf(fout, "Can set bank:\t%c\n", caps->set_bank != NULL ? 'Y' : 'N');
fprintf(fout, "Can set mem:\t%c\n", caps->set_mem != NULL ? 'Y' : 'N');
fprintf(fout, "Can get mem:\t%c\n", caps->get_mem != NULL ? 'Y' : 'N');
fprintf(fout, "Can decode Events:\t%c\n", caps->decode_event != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Bank:\t%c\n", caps->set_bank != NULL ? 'Y' : 'N');
fprintf(fout, "Can set Mem:\t%c\n", caps->set_mem != NULL ? 'Y' : 'N');
fprintf(fout, "Can get Mem:\t%c\n", caps->get_mem != NULL ? 'Y' : 'N');
can_echannel = caps->set_mem && caps->set_vfo;
fprintf(fout, "Can set channel:\t%c\n", caps->set_channel != NULL ? 'Y' :
fprintf(fout, "Can set Channel:\t%c\n", caps->set_channel != NULL ? 'Y' :
(can_echannel ? 'E' : 'N'));
fprintf(fout, "Can get channel:\t%c\n", caps->get_channel != NULL ? 'Y' :
fprintf(fout, "Can get Channel:\t%c\n", caps->get_channel != NULL ? 'Y' :
(can_echannel ? 'E' : 'N'));
fprintf(fout, "Can ctl mem/vfo:\t%c\n", caps->vfo_op != NULL ? 'Y' : 'N');
fprintf(fout, "Can scan:\t%c\n", caps->scan != NULL ? 'Y' :' N');
fprintf(fout, "Can get info:\t%c\n", caps->get_info != NULL ? 'Y' : 'N');
fprintf(fout, "Can ctl Mem/VFO:\t%c\n", caps->vfo_op != NULL ? 'Y' : 'N');
fprintf(fout, "Can Scan:\t%c\n", caps->scan != NULL ? 'Y' :' N');
fprintf(fout, "Can get Info:\t%c\n", caps->get_info != NULL ? 'Y' : 'N');
fprintf(fout, "Can get power2mW:\t%c\n", caps->power2mW != NULL ? 'Y' : 'N');
fprintf(fout, "Can get mW2power:\t%c\n", caps->mW2power != NULL ? 'Y' : 'N');
fprintf(fout, "\nOverall backend warnings: %d\n", backend_warnings);

Wyświetl plik

@ -80,6 +80,7 @@ struct test_table {
const char *arg1;
const char *arg2;
const char *arg3;
const char *arg4;
};
@ -122,6 +123,7 @@ declare_proto_rig(get_split_vfo);
declare_proto_rig(set_ts);
declare_proto_rig(get_ts);
declare_proto_rig(power2mW);
declare_proto_rig(mW2power);
declare_proto_rig(set_level);
declare_proto_rig(get_level);
declare_proto_rig(set_func);
@ -168,36 +170,36 @@ static struct test_table test_list[] = {
{ 'f', "get_freq", get_freq, ARG_OUT, "Frequency" },
{ 'M', "set_mode", set_mode, ARG_IN, "Mode", "Passband" },
{ 'm', "get_mode", get_mode, ARG_OUT, "Mode", "Passband" },
{ 'I', "set_split_freq", set_split_freq, ARG_IN, "Tx frequency" },
{ 'i', "get_split_freq", get_split_freq, ARG_OUT, "Tx frequency" },
{ 'X', "set_split_mode", set_split_mode, ARG_IN, "Tx mode", "Tx passband" },
{ 'x', "get_split_mode", get_split_mode, ARG_OUT, "Tx mode", "Tx passband" },
{ 'S', "set_split_vfo", set_split_vfo, ARG_IN, "Split", "Tx VFO" },
{ 's', "get_split_vfo", get_split_vfo, ARG_OUT, "Split", "Tx VFO" },
{ 'N', "set_ts", set_ts, ARG_IN, "Tuning step" },
{ 'n', "get_ts", get_ts, ARG_OUT, "Tuning step" },
{ 'L', "set_level", set_level, ARG_IN, "Level", "Level value" },
{ 'l', "get_level", get_level, ARG_IN1|ARG_OUT2, "Level", "Level value" },
{ 'U', "set_func", set_func, ARG_IN, "Func", "Func status" },
{ 'u', "get_func", get_func, ARG_IN1|ARG_OUT2, "Func", "Func status" },
{ 'P', "set_parm", set_parm, ARG_IN|ARG_NOVFO, "Parm", "Parm value" },
{ 'p', "get_parm", get_parm, ARG_IN1|ARG_OUT2|ARG_NOVFO, "Parm", "Parm value" },
{ 'G', "vfo_op", vfo_op, ARG_IN, "Mem/VFO op" },
{ 'g', "scan", scan, ARG_IN, "Scan fct", "Scan channel" },
{ 'I', "set_split_freq", set_split_freq, ARG_IN, "TX Frequency" },
{ 'i', "get_split_freq", get_split_freq, ARG_OUT, "TX Frequency" },
{ 'X', "set_split_mode", set_split_mode, ARG_IN, "TX Mode", "TX Passband" },
{ 'x', "get_split_mode", get_split_mode, ARG_OUT, "TX Mode", "TX Passband" },
{ 'S', "set_split_vfo", set_split_vfo, ARG_IN, "Split", "TX VFO" },
{ 's', "get_split_vfo", get_split_vfo, ARG_OUT, "Split", "TX VFO" },
{ 'N', "set_ts", set_ts, ARG_IN, "Tuning Step" },
{ 'n', "get_ts", get_ts, ARG_OUT, "Tuning Step" },
{ 'L', "set_level", set_level, ARG_IN, "Level", "Level Value" },
{ 'l', "get_level", get_level, ARG_IN1|ARG_OUT2, "Level", "Level Value" },
{ 'U', "set_func", set_func, ARG_IN, "Func", "Func Status" },
{ 'u', "get_func", get_func, ARG_IN1|ARG_OUT2, "Func", "Func Status" },
{ 'P', "set_parm", set_parm, ARG_IN|ARG_NOVFO, "Parm", "Parm Value" },
{ 'p', "get_parm", get_parm, ARG_IN1|ARG_OUT2|ARG_NOVFO, "Parm", "Parm Value" },
{ 'G', "vfo_op", vfo_op, ARG_IN, "Mem/VFO Op" },
{ 'g', "scan", scan, ARG_IN, "Scan Fct", "Scan Channel" },
{ 'A', "set_trn", set_trn, ARG_IN|ARG_NOVFO, "Transceive" },
{ 'a', "get_trn", get_trn, ARG_OUT|ARG_NOVFO, "Transceive" },
{ 'R', "set_rptr_shift", set_rptr_shift, ARG_IN, "Rptr shift" },
{ 'r', "get_rptr_shift", get_rptr_shift, ARG_OUT, "Rptr shift" },
{ 'O', "set_rptr_offs", set_rptr_offs, ARG_IN, "Rptr offset" },
{ 'o', "get_rptr_offs", get_rptr_offs, ARG_OUT, "Rptr offset" },
{ 'C', "set_ctcss_tone", set_ctcss_tone, ARG_IN, "CTCSS tone" },
{ 'c', "get_ctcss_tone", get_ctcss_tone, ARG_OUT, "CTCSS tone" },
{ 'D', "set_dcs_code", set_dcs_code, ARG_IN, "DCS code" },
{ 'd', "get_dcs_code", get_dcs_code, ARG_OUT, "DCS code" },
{ 0x90, "set_ctcss_sql", set_ctcss_sql, ARG_IN, "CTCSS sql" },
{ 0x91, "get_ctcss_sql", get_ctcss_sql, ARG_OUT, "CTCSS sql" },
{ 0x92, "set_dcs_sql", set_dcs_sql, ARG_IN, "DCS sql" },
{ 0x93, "get_dcs_sql", get_dcs_sql, ARG_OUT, "DCS sql" },
{ 'R', "set_rptr_shift", set_rptr_shift, ARG_IN, "Rptr Shift" },
{ 'r', "get_rptr_shift", get_rptr_shift, ARG_OUT, "Rptr Shift" },
{ 'O', "set_rptr_offs", set_rptr_offs, ARG_IN, "Rptr Offset" },
{ 'o', "get_rptr_offs", get_rptr_offs, ARG_OUT, "Rptr Offset" },
{ 'C', "set_ctcss_tone", set_ctcss_tone, ARG_IN, "CTCSS Tone" },
{ 'c', "get_ctcss_tone", get_ctcss_tone, ARG_OUT, "CTCSS Tone" },
{ 'D', "set_dcs_code", set_dcs_code, ARG_IN, "DCS Code" },
{ 'd', "get_dcs_code", get_dcs_code, ARG_OUT, "DCS Code" },
{ 0x90, "set_ctcss_sql", set_ctcss_sql, ARG_IN, "CTCSS Sql" },
{ 0x91, "get_ctcss_sql", get_ctcss_sql, ARG_OUT, "CTCSS Sql" },
{ 0x92, "set_dcs_sql", set_dcs_sql, ARG_IN, "DCS Sql" },
{ 0x93, "get_dcs_sql", get_dcs_sql, ARG_OUT, "DCS Sql" },
{ 'V', "set_vfo", set_vfo, ARG_IN|ARG_NOVFO, "VFO" },
{ 'v', "get_vfo", get_vfo, ARG_OUT, "VFO" },
{ 'T', "set_ptt", set_ptt, ARG_IN, "PTT" },
@ -214,15 +216,16 @@ static struct test_table test_list[] = {
{ 'z', "get_xit", get_xit, ARG_OUT, "XIT" },
{ 'Y', "set_ant", set_ant, ARG_IN, "Antenna" },
{ 'y', "get_ant", get_ant, ARG_OUT, "Antenna" },
{ 0x87, "set_powerstat", set_powerstat, ARG_IN|ARG_NOVFO, "Status" },
{ 0x88, "get_powerstat", get_powerstat, ARG_OUT|ARG_NOVFO, "Status" },
{ 0x87, "set_powerstat", set_powerstat, ARG_IN|ARG_NOVFO, "Power Status" },
{ 0x88, "get_powerstat", get_powerstat, ARG_OUT|ARG_NOVFO, "Power Status" },
{ 0x89, "send_dtmf", send_dtmf, ARG_IN, "Digits" },
{ 0x8a, "recv_dtmf", recv_dtmf, ARG_OUT, "Digits" },
{ '*', "reset", reset, ARG_IN, "Reset" },
{ 'w', "send_cmd", send_cmd, ARG_IN1|ARG_IN_LINE|ARG_OUT2|ARG_NOVFO, "Cmd", "Reply" },
{ 'b', "send_morse", send_morse, ARG_IN|ARG_IN_LINE, "Morse" },
{ 0x8b, "get_dcd", get_dcd, ARG_OUT, "DCD" },
{ '2', "power2mW", power2mW, ARG_NOVFO },
{ '2', "power2mW", power2mW, ARG_IN1|ARG_IN2|ARG_IN3|ARG_OUT1|ARG_NOVFO, "Power [0.0..1.0]", "Frequency", "Mode", "Power mW" },
{ '4', "mW2power", mW2power, ARG_IN1|ARG_IN2|ARG_IN3|ARG_OUT1|ARG_NOVFO, "Power mW", "Frequency", "Mode", "Power [0.0..1.0]" },
{ '1', "dump_caps", dump_caps, ARG_NOVFO },
{ '3', "dump_conf", dump_conf, ARG_NOVFO },
{ 0x8f,"dump_state", dump_state, ARG_OUT|ARG_NOVFO },
@ -680,7 +683,7 @@ declare_proto_rig(get_rit)
status = rig_get_rit(rig, vfo, &rit);
if (status != RIG_OK)
return status;
if (interactive && prompt)
if ((interactive && prompt) || (interactive && !prompt && opt_block))
fprintf(fout, "%s: ", cmd->arg1);
fprintf(fout, "%ld\n", rit);
@ -705,7 +708,7 @@ declare_proto_rig(get_xit)
status = rig_get_xit(rig, vfo, &xit);
if (status != RIG_OK)
return status;
if (interactive && prompt)
if ((interactive && prompt) || (interactive && !prompt && opt_block))
fprintf(fout, "%s: ", cmd->arg1);
fprintf(fout, "%ld\n", xit);
@ -1086,25 +1089,47 @@ declare_proto_rig(get_ts)
}
/* '2' */
/* FIXME: For rigctld */
declare_proto_rig(power2mW)
{
int status;
float power;
freq_t freq;
int mode;
rmode_t mode;
unsigned int mwp;
fprintf(fout, "Power [0.0 .. 1.0]: ");
status = scanf("%f", &power);
fprintf(fout, "Frequency: ");
status = scanf("%"SCNfreq, &freq);
fprintf(fout, "Mode: ");
status = scanf("%d", &mode);
status = rig_power2mW(rig, &mwp, power, freq, (rmode_t) mode);
fprintf(fout, "rig_power2mW()-Power: %d mW\n", mwp);
status = rig_mW2power(rig, &power, mwp, freq, (rmode_t) mode);
fprintf(fout, "rig_mW2power()-Power ratio [0.0 .. 1.0]: %f\n", power);
sscanf(arg1, "%f", &power);
sscanf(arg2, "%"SCNfreq, &freq);
mode = rig_parse_mode(arg3);
status = rig_power2mW(rig, &mwp, power, freq, mode);
if (status != RIG_OK)
return status;
if ((interactive && prompt) || (interactive && !prompt && opt_block))
fprintf(fout, "%s: ", cmd->arg4);
fprintf(fout, "%i\n", mwp);
return status;
}
/* '4' */
declare_proto_rig(mW2power)
{
int status;
float power;
freq_t freq;
rmode_t mode;
unsigned int mwp;
sscanf(arg1, "%i", &mwp);
sscanf(arg2, "%"SCNfreq, &freq);
mode = rig_parse_mode(arg3);
status = rig_mW2power(rig, &power, mwp, freq, mode);
if (status != RIG_OK)
return status;
if ((interactive && prompt) || (interactive && !prompt && opt_block))
fprintf(fout, "%s: ", cmd->arg4);
fprintf(fout, "%f\n", power);
return status;
}

Wyświetl plik

@ -179,28 +179,39 @@ Get 'Frequency', in Hz.
.B M, set_mode 'Mode' 'Passband'
Set 'Mode': USB, LSB, CW, CWR, RTTY, RTTYR, AM, FM, WFM, AMS,
PKTLSB, PKTUSB, PKTFM, ECSSUSB, ECSSLSB, FAX, SAM, SAL, SAH, DSB.
Set 'Passband' in Hz, or 0 for the default.
.br
Set 'Passband' in Hz, or '0' for the Hamlib backend default.
.TP
.B m, get_mode
Get 'Mode' 'Passband'. Returns Mode as a string from \fIset_mode\fP above
Get 'Mode' 'Passband'.
.br
Returns Mode as a string from \fIset_mode\fP above
and Passband in Hz.
.TP
.B V, set_vfo 'VFO'
Set 'VFO': VFOA, VFOB, VFOC, currVFO, VFO, MEM, Main, Sub, TX, RX. In VFO mode
only a single VFO parameter is required.
Set 'VFO': VFOA, VFOB, VFOC, currVFO, VFO, MEM, Main, Sub, TX, RX.
.br
In VFO mode only a single VFO parameter is required.
.TP
.B v, get_vfo
Get current 'VFO'. Returns VFO as a string from \fIset_vfo\fP above.
Get current 'VFO'.
.br
Returns VFO as a string from \fIset_vfo\fP above.
.TP
.B J, set_rit 'RIT'
Set 'RIT', in Hz.
Set 'RIT', in Hz, can be + or -.
.br
A value of '0' resets RIT and *should* turn RIT off. If not, file a bug report
against the Hamlib backend.
.TP
.B j, get_rit
Get 'RIT', in Hz.
.TP
.B Z, set_xit 'XIT'
Set 'XIT', in Hz.
Set 'XIT', in Hz can be + or -.
.br
A value of '0' resets RIT and *should* turn RIT off. If not, file a bug report
against the Hamlib backend.
.TP
.B z, get_xit
Get 'XIT', in Hz.
@ -214,99 +225,112 @@ Get 'PTT' status.
.B 0x8b, get_dcd
Get 'DCD' (squelch) status, 0 (Closed) or 1 (Open)
.TP
.B R, set_rptr_shift 'Rptr shift'
Set 'Rptr shift': "+", "-" or something else for none.
.B R, set_rptr_shift 'Rptr Shift'
Set 'Rptr Shift': "+", "-" or something else for none.
.TP
.B r, get_rptr_shift
Get 'Rptr shift'. Returns "+", "-" or "None".
Get 'Rptr Shift'. Returns "+", "-" or "None".
.TP
.B O, set_rptr_offs 'Rptr offset'
Set 'Rptr offset', in Hz.
.B O, set_rptr_offs 'Rptr Offset'
Set 'Rptr Offset', in Hz.
.TP
.B o, get_rptr_offs
Get 'Rptr offset', in Hz.
Get 'Rptr Offset', in Hz.
.TP
.B C, set_ctcss_tone 'CTCSS tone'
Set 'CTCSS tone', in tenths of Hz.
.B C, set_ctcss_tone 'CTCSS Tone'
Set 'CTCSS Tone', in tenths of Hz.
.TP
.B c, get_ctcss_tone
Get 'CTCSS tone', in tenths of Hz.
Get 'CTCSS Tone', in tenths of Hz.
.TP
.B D, set_dcs_code 'DCS code'
Set 'DCS code'.
.B D, set_dcs_code 'DCS Code'
Set 'DCS Code'.
.TP
.B d, get_dcs_code
Get 'DCS code'.
Get 'DCS Code'.
.TP
.B 0x90, set_ctcss_sql 'CTCSS sql'
Set 'CTCSS sql' tone, in tenths of Hz.
.B 0x90, set_ctcss_sql 'CTCSS Sql'
Set 'CTCSS Sql' tone, in tenths of Hz.
.TP
.B 0x91, get_ctcss_sql
Get 'CTCSS sql' tone, in tenths of Hz.
Get 'CTCSS Sql' tone, in tenths of Hz.
.TP
.B 0x92, set_dcs_sql 'DCS sql'
Set 'DCS sql' code.
.B 0x92, set_dcs_sql 'DCS Sql'
Set 'DCS Sql' code.
.TP
.B 0x93, get_dcs_sql
Get 'DCS sql' code.
Get 'DCS Sql' code.
.TP
.B I, set_split_freq 'Tx frequency'
Set 'TX frequency', in Hz.
.B I, set_split_freq 'Tx Frequency'
Set 'TX Frequency', in Hz.
.TP
.B i, get_split_freq
Get 'TX frequency', in Hz.
Get 'TX Frequency', in Hz.
.TP
.B X, set_split_mode 'Tx mode' 'Tx passband'
Set 'Tx mode': AM, FM, CW, CWR, USB, LSB, RTTY, RTTYR, WFM, AMS,
.B X, set_split_mode 'TX Mode' 'TX Passband'
Set 'TX Mode': AM, FM, CW, CWR, USB, LSB, RTTY, RTTYR, WFM, AMS,
PKTLSB, PKTUSB, PKTFM, ECSSUSB, ECSSLSB, FAX, SAM, SAL, SAH, DSB.
The 'Tx passband' is the exact passband in Hz, or 0 for the default.
.br
The 'TX Passband' is the exact passband in Hz, or '0' for the Hamlib
backend default.
.TP
.B x, get_split_mode
Get 'Tx mode' and 'Tx passband'. Returns Tx mode as a string from
\fIset_split_mode\fP above and Tx passband in Hz.
Get 'TX Mode' and 'TX Passband'.
.br
Returns TX mode as a string from \fIset_split_mode\fP above and TX passband in Hz.
.TP
.B S, set_split_vfo 'Split' 'Tx VFO'
Set 'Split' mode, 0 or 1, and 'Tx VFO'.
.B S, set_split_vfo 'Split' 'TX VFO'
Set 'Split' mode, '0' or '1', and 'TX VFO' from \fIset_vfo\fP above.
.TP
.B s, get_split_vfo
Get 'Split' mode and 'Tx VFO'.
Get 'Split' mode, '0' or '1', and 'TX VFO'.
.TP
.B N, set_ts 'Tuning step'
Set 'Tuning step', in Hz.
.B N, set_ts 'Tuning Step'
Set 'Tuning Step', in Hz.
.TP
.B n, get_ts
Get 'Tuning step', in Hz.
Get 'Tuning Step', in Hz.
.TP
.B U, set_func 'Func' 'Func status'
Set 'Func' 'Func status'. Func is one of: FAGC, NB, COMP, VOX, TONE, TSQL,
.B U, set_func 'Func' 'Func Status'
Set 'Func' 'Func Status'.
.br
Func is one of: FAGC, NB, COMP, VOX, TONE, TSQL,
SBKIN, FBKIN, ANF, NR, AIP, APF, MON, MN, RF, ARO, LOCK, MUTE, VSC, REV, SQL,
ABM, BC, MBC, AFC, SATMODE, SCOPE, RESUME, TBURST, TUNER.
.br
Func Status argument is a non null value for "activate", "de-activate"
otherwise, much as TRUE/FALSE definitions in C language.
.TP
.B u, get_func
Get 'Func' 'Func status'. Returns Func as a string from \fIset_func\fP above
and Func status as a non null value.
Get 'Func' 'Func Status'.
.br
Returns Func as a string from \fIset_func\fP above and Func status as a non null value.
.TP
.B L, set_level 'Level' 'Level value'
Set 'Level' and 'Level value'. Level is one of: PREAMP, ATT, VOX, AF, RF, SQL,
IF, APF, NR, PBT_IN, PBT_OUT, CWPITCH, RFPOWER, MICGAIN, KEYSPD, NOTCHF, COMP,
AGC, BKINDL, BAL, METER, VOXGAIN, ANTIVOX. SLOPE_LOW, SLOPE_HIGH, RAWSTR,
SQLSTAT, SWR, ALC, STRENGTH.
The Level value can be a float or an integer.
.B L, set_level 'Level' 'Level Value'
Set 'Level' and 'Level Value'.
.br
Level is one of: PREAMP, ATT, VOX, AF, RF, SQL, IF, APF, NR, PBT_IN, PBT_OUT, CWPITCH,
RFPOWER, MICGAIN, KEYSPD, NOTCHF, COMP, AGC, BKINDL, BAL, METER, VOXGAIN, ANTIVOX.
SLOPE_LOW, SLOPE_HIGH, RAWSTR, SQLSTAT, SWR, ALC, STRENGTH.
.br
The Level Value can be a float or an integer.
.TP
.B l, get_level
Get 'Level' 'Level value'. Returns Level as a string from \fIset_level\fP
above and Level value as a float or integer.
Get 'Level' 'Level Value'.
.br
Returns Level as a string from \fIset_level\fP above and Level value as a float or
integer.
.TP
.B P, set_parm 'Parm' 'Parm value'
Set 'Parm' 'Parm value' Parm is one of: ANN, APO, BACKLIGHT, BEEP, TIME, BAT,
KEYLIGHT.
.B P, set_parm 'Parm' 'Parm Value'
Set 'Parm' 'Parm Value'
.br
Parm is one of: ANN, APO, BACKLIGHT, BEEP, TIME, BAT, KEYLIGHT.
.TP
.B p, get_parm
Get 'Parm' 'Parm value'. Returns Parm as a string from \fIset_parm\fP
above and Parm value as a float or integer.
Get 'Parm' 'Parm Value'.
.br
Returns Parm as a string from \fIset_parm\fP above and Parm Value as a float or
integer.
.TP
.B B, set_bank 'Bank'
Set 'Bank'. Sets the current memory bank number.
@ -317,19 +341,22 @@ Set 'Memory#' channel number.
.B e, get_mem
Get 'Memory#' channel number.
.TP
.B G, vfo_op 'Mem/VFO op'
Perform 'Mem/VFO op'. Mem VFO operation is one of: CPY, XCHG, FROM_VFO, TO_VFO,
MCL, UP, DOWN, BAND_UP, BAND_DOWN, LEFT, RIGHT, TUNE, TOGGLE.
.B G, vfo_op 'Mem/VFO Op'
Perform 'Mem/VFO Op'.
.br
Mem VFO operation is one of: CPY, XCHG, FROM_VFO, TO_VFO, MCL, UP, DOWN, BAND_UP,
BAND_DOWN, LEFT, RIGHT, TUNE, TOGGLE.
.TP
.B g, scan 'Scan fct' 'Scan channel'
Perform 'Scan fct' 'Scan channel'. Scan function/channel is one of: STOP, MEM,
SLCT, PRIO, PROG, DELTA, VFO, PLT.
.B g, scan 'Scan Fct' 'Scan Channel'
Perform 'Scan Fct' 'Scan Channel'.
.br
Scan function/channel is one of: STOP, MEM, SLCT, PRIO, PROG, DELTA, VFO, PLT.
.TP
.B H, set_channel 'Channel'
Set memory 'Channel' data. Not implemented yet.
.TP
.B h, get_channel
Get memory 'Channel' data.
Get memory 'Channel' data. Not implemented yet.
.TP
.B A, set_trn 'Transceive'
Set 'Transceive' mode (reporting event): OFF, RIG, POLL.
@ -344,21 +371,23 @@ Set 'Antenna' number (0, 1, 2, ..).
Get 'Antenna' number (0, 1, 2, ..).
.TP
.B *, reset 'Reset'
Perform rig 'Reset'. 0 = None, 1 = Software reset, 2 = VFO reset, 4 = Memory
Clear reset, 8 = Master reset. Since these values are defined as a bitmask in
rig.h, it should be possible to AND these values together to do multiple resets
at once, if the backend supports it or supports a reset action via rig control
at all.
Perform rig 'Reset'.
.br
0 = None, 1 = Software reset, 2 = VFO reset, 4 = Memory Clear reset, 8 = Master reset.
Since these values are defined as a bitmask in rig.h, it should be possible to AND
these values together to do multiple resets at once, if the backend supports it or
supports a reset action via rig control at all.
.TP
.B b, send_morse 'Morse'
Send 'Morse' symbols.
.TP
.B 0x87, set_powerstat 'Status'
Set power On/Off/Standby 'Status'. 0 = Power Off, 1 = Power On, 2 = Power
Standby. Defined as a bitmask in rig.h.
.B 0x87, set_powerstat 'Power Status'
Set power On/Off/Standby 'Power Status'.
.br
0 = Power Off, 1 = Power On, 2 = Power Standby. Defined as a bitmask in rig.h.
.TP
.B 0x88, get_powerstat
Get power On/Off/Standby 'Status' as in \fIset_powerstat\fP above.
Get power On/Off/Standby 'Power Status' as in \fIset_powerstat\fP above.
.TP
.B 0x89, send_dtmf 'Digits'
Set DTMF 'Digits'.
@ -374,11 +403,26 @@ Not a real rig remote command, it just dumps capabilities, i.e. what the
backend knows about this model, and what it can do. TODO: Ensure this is
in a consistent format so it can be read into a hash, dictionary, etc. Bug
reports requested.
.br
VFO parameter not used in 'VFO mode'.
.TP
.B 2, power2mW
Converts a power value in a range of \fI0.0 ... 1.0\fP to the real transmit
power in milli-Watts. The \fIfrequency\fP and \fImode\fP also need to be
provided as output power may vary according to these values.
.B 2, power2mW 'Power [0.0..1.0]' 'Frequency' 'Mode'
Returns 'Power mW'
.br
Converts a Power value in a range of \fI0.0 ... 1.0\fP to the real transmit
power in milli-Watts (integer). The \fIfrequency\fP and \fImode\fP also need to
be provided as output power may vary according to these values.
.br
VFO parameter not used in 'VFO mode'.
.TP
.B 4, mW2power 'Power mW' 'Frequency' 'Mode'
Returns 'Power [0.0..1.0]'
.br
Converts the real transmit power in milli-Watts (integer) to a Power value in
a range of \fI0.0 ... 1.0\fP. The \fIfrequency\fP and \fImode\fP also need to
be provided as output power may vary according to these values.
.br
VFO parameter not used in 'VFO mode'.
.TP
.B w, send_cmd 'Cmd'
Send raw command string to rig.
@ -476,11 +520,19 @@ processed successfully by the rig backend.
The following commands have been tested with the Block protocol and the included
\fBtestctld.pl\fP script:
.br
\fI\\set_freq\fP \fI\\get-freq\fP
\fI\\set_freq\fP \fI\\get_freq\fP \fI\\set_split_freq\fP \fI\\get_split_freq\fP
.br
\fI\\set_mode\fP \fI\\get_mode\fP
\fI\\set_mode\fP \fI\\get_mode\fP \fI\\set_split_mode\fP \fI\\get_split_mode\fP
.br
\fI\\set_vfo\fP \fI\\get_vfo\fP
\fI\\set_vfo\fP \fI\\get_vfo\fP \fI\\set_split_vfo\fP \fI\\get_split_vfo\fP
.br
\fI\\set_rit\fP \fI\\get_rit\fP
.br
\fI\\set_xit\fP \fI\\get_xit\fP
.br
\fI\\set_ptt\fP \fI\\get_ptt\fP
.br
\fI\\power2mW\fP \fI\\mW2power\fP
.br
\fI\\dump_caps\fP
.SH EXAMPLES