-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathIcomIc821hDriver.cs
More file actions
70 lines (57 loc) · 1.9 KB
/
Copy pathIcomIc821hDriver.cs
File metadata and controls
70 lines (57 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using OscarWatch.Core.Models;
namespace OscarWatch.Rig;
/// <summary>
/// IC-821H CI-V. Satellite mode uses Main=RX / Sub=TX, but band-access bytes D0/D1 are
/// inverted vs IC-910/9700 while SAT is on. No split CAT; uplink CTCSS is front-panel only.
/// </summary>
public sealed class IcomIc821hDriver : IcomCivDriverBase
{
private bool _satelliteModeActive;
public IcomIc821hDriver(string port, int baudRate, string civAddressHex, int catDelayMs = 50)
: base(RigType.IcomIc821h, port, baudRate, civAddressHex, catDelayMs)
{
}
internal IcomIc821hDriver(IIcomCivTransport transport)
: base(RigType.IcomIc821h, transport)
{
}
public override bool SupportsTracking => true;
public bool SupportsVfoExchange => false;
public override void SetSatelliteMode(bool on)
{
_satelliteModeActive = on;
WriteWithRetry(on ? [0x1A, 0x07, 0x01] : [0x1A, 0x07, 0x00]);
}
public override void SetSplitOn(bool on)
{
// Manual: sub band cannot perform split/duplex/offset in satellite layout.
}
public override void SetToneOn(bool on)
{
}
public override void SetToneSquelchOn(bool on)
{
}
public override void SetToneHz(double hz, bool squelchTone)
{
}
/// <summary>
/// After SAT on, select Main (RX/downlink) so software VFO state matches the radio.
/// </summary>
public void EstablishSatelliteVfoState()
{
SelectVfo(RigVfo.Main, force: true);
}
/// <summary>
/// In satellite mode, CI-V Main band access (D0) selects TX/uplink; Sub band access (D1) selects RX/downlink.
/// </summary>
protected override RigVfo MapOperationalVfo(RigVfo vfo) =>
!_satelliteModeActive
? vfo
: vfo switch
{
RigVfo.Main => RigVfo.Sub,
RigVfo.Sub => RigVfo.Main,
_ => vfo
};
}