Skip to content

Commit bfe867a

Browse files
committed
feat: add support for Rsga devices
Added functionality for Rsga devices in the Mavlink helper and devices service. This includes methods to get Rsga device by ID and observe changes on Rsga devices. Also updated the project to use the upgraded Mavlink version 3.10.0 and target framework net8.0.
1 parent 4a7a259 commit bfe867a

File tree

6 files changed

+39
-9
lines changed

6 files changed

+39
-9
lines changed

src/.run/Linux-arm64.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="Linux-arm64" type="DotNetFolderPublish" factoryName="Publish to folder">
3-
<riderPublish configuration="Release" delete_existing_files="true" include_native_libs_for_self_extract="true" platform="Any CPU" produce_single_file="true" runtime="linux-arm64" self_contained="true" target_folder="$PROJECT_DIR$/../publish/linux-arm64/app" target_framework="net7.0" uuid_high="-6069974389149972757" uuid_low="-5498245974063364756" />
3+
<riderPublish configuration="Release" delete_existing_files="true" include_native_libs_for_self_extract="true" platform="Any CPU" produce_single_file="true" runtime="linux-arm64" self_contained="true" target_folder="$PROJECT_DIR$/../publish/linux-arm64/app" target_framework="net8.0" uuid_high="-6069974389149972757" uuid_low="-5498245974063364756" />
44
<method v="2" />
55
</configuration>
66
</component>

src/Asv.Drones.Gui.Api/CompatibilitySuppressions.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
33
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
44
<Suppression>
5-
<DiagnosticId>CP0002</DiagnosticId>
6-
<Target>M:Asv.Drones.Gui.Api.IMavlinkDevicesService.GetRfsaByFullId(System.UInt16)</Target>
5+
<DiagnosticId>CP0006</DiagnosticId>
6+
<Target>M:Asv.Drones.Gui.Api.IMavlinkDevicesService.GetRsgaByFullId(System.UInt16)</Target>
77
<Left>lib/net8.0/Asv.Drones.Gui.Api.dll</Left>
88
<Right>lib/net8.0/Asv.Drones.Gui.Api.dll</Right>
99
<IsBaselineSuppression>true</IsBaselineSuppression>
1010
</Suppression>
1111
<Suppression>
1212
<DiagnosticId>CP0006</DiagnosticId>
13-
<Target>M:Asv.Drones.Gui.Api.IMavlinkDevicesService.GetRfsaByFullId(System.UInt16)</Target>
13+
<Target>P:Asv.Drones.Gui.Api.IMavlinkDevicesService.RsgaDevices</Target>
1414
<Left>lib/net8.0/Asv.Drones.Gui.Api.dll</Left>
1515
<Right>lib/net8.0/Asv.Drones.Gui.Api.dll</Right>
1616
<IsBaselineSuppression>true</IsBaselineSuppression>

src/Asv.Drones.Gui.Api/Services/Mavlink/IMavlinkDevicesService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,8 @@ public interface IMavlinkDevicesService
6262
IAdsbClientDevice? GetAdsbVehicleByFullId(ushort id);
6363
IObservable<IChangeSet<IRfsaClientDevice, ushort>> RfsaDevices { get; }
6464
IRfsaClientDevice? GetRfsaByFullId(ushort id);
65+
IObservable<IChangeSet<IRsgaClientDevice, ushort>> RsgaDevices { get; }
66+
IRsgaClientDevice? GetRsgaByFullId(ushort id);
67+
6568
}
6669
}

src/Asv.Drones.Gui.Api/Services/Mavlink/MavlinkHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public static MaterialIconKind GetIcon(DeviceClass type)
5555
DeviceClass.GbsRtk => MaterialIconKind.RouterWireless,
5656
DeviceClass.Adsb => MaterialIconKind.Radar,
5757
DeviceClass.Rfsa => MaterialIconKind.Waveform,
58+
DeviceClass.Rsga => MaterialIconKind.CellphoneWireless,
5859
_ => MaterialIconKind.HelpNetworkOutline,
5960
};
6061
}

src/Asv.Drones.Gui/Services/Mavlink/MavlinkDevicesService.cs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class MavlinkDeviceServiceConfig
3434
public AdsbClientDeviceConfig Adsb { get; set; } = new();
3535
public bool WrapToV2ExtensionEnabled { get; set; } = true;
3636
public RfsaClientDeviceConfig Rfsa { get; set; } = new();
37+
public RfsaClientDeviceConfig Rsga { get; set; } = new();
3738
}
3839

3940
[Export(typeof(IMavlinkDevicesService))]
@@ -163,11 +164,17 @@ public MavlinkDevicesService(IConfiguration config, IPacketSequenceCalculator se
163164
.Transform(CreateRfsaDevice)
164165
.DisposeMany()
165166
.RefCount();
167+
RsgaDevices = Devices
168+
.Filter(d => d.Type == (MavType)Mavlink.V2.AsvRsga.MavType.MavTypeAsvRsga)
169+
.Transform(CreateRsgaDevice)
170+
.DisposeMany()
171+
.RefCount();
166172

167173
AllDevices = Vehicles.Transform(x => (IClientDevice)x)
168174
.MergeChangeSets(BaseStations.Transform(x => (IClientDevice)x))
169175
.MergeChangeSets(Payloads.Transform(x => (IClientDevice)x))
170176
.MergeChangeSets(RfsaDevices.Transform(x => (IClientDevice)x))
177+
.MergeChangeSets(RsgaDevices.Transform(x => (IClientDevice)x))
171178
.MergeChangeSets(AdsbDevices.Transform(x => (IClientDevice)x));
172179

173180
#endregion
@@ -191,6 +198,18 @@ public MavlinkDevicesService(IConfiguration config, IPacketSequenceCalculator se
191198
#endregion
192199
}
193200

201+
202+
203+
private IRsgaClientDevice CreateRsgaDevice(IMavlinkDevice device)
204+
{
205+
return new RsgaClientDevice(Router, new MavlinkClientIdentity
206+
{
207+
TargetSystemId = device.SystemId,
208+
TargetComponentId = device.ComponentId,
209+
SystemId = _systemId.Value,
210+
ComponentId = _componentId.Value,
211+
}, InternalGetConfig(c => c.Rsga), _sequenceCalculator, RxApp.MainThreadScheduler);
212+
}
194213
private IRfsaClientDevice CreateRfsaDevice(IMavlinkDevice device)
195214
{
196215
return new RfsaClientDevice(Router, new MavlinkClientIdentity
@@ -323,7 +342,14 @@ private string TryGetName(StatustextPacket pkt)
323342
using var autoDispose = RfsaDevices.BindToObservableList(out var list).Subscribe();
324343
return list.Items.FirstOrDefault(d => d.FullId == id);
325344
}
326-
345+
346+
public IObservable<IChangeSet<IRsgaClientDevice, ushort>> RsgaDevices { get; }
347+
public IRsgaClientDevice? GetRsgaByFullId(ushort id)
348+
{
349+
using var autoDispose = RsgaDevices.BindToObservableList(out var list).Subscribe();
350+
return list.Items.FirstOrDefault(d => ((IClientDevice)d).FullId == id);
351+
}
352+
327353
private IVehicleClient? CreateVehicle(IMavlinkDevice device)
328354
{
329355
//if (device.Autopilot == MavAutopilot.MavAutopilotArdupilotmega)

src/Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project>
22
<PropertyGroup>
3-
<ProductVersion>1.0.0</ProductVersion>
4-
<ApiVersion>1.0.0</ApiVersion>
5-
<ApiPrevVersion>0.3.6</ApiPrevVersion>
3+
<ProductVersion>1.0.1</ProductVersion>
4+
<ApiVersion>1.0.1</ApiVersion>
5+
<ApiPrevVersion>1.0.0</ApiPrevVersion>
66
<AvaloniaVersion>11.0.6</AvaloniaVersion>
77
<AsvCommonVersion>2.0.2</AsvCommonVersion>
88
<AsvAvaloniaToolkitVersion>1.0.1</AsvAvaloniaToolkitVersion>
99
<AsvAvaloniaMapVersion>2.0.5</AsvAvaloniaMapVersion>
10-
<AsvMavlinkVersion>3.9.2</AsvMavlinkVersion>
10+
<AsvMavlinkVersion>3.10.0</AsvMavlinkVersion>
1111
<FluentAvaloniaUIVersion>2.0.5</FluentAvaloniaUIVersion>
1212
<ReactiveUIVersion>19.5.41</ReactiveUIVersion>
1313
<SystemReactiveVersion>6.0.0</SystemReactiveVersion>

0 commit comments

Comments
 (0)