debug(icom): say whether the split mode-align was accepted
The 0x26 01 copy was fire-and-forget, and a real 7760's sub VFO kept yesterday's mode with nothing to show why — refused, or sent with a stale mode byte. The mode is read first when unknown, and both outcomes are logged.
This commit is contained in:
@@ -1935,12 +1935,25 @@ func (b *IcomSerial) SetIcomSplitOffset(on bool, offsetHz int64) error {
|
|||||||
// yesterday's mode transmits FM into a CW pileup. 0x26 0x01 sets the
|
// yesterday's mode transmits FM into a CW pileup. 0x26 0x01 sets the
|
||||||
// unselected VFO's mode + data flag in one frame; rigs that predate
|
// unselected VFO's mode + data flag in one frame; rigs that predate
|
||||||
// 0x26 NAK it harmlessly and behave as they always did.
|
// 0x26 NAK it harmlessly and behave as they always did.
|
||||||
|
if b.curModeByte == 0 {
|
||||||
|
// A fresh session may not have read the mode yet — ask, or the copy
|
||||||
|
// below would send mode 0 (LSB) whatever the main is on.
|
||||||
|
if m, ok := b.readMode(); ok {
|
||||||
|
b.curModeByte = m
|
||||||
|
}
|
||||||
|
}
|
||||||
if b.curModeByte != 0 {
|
if b.curModeByte != 0 {
|
||||||
dataByte := byte(0)
|
dataByte := byte(0)
|
||||||
if got := b.readDataMode(); got {
|
if got := b.readDataMode(); got {
|
||||||
dataByte = 1
|
dataByte = 1
|
||||||
}
|
}
|
||||||
_ = b.exec(civ.CmdModeDataFil, 0x01, b.curModeByte, dataByte, 0x01)
|
// Logged, not discarded: the first version swallowed the error and a
|
||||||
|
// real 7760's sub VFO kept yesterday's mode with nothing to show why.
|
||||||
|
if err := b.exec(civ.CmdModeDataFil, 0x01, b.curModeByte, dataByte, 0x01); err != nil {
|
||||||
|
applog.Printf("icom: split mode-align (26 01 %02X %d) refused: %v", b.curModeByte, dataByte, err)
|
||||||
|
} else {
|
||||||
|
applog.Printf("icom: split mode-align OK (26 01 %02X %d)", b.curModeByte, dataByte)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := b.exec(civ.CmdSplit, boolByte(on)); err != nil {
|
if err := b.exec(civ.CmdSplit, boolByte(on)); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user