kopia lustrzana https://github.com/Hamlib/Hamlib
Add new semi-colon separated hex values for send_raw icom
https://github.com/Hamlib/Hamlib/issues/1632pull/1635/head
rodzic
ab2b5fb9e9
commit
4a34d4c27f
1
NEWS
1
NEWS
|
@ -13,6 +13,7 @@ Version 5.x -- future
|
||||||
* Change FT1000MP Mark V model names to align with FT1000MP
|
* Change FT1000MP Mark V model names to align with FT1000MP
|
||||||
|
|
||||||
Version 4.6
|
Version 4.6
|
||||||
|
* send_raw can now take hex digits as colon-seperated -- e.g. send_raw icom xfe:xfe:x94:xe0:03:xfd
|
||||||
* Add IC7760
|
* Add IC7760
|
||||||
* IC7300 Mode filter can now be set by # (i.e. 1,2,3)
|
* IC7300 Mode filter can now be set by # (i.e. 1,2,3)
|
||||||
* Fixed AF6SA WRC rotor controller
|
* Fixed AF6SA WRC rotor controller
|
||||||
|
|
|
@ -1398,13 +1398,26 @@ Returns current lock mode status 1=On, 2=Off (only useful when using rigctld)
|
||||||
.TP
|
.TP
|
||||||
.BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fP \(aq
|
.BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fP \(aq
|
||||||
.EX
|
.EX
|
||||||
Can send ASCII string or 0xnn values -- there can be no spaces in the command string.
|
Can send ASCII string or 0xnn values or xnn values -- there can be no spaces in the command string.
|
||||||
Possible terminator values are CR, LF, ;, ICOM, 0-100 (bytes to read), or -1 meaning unknown (will timeout on read)
|
Possible terminator values are CR, LF, ;, ICOM, 0-100 (bytes to read), or -1 meaning unknown (will timeout on read)
|
||||||
Examples:
|
Examples (note that a ; must be escaped in Unix/Linux):
|
||||||
send_raw ; FA;MD;
|
For Windows & Unix/Linux we have a new colon-separated format for hex digits
|
||||||
|
send_raw icom 0xFE:0xFE:0x94:0x03:0xFD Note: colon-separated does not have to be escaped on Unix/Linux
|
||||||
|
send_raw -1 0xFE:0xFE:0x94:0x03:0xFD
|
||||||
|
send_raw 14 0xFE:0xFE:0x94:0x03:0xFD
|
||||||
|
Note that ASCII commands still require escaping the semicolon on Unix/Linux
|
||||||
|
send_raw \; FA\;MD\;
|
||||||
|
|
||||||
|
For Windows:
|
||||||
send_raw icom 0xFE;0xFE;0x94;0x03;0xFD
|
send_raw icom 0xFE;0xFE;0x94;0x03;0xFD
|
||||||
send_raw -1 0xFE;0xFE;0x94;0x03;0xFD
|
send_raw -1 0xFE;0xFE;0x94;0x03;0xFD
|
||||||
send_raw 14 0xFE;0xFE;0x94;0x03;0xFD
|
send_raw 14 0xFE;0xFE;0x94;0x03;0xFD
|
||||||
|
|
||||||
|
For Unix/Linux
|
||||||
|
send_raw icom 0xFE\;0xFE\;0x94\;0x03\;0xFD
|
||||||
|
send_raw \; FA\;MD\;
|
||||||
|
send_raw -1 0xFE\;0xFE\;0x94\;0x03\;0xFD
|
||||||
|
send_raw 14 0xFE\;0xFE\;0x94\;0x03\;0xFD
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
.BR client_version " \(aq" \fIString\fP "\(aq
|
.BR client_version " \(aq" \fIString\fP "\(aq
|
||||||
|
|
|
@ -5793,14 +5793,26 @@ static int parse_hex(const char *s, unsigned char *buf, int len)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
char *s2 = strdup(s);
|
char *s2 = strdup(s);
|
||||||
char *p = strtok(s2, ";");
|
char *p = strtok(s2, ";:");
|
||||||
|
|
||||||
while (p)
|
while (p)
|
||||||
{
|
{
|
||||||
unsigned int val;
|
unsigned int val;
|
||||||
sscanf(p, "0x%x", &val);
|
int n;
|
||||||
|
|
||||||
|
if ((n = sscanf(p, "0x%2x", &val)) != 1)
|
||||||
|
{
|
||||||
|
n = sscanf(p, "x%2x", &val);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (n == 0)
|
||||||
|
{
|
||||||
|
rig_debug(RIG_DEBUG_ERR, "%s: unable to parse 0x??; or x??; from '%s'\n",
|
||||||
|
__func__, s);
|
||||||
|
}
|
||||||
|
|
||||||
buf[i++] = val;
|
buf[i++] = val;
|
||||||
p = strtok(NULL, ";");
|
p = strtok(NULL, ";:");
|
||||||
}
|
}
|
||||||
|
|
||||||
free(s2);
|
free(s2);
|
||||||
|
@ -5863,7 +5875,7 @@ declare_proto_rig(send_raw)
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncmp(arg2, "0x", 2) == 0)
|
if (strncmp(arg2, "0x", 2) == 0 || arg2[0] == 'x')
|
||||||
{
|
{
|
||||||
arg2_len = parse_hex(arg2, send, sizeof(send));
|
arg2_len = parse_hex(arg2, send, sizeof(send));
|
||||||
sendp = send;
|
sendp = send;
|
||||||
|
|
Ładowanie…
Reference in New Issue