The blindscan will not retry signals for a few times.

This commit is contained in:
feyris-tan 2025-10-26 10:04:22 +01:00
parent c603b10096
commit 90051928eb
7 changed files with 86 additions and 19 deletions

View File

@ -33,6 +33,8 @@ internal class GseReader : IMisHandler
GsePacket child = new GsePacket(startIndicator, endIndicator, labelTypeIndicator);
if (!startIndicator || !endIndicator)
{
if (ms.Position == ms.Length)
return;
child.FragmentId = ms.ReadUInt8();
gseLength--;
}
@ -45,6 +47,8 @@ internal class GseReader : IMisHandler
if (startIndicator)
{
if (ms.GetAvailableBytes() < 2)
return;
child.ProtocolType = ms.ReadUInt16BE();
gseLength -= 2;
if (!endIndicator)
@ -81,6 +85,8 @@ internal class GseReader : IMisHandler
if (gseLength > ms.GetAvailableBytes())
return;
if (gseLength <= -1)
return;
child.GseDataBytes = ms.ReadBytes(gseLength);
if (!startIndicator && endIndicator)
@ -120,6 +126,21 @@ internal class GseReader : IMisHandler
return;
}
if (!child.StartIndicator && !child.EndIndicator)
{
if (fragmentations == null)
{
//We haven't seen any starting frames yet, so we can't use an inbetween frame. We can throw this away.
return;
}
if (fragmentations[child.FragmentId.Value] == null)
{
//fragment beginning missing, we can throw this away.
return;
}
throw new NotImplementedException(child.ToString());
}
if (child.StartIndicator && child.EndIndicator)
{
switch (child.ProtocolType)
@ -132,7 +153,7 @@ internal class GseReader : IMisHandler
warnedEthertypes = new bool[0xffff];
if (!warnedEthertypes[child.ProtocolType.Value])
{
logger.WarnFormat("This GSE contains other traffic types (type {0:X4}) besides IP (type 0x0800). If it's not too much trouble, please consider submitting a sample.",child.ProtocolType.Value);
logger.WarnFormat("This GSE contains other traffic types (type 0x{0:X4}) besides IP (type 0x0800). If it's not too much trouble, please consider submitting a sample.",child.ProtocolType.Value);
warnedEthertypes[child.ProtocolType.Value] = true;
}
break;

View File

@ -34,6 +34,7 @@ using skyscraper8.SatIp;
using skyscraper8.SatIp.RtspResponses;
using skyscraper8.SimpleServiceDiscoveryProtocol;
using skyscraper8.Skyscraper.Math;
using skyscraper8.Skyscraper;
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")]
namespace skyscraper5

View File

@ -2,7 +2,7 @@
"profiles": {
"skyscraper8": {
"commandName": "Project",
"commandLineArgs": "\"D:\\sorglos-iww-rww-aca-oca.ts\"",
"commandLineArgs": "udpin udp://127.0.0.1:6970",
"remoteDebugEnabled": false
},
"Container (Dockerfile)": {

View File

@ -588,7 +588,7 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
if (!satelliteSr.Lock)
{
logger.Log(PluginLogLevel.Info, string.Format("Trying to SetChannel..."), 8);
bool channel = config.StreamReader.SetChannel(result.SearchResult.Freq, result.SearchResult.SR, result.SearchResult.Freq, result.SearchResult.FEC, config.LnbType.Lof1 * 1000, config.LnbType.Lof2 * 1000, config.LnbType.LofSw * 1000);
bool channel = config.StreamReader.SetChannel(result.SearchResult.Freq, result.SearchResult.SR, result.SearchResult.Pol, result.SearchResult.FEC, config.LnbType.Lof1 * 1000, config.LnbType.Lof2 * 1000, config.LnbType.LofSw * 1000);
if (!channel)
{
result.State = BlindscanResultState.TuningFailed;
@ -597,6 +597,11 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
return;
}
else
{
int attempts = result.SearchResult.Freq / 1000;
attempts = attempts.GetHighestDigit();
bool sucess = false;
for (int i = 0; i < attempts; i++)
{
logger.Log(PluginLogLevel.Info, string.Format("Trying to get SignalInfo..."), 8);
bool signalInfo = config.StreamReader.SignalInfo(ref satelliteSr);
@ -605,7 +610,6 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
result.State = BlindscanResultState.TuningFailed;
config.DataStorage.UpdateTransponderState(jobInDb, result.IsSatellite(), result.SearchResult, result.State, result.SearchResult2);
config.Ui.OnBlindscanLockFail(satelliteSr, result.State);
return;
}
if (!satelliteSr.Lock)
@ -613,8 +617,16 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
result.State = BlindscanResultState.NoLock;
config.DataStorage.UpdateTransponderState(jobInDb, result.IsSatellite(), result.SearchResult, result.State, result.SearchResult2);
config.Ui.OnBlindscanLockFail(satelliteSr, result.State);
return;
}
else
{
sucess = true;
break;
}
Thread.Sleep(1000);
}
if (!sucess)
return;
}
}

View File

@ -56,6 +56,10 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
{
if (!_proxiedStreamReader.SendDiSEqC(lastDiseqcType, lastDiseqcOpcode))
return false;
if (!_proxiedStreamReader.SendDiSEqC(lastDiseqcType, lastDiseqcOpcode))
return false;
if (!_proxiedStreamReader.SendDiSEqC(lastDiseqcType, lastDiseqcOpcode))
return false;
}
currentlySelectedTuner = targetTuner;
@ -260,9 +264,13 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
if (!SwitchTuner(_setFilterTuner))
return false;
bool diseqc = SendDiSEqC(lastDiseqcType, lastDiseqcOpcode);
if (!_proxiedStreamReader.BLScanEx(freq, freq_range, pol, lof1, lof2, lofsw, minsr, std, ref pSearchResult))
return false;
logger.InfoFormat("Frequency: {0}, Polarity: {1}, Lock: {2}", freq, pol, pSearchResult.Lock);
return true;
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.Skyscraper
{
internal static class IntegerExtensions
{
public static int GetHighestDigit(this int source)
{
int result = 0;
while (source > 0)
{
int currentDigit = source % 10;
if (currentDigit > result)
result = currentDigit;
source /= 10;
}
return result;
}
}
}

View File

@ -30,9 +30,10 @@ namespace skyscraper5.src.Skyscraper
string versionString = version.ToString();
switch(versionString)
{
case "1.2.5.208": return QualificationToolResultEnum.Good;
case "1.2.5.194": return QualificationToolResultEnum.Bad; //Won't find most transponders with a 6903x
case "1.2.5.176": return QualificationToolResultEnum.Bad; //Won't find most transponders with a 6903x
case "1.2.4.101": return QualificationToolResultEnum.Good; //Works great, but is reather slow with a 6903x
case "1.2.4.101": return QualificationToolResultEnum.Bad; //Breaks GS encapsulation on 6903x.
default: return QualificationToolResultEnum.Unknown;
}
}