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; |
1 | using System.Threading; |
|
6 | using System.Text; |
- | ||
7 | using System.Threading.Tasks; |
2 | using System.Threading.Tasks; |
|
8 | using HamBook.Radios.Generic; |
3 | using HamBook.Radios.Generic; |
|
9 | using static HamBook.Radios.Yaesu.FT_891.Constants; |
- | ||
10 | using RJCP.IO.Ports; |
4 | using RJCP.IO.Ports; |
|
11 | using System.Threading; |
5 | using static HamBook.Radios.Yaesu.FT_891.Constants; |
|
Line 12... | Line 6... | |||
12 | |
6 | |
|
13 | namespace HamBook.Radios.Yaesu.FT_891.CAT |
7 | namespace HamBook.Radios.Yaesu.FT_891.CAT |
|
14 | { |
8 | { |
|
15 | [Radio("Yaesu FT-891")] |
9 | [Radio("Yaesu FT-891")] |
|
16 | public class CH : Generic.CAT.CH |
10 | public class Ch : Generic.CAT.Ch |
|
17 | { |
- | ||
18 | public override CatLength CatLength => new CatLength { Set = 3 }; |
- | ||
19 | |
11 | { |
|
20 | public CH(SerialPortStream serialPort) : base(serialPort) |
12 | public Ch(SerialPortStream serialPort) : base(serialPort) |
|
21 | { |
13 | { |
|
Line -... | Line 14... | |||
- | 14 | } |
||
- | 15 | |
||
22 | } |
16 | public override CatLength CatLength => new CatLength { Set = 3 }; |
|
23 | |
17 | |
|
24 | public override void Write(ChannelDirection channelDirection) |
18 | public override void Write(ChannelDirection channelDirection) |
|
25 | { |
19 | { |
|
Line 26... | Line 20... | |||
26 | SerialPort.Write($"{Name}{(int)channelDirection}{Constants.EOT}"); |
20 | SerialPort.Write($"{Name}{(int)channelDirection}{Eot}"); |
|
27 | } |
21 | } |
|
28 | |
22 | |
|
Line 29... | Line 23... | |||
29 | public override async Task WriteAsync(ChannelDirection channelDirection, CancellationToken cancellationToken) |
23 | public override async Task WriteAsync(ChannelDirection channelDirection, CancellationToken cancellationToken) |
|
30 | { |
24 | { |
|
31 | var payload = Constants.Encoding.GetBytes($"{Name}{(int)channelDirection}{Constants.EOT}"); |
25 | var payload = Encoding.GetBytes($"{Name}{(int)channelDirection}{Eot}"); |
|
32 | |
26 | |
|
33 | await SerialPort.WriteAsync(payload, 0, payload.Length, cancellationToken); |
27 | await SerialPort.WriteAsync(payload, 0, payload.Length, cancellationToken); |