Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
runs-on: windows-latest # безпечно для будь-яких .NET проектів
steps:
- uses: actions/checkout@v4
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
with: { fetch-depth: 0 }

- uses: actions/setup-dotnet@v4
Expand All @@ -56,14 +58,14 @@ jobs:
dotnet tool install --global dotnet-sonarscanner
echo "$env:USERPROFILE\.dotnet\tools" >> $env:GITHUB_PATH
dotnet sonarscanner begin `
/k:"ppanchen_NetSdrClient" `
/o:"ppanchen" `
/k:"MinTins_ReengineeringCourse" `
/o:"roman-flakei" `
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" `
/d:sonar.cs.opencover.reportsPaths="**/coverage.xml" `
/d:sonar.cpd.cs.minimumTokens=40 `
/d:sonar.cpd.cs.minimumLines=5 `
/d:sonar.exclusions=**/bin/**,**/obj/**,**/sonarcloud.yml `
/d:sonar.qualitygate.wait=true
/d:sonar.qualitygate.wait=false
shell: pwsh
# 2) BUILD & TEST
- name: Restore
Expand Down
2 changes: 1 addition & 1 deletion EchoTcpServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class EchoServer
{
private readonly int _port;
private TcpListener _listener;
private CancellationTokenSource _cancellationTokenSource;
private readonly CancellationTokenSource _cancellationTokenSource;


public EchoServer(int port)
Expand Down
8 changes: 4 additions & 4 deletions NetSdrClientApp/NetSdrClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace NetSdrClientApp
{
public class NetSdrClient
{
private ITcpClient _tcpClient;
private IUdpClient _udpClient;
private readonly ITcpClient _tcpClient;
private readonly IUdpClient _udpClient;

public bool IQStarted { get; set; }

Expand Down Expand Up @@ -66,7 +66,7 @@ public async Task StartIQAsync()
return;
}

; var iqDataMode = (byte)0x80;
var iqDataMode = (byte)0x80;
var start = (byte)0x02;
var fifo16bitCaptureMode = (byte)0x01;
var n = (byte)1;
Expand Down Expand Up @@ -116,7 +116,7 @@ public async Task ChangeFrequencyAsync(long hz, int channel)

private void _udpClient_MessageReceived(object? sender, byte[] e)
{
NetSdrMessageHelper.TranslateMessage(e, out MsgTypes type, out ControlItemCodes code, out ushort sequenceNum, out byte[] body);
NetSdrMessageHelper.TranslateMessage(e, out _, out _, out _, out byte[] body);
var samples = NetSdrMessageHelper.GetSamples(16, body);

Console.WriteLine($"Samples recieved: " + body.Select(b => Convert.ToString(b, toBase: 16)).Aggregate((l, r) => $"{l} {r}"));
Expand Down
6 changes: 3 additions & 3 deletions NetSdrClientApp/Networking/TcpClientWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace NetSdrClientApp.Networking
{
public class TcpClientWrapper : ITcpClient
{
private string _host;
private int _port;
private readonly string _host;
private readonly int _port;
private TcpClient? _tcpClient;
private NetworkStream? _stream;
private CancellationTokenSource _cts;
Expand Down Expand Up @@ -117,7 +117,7 @@ private async Task StartListeningAsync()
}
}
}
catch (OperationCanceledException ex)
catch (OperationCanceledException)
{
//empty
}
Expand Down