Fix Icom IC-756 Pro III get data mode.

The "1A 06" command to get the data mode returns 2 bytes rather than
the one byte documented in the user manual.

Fix indexing error, collect data mode from correct reply byte.
Hamlib-3.0
Bill Somerville 2014-02-02 01:47:58 +00:00
rodzic 18f2f54f7d
commit 83640f3fcc
1 zmienionych plików z 10 dodań i 3 usunięć

Wyświetl plik

@ -752,16 +752,23 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width
}
/*
* databuf should contain Cn,Sc
* databuf should contain Cn,Sc,D0[,D1]
*/
data_len -= 2;
if (data_len != 1)
if (1 > data_len || data_len > 2) /* manual says 1 byte answer
but at least IC756 ProIII
sends 2 - second byte
appears to be same as
second byte from 04 command
which is filter preset
number, whatever it is we
ignore it */
{
rig_debug(RIG_DEBUG_ERR,"%s: wrong frame len=%d\n",
__FUNCTION__, data_len);
return -RIG_ERJCTED;
}
if (0x01 == databuf[1])
if (0x01 == databuf[2]) /* 0x01 -> data mode, 0x00 -> not data mode */
{
switch (*mode)
{