From 8e3311bcce2b22225c7a957bafd0377c2f664550 Mon Sep 17 00:00:00 2001 From: feyris-tan <4116042+feyris-tan@users.noreply.github.com> Date: Tue, 11 Nov 2025 21:19:38 +0100 Subject: [PATCH] Actually scrape the SatelliteReturnLinkDescriptor --- .../InteractionChannel.cs | 20 +++++++++++++++++++ .../InteractionChannelHandler.cs | 1 + skyscraper8/InteractionChannel/Model/Tim.cs | 3 +++ .../NullInteractionChannelHandler.cs | 5 +++++ .../Skyscraper/Scraper/SkyscraperContext.cs | 9 +++++++++ .../Scraper/SkyscraperContextEvent.cs | 3 ++- .../Skyscraper/Scraper/Storage/DataStorage.cs | 2 ++ .../Storage/Filesystem/FilesystemStorage.cs | 10 ++++++++++ .../InMemory/InMemoryScraperStorage.cs | 17 ++++++++++++++++ .../InteractionChannelContestant.cs | 5 +++++ 10 files changed, 74 insertions(+), 1 deletion(-) diff --git a/DataTableStorages/skyscraper5.Data.PostgreSql/InteractionChannel.cs b/DataTableStorages/skyscraper5.Data.PostgreSql/InteractionChannel.cs index 365a7bf..23f5cc0 100644 --- a/DataTableStorages/skyscraper5.Data.PostgreSql/InteractionChannel.cs +++ b/DataTableStorages/skyscraper5.Data.PostgreSql/InteractionChannel.cs @@ -997,6 +997,26 @@ namespace skyscraper5.Data.PostgreSql throw new NotImplementedException(); } + public bool TestForTimControlAssignment(PhysicalAddress macAddress) + { + throw new NotImplementedException(); + } + + public void InsertTimControlAssignment(PhysicalAddress macAddress, _0xa4_SyncAssignDescriptor descriptor) + { + throw new NotImplementedException(); + } + + public bool TestForTimSatelliteReturnLink(PhysicalAddress macAddress) + { + throw new NotImplementedException(); + } + + public void InsertTimSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor) + { + throw new NotImplementedException(); + } + private bool AreArraysEqual(byte[] l, byte[] r) { if (l.Length != r.Length) diff --git a/skyscraper8/InteractionChannel/InteractionChannelHandler.cs b/skyscraper8/InteractionChannel/InteractionChannelHandler.cs index 8d73a59..8cf3502 100644 --- a/skyscraper8/InteractionChannel/InteractionChannelHandler.cs +++ b/skyscraper8/InteractionChannel/InteractionChannelHandler.cs @@ -42,5 +42,6 @@ namespace skyscraper5.src.InteractionChannel void OnFramePayloadFormatAnnouncement(ushort networkId, _0xb7_FramePayloadFormatDescriptor descriptor); void OnCorrectionMessageExtension(PhysicalAddress macAddress, _0xb1_CorrectionMessageExtensionDescriptor descriptor); void OnControlAssignment(PhysicalAddress macAddress, _0xa4_SyncAssignDescriptor descriptor); + void OnSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor); } } diff --git a/skyscraper8/InteractionChannel/Model/Tim.cs b/skyscraper8/InteractionChannel/Model/Tim.cs index f4220cd..caba33c 100644 --- a/skyscraper8/InteractionChannel/Model/Tim.cs +++ b/skyscraper8/InteractionChannel/Model/Tim.cs @@ -307,6 +307,9 @@ namespace skyscraper5.src.InteractionChannel.Model case 0xa4: handler.OnControlAssignment(macAddress,(_0xa4_SyncAssignDescriptor)descriptor); break; + case 0xa9: + handler.OnSatelliteReturnLink(macAddress, (_0xa9_SatelliteReturnLinkDescriptor)descriptor); + break; case 0xab: handler.OnContentionControl(macAddress, ((_0xab_ContentionControlDescriptor)descriptor)); break; diff --git a/skyscraper8/InteractionChannel/NullInteractionChannelHandler.cs b/skyscraper8/InteractionChannel/NullInteractionChannelHandler.cs index 757ad01..43ce138 100644 --- a/skyscraper8/InteractionChannel/NullInteractionChannelHandler.cs +++ b/skyscraper8/InteractionChannel/NullInteractionChannelHandler.cs @@ -69,6 +69,11 @@ namespace skyscraper5.src.InteractionChannel } + public void OnSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor) + { + + } + public void OnFrameComposition2(ushort? networkId, Fct2 fct2) { diff --git a/skyscraper8/Skyscraper/Scraper/SkyscraperContext.cs b/skyscraper8/Skyscraper/Scraper/SkyscraperContext.cs index c8b07d6..2f67ea7 100644 --- a/skyscraper8/Skyscraper/Scraper/SkyscraperContext.cs +++ b/skyscraper8/Skyscraper/Scraper/SkyscraperContext.cs @@ -2553,6 +2553,15 @@ namespace skyscraper5.Skyscraper.Scraper } } + public void OnSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor) + { + if (!DataStorage.TestForTimSatelliteReturnLink(macAddress)) + { + LogEvent(SkyscraperContextEvent.TimSatelliteReturnLink, String.Format("For participant {0}: {1}", macAddress, descriptor)); + DataStorage.InsertTimSatelliteReturnLink(macAddress, descriptor); + } + } + public void OnCorrectionMessage(PhysicalAddress mac, _0xa1_CorrectionMessageDescriptor cmd) { if (!DataStorage.TestForTim(mac)) diff --git a/skyscraper8/Skyscraper/Scraper/SkyscraperContextEvent.cs b/skyscraper8/Skyscraper/Scraper/SkyscraperContextEvent.cs index a99fdd7..088bb8f 100644 --- a/skyscraper8/Skyscraper/Scraper/SkyscraperContextEvent.cs +++ b/skyscraper8/Skyscraper/Scraper/SkyscraperContextEvent.cs @@ -95,6 +95,7 @@ TransmissionModeSupport2, TimFramePayloadFormat, TimCorrectionExtension, - TimControlAssignment + TimControlAssignment, + TimSatelliteReturnLink } } diff --git a/skyscraper8/Skyscraper/Scraper/Storage/DataStorage.cs b/skyscraper8/Skyscraper/Scraper/Storage/DataStorage.cs index 1f7403b..9b165d4 100644 --- a/skyscraper8/Skyscraper/Scraper/Storage/DataStorage.cs +++ b/skyscraper8/Skyscraper/Scraper/Storage/DataStorage.cs @@ -214,5 +214,7 @@ namespace skyscraper8.Skyscraper.Scraper.Storage void InsertTimCorrectionMessageExtension(PhysicalAddress macAddress, _0xb1_CorrectionMessageExtensionDescriptor descriptor); bool TestForTimControlAssignment(PhysicalAddress macAddress); void InsertTimControlAssignment(PhysicalAddress macAddress, _0xa4_SyncAssignDescriptor descriptor); + bool TestForTimSatelliteReturnLink(PhysicalAddress macAddress); + void InsertTimSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor); } } diff --git a/skyscraper8/Skyscraper/Scraper/Storage/Filesystem/FilesystemStorage.cs b/skyscraper8/Skyscraper/Scraper/Storage/Filesystem/FilesystemStorage.cs index dd54ad8..e305e7b 100644 --- a/skyscraper8/Skyscraper/Scraper/Storage/Filesystem/FilesystemStorage.cs +++ b/skyscraper8/Skyscraper/Scraper/Storage/Filesystem/FilesystemStorage.cs @@ -1245,6 +1245,16 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem throw new NotImplementedException(); } + public bool TestForTimSatelliteReturnLink(PhysicalAddress macAddress) + { + throw new NotImplementedException(); + } + + public void InsertTimSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor) + { + throw new NotImplementedException(); + } + public IEnumerable> SelectAllPmt() { throw new NotImplementedException(); diff --git a/skyscraper8/Skyscraper/Scraper/Storage/InMemory/InMemoryScraperStorage.cs b/skyscraper8/Skyscraper/Scraper/Storage/InMemory/InMemoryScraperStorage.cs index b0cb5e5..e9e79c0 100644 --- a/skyscraper8/Skyscraper/Scraper/Storage/InMemory/InMemoryScraperStorage.cs +++ b/skyscraper8/Skyscraper/Scraper/Storage/InMemory/InMemoryScraperStorage.cs @@ -1132,6 +1132,23 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory _timControlAssignments.Add(macAddress, descriptor); } + private Dictionary _timSatelliteReturnLinks; + public bool TestForTimSatelliteReturnLink(PhysicalAddress macAddress) + { + if (_timSatelliteReturnLinks == null) + return false; + + return _timSatelliteReturnLinks.ContainsKey(macAddress); + } + + public void InsertTimSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor) + { + if (_timSatelliteReturnLinks == null) + _timSatelliteReturnLinks = new Dictionary(); + + _timSatelliteReturnLinks.Add(macAddress, descriptor); + } + public IEnumerable> SelectAllPmt() { for (int x = 0; x < pmtEntries.Length; x++) diff --git a/skyscraper8/Skyscraper/Scraper/StreamAutodetection/Contestants/InteractionChannelContestant.cs b/skyscraper8/Skyscraper/Scraper/StreamAutodetection/Contestants/InteractionChannelContestant.cs index e542e09..baff2eb 100644 --- a/skyscraper8/Skyscraper/Scraper/StreamAutodetection/Contestants/InteractionChannelContestant.cs +++ b/skyscraper8/Skyscraper/Scraper/StreamAutodetection/Contestants/InteractionChannelContestant.cs @@ -246,6 +246,11 @@ namespace skyscraper5.src.Skyscraper.Scraper.StreamAutodetection.Contestants //TODO: put some sensible validation logic in here } + public void OnSatelliteReturnLink(PhysicalAddress macAddress, _0xa9_SatelliteReturnLinkDescriptor descriptor) + { + //TODO: put some sensible validation logic in here + } + public void OnFrameComposition2(ushort? networkId, Fct2 fct2) { if (fct2.FrameTypes.Length > 0)