Fix rotctl C command

This commit is contained in:
Michael Black 2019-11-23 23:11:27 -06:00
parent 0c72d75b57
commit 46a9fff6ad
No known key found for this signature in database
GPG Key ID: 6599353EC683404D

View File

@ -1631,6 +1631,7 @@ int set_conf(ROT *my_rot, char *conf_parms)
char *p, *q, *n; char *p, *q, *n;
int ret; int ret;
rot_debug(RIG_DEBUG_TRACE,"%s: called\n", __func__);
p = conf_parms; p = conf_parms;
while (p && *p != '\0') while (p && *p != '\0')
@ -1651,6 +1652,7 @@ int set_conf(ROT *my_rot, char *conf_parms)
*n++ = '\0'; *n++ = '\0';
} }
rig_debug(RIG_DEBUG_TRACE,"%s: token=%s, val=%s\n",__func__, p,q);
ret = rot_set_conf(my_rot, rot_token_lookup(my_rot, p), q); ret = rot_set_conf(my_rot, rot_token_lookup(my_rot, p), q);
if (ret != RIG_OK) if (ret != RIG_OK)
@ -1701,14 +1703,14 @@ declare_proto_rot(get_position)
fprintf(fout, "%s: ", cmd->arg1); fprintf(fout, "%s: ", cmd->arg1);
} }
fprintf(fout, "%f%c", az, resp_sep); fprintf(fout, "%.2f%c", az, resp_sep);
if ((interactive && prompt) || (interactive && !prompt && ext_resp)) if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{ {
fprintf(fout, "%s: ", cmd->arg2); fprintf(fout, "%s: ", cmd->arg2);
} }
fprintf(fout, "%f%c", el, resp_sep); fprintf(fout, "%.2f%c", el, resp_sep);
return status; return status;
} }
@ -1791,19 +1793,19 @@ declare_proto_rot(move)
/* 'C' */ /* 'C' */
declare_proto_rot(inter_set_conf) declare_proto_rot(inter_set_conf)
{ {
token_t token; rot_debug(RIG_DEBUG_TRACE,"%s: called\n", __func__);
CHKSCN1ARG(sscanf(arg1, "%ld", &token));
if (!arg2 || arg2[0] == '\0') if (!arg2 || arg2[0] == '\0')
{ {
rot_debug(RIG_DEBUG_ERR,"%s: arg1=='%s', arg2=='%s'\n", __func__, arg1, arg2);
return -RIG_EINVAL; return -RIG_EINVAL;
} }
char buf[256];
return rot_set_conf(rot, token, arg2); sprintf(buf,"%s=%s",arg1,arg2);
return set_conf(rot, buf);
} }
/* '1' */ /* '1' */
declare_proto_rot(dump_caps) declare_proto_rot(dump_caps)
{ {
@ -1867,6 +1869,12 @@ declare_proto_rot(dump_state)
fprintf(fout, "%lf%c", rs->max_el, resp_sep); fprintf(fout, "%lf%c", rs->max_el, resp_sep);
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{
fprintf(fout, "South Zero: ");
}
fprintf(fout, "%d%c", rs->south_zero, resp_sep);
return RIG_OK; return RIG_OK;
} }