HamBook – Diff between revs 9 and 11
?pathlinks?
Rev 9 | Rev 11 | |||
---|---|---|---|---|
Line 23... | Line 23... | |||
23 | { |
23 | { |
|
24 | SerialPort.Write($"{Name}{P1(type)}{Generic.Constants.EOT}"); |
24 | SerialPort.Write($"{Name}{P1(type)}{Generic.Constants.EOT}"); |
|
25 | var buffer = new byte[CatLength.Answer]; |
25 | var buffer = new byte[CatLength.Answer]; |
|
26 | if (SerialPort.Read(buffer, 0, CatLength.Answer) != CatLength.Answer) |
26 | if (SerialPort.Read(buffer, 0, CatLength.Answer) != CatLength.Answer) |
|
27 | { |
27 | { |
|
28 | throw new ArgumentException(); |
28 | throw new UnexpectedRadioResponseException(Name, buffer); |
|
29 | } |
29 | } |
|
Line 30... | Line 30... | |||
30 | |
30 | |
|
31 | var answer = Encoding.ASCII.GetString(buffer); |
31 | var answer = Constants.Encoding.GetString(buffer); |
|
32 | var match = readRegex.Match(answer); |
32 | var match = readRegex.Match(answer); |
|
33 | if (!match.Success) |
33 | if (!match.Success) |
|
34 | { |
34 | { |
|
35 | throw new ArgumentException(); |
35 | throw new UnmatchedRadioResponseException(Name, answer); |
|
Line 36... | Line 36... | |||
36 | } |
36 | } |
|
Line 37... | Line 37... | |||
37 | |
37 | |