HamBook – Diff between revs 46 and 54
?pathlinks?
Rev 46 | Rev 54 | |||
---|---|---|---|---|
Line 1... | Line -... | |||
1 | using System; |
- | ||
2 | using System.Collections.Generic; |
- | ||
3 | using System.ComponentModel; |
- | ||
4 | using System.IO.Ports; |
- | ||
5 | using System.Linq; |
- | ||
6 | using System.Text; |
- | ||
7 | using System.Threading.Tasks; |
1 | using System.Threading; |
|
8 | using HamBook.Radios.Generic; |
- | ||
9 | using static HamBook.Radios.Yaesu.FT_891.Constants; |
- | ||
10 | using RJCP.IO.Ports; |
2 | using RJCP.IO.Ports; |
|
11 | using System.Threading; |
3 | using static HamBook.Radios.Yaesu.FT_891.Constants; |
|
Line 12... | Line 4... | |||
12 | |
4 | |
|
13 | namespace HamBook.Radios.Yaesu.FT_891.CAT |
5 | namespace HamBook.Radios.Yaesu.FT_891.CAT |
|
14 | { |
6 | { |
|
15 | [Radio("Yaesu FT-891")] |
7 | [Radio("Yaesu FT-891")] |
|
16 | public class VM : Generic.CAT.VM |
8 | public class Vm : Generic.CAT.Vm |
|
17 | { |
- | ||
18 | public override CatLength CatLength => new CatLength { Set = 3 }; |
- | ||
19 | |
9 | { |
|
20 | public VM(SerialPortStream serialPort) : base(serialPort) |
10 | public Vm(SerialPortStream serialPort) : base(serialPort) |
|
21 | { |
11 | { |
|
Line -... | Line 12... | |||
- | 12 | } |
||
- | 13 | |
||
22 | } |
14 | public override CatLength CatLength => new CatLength { Set = 3 }; |
|
23 | |
15 | |
|
24 | public override void Set() |
16 | public override void Set() |
|
25 | { |
17 | { |
|
Line 26... | Line 18... | |||
26 | SerialPort.Write($"{Name}{Constants.EOT}"); |
18 | SerialPort.Write($"{Name}{Eot}"); |
|
27 | } |
19 | } |
|
28 | |
20 | |
|
Line 29... | Line 21... | |||
29 | public override async void CatWriteAsync(CancellationToken cancellationToken) |
21 | public override async void CatWriteAsync(CancellationToken cancellationToken) |
|
30 | { |
22 | { |
|
31 | var payload = Constants.Encoding.GetBytes($"{Name}{Constants.EOT}"); |
23 | var payload = Encoding.GetBytes($"{Name}{Eot}"); |
|
32 | |
24 | |
|
33 | await SerialPort.WriteAsync(payload, 0, payload.Length, cancellationToken); |
25 | await SerialPort.WriteAsync(payload, 0, payload.Length, cancellationToken); |