This commit is contained in:
parent
2d8b66e1e8
commit
4a90c8751f
@ -21,6 +21,7 @@ namespace skyscraper5.src.InteractionChannel
|
||||
TmstInvalid,
|
||||
Fct2Invalid,
|
||||
Tbtp2Invalid,
|
||||
Tmst2Invalid
|
||||
Tmst2Invalid,
|
||||
BctInvalid
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
|
||||
namespace skyscraper5.src.InteractionChannel
|
||||
{
|
||||
@ -30,6 +31,7 @@ namespace skyscraper5.src.InteractionChannel
|
||||
void OnReturnTransmissionMOdes(PhysicalAddress macAddress, _0xb2_ReturnTransmissionModesDescriptor descriptor);
|
||||
void OnConnectionControl(PhysicalAddress macAddress, _0xaf_ConnectionControlDescriptor descriptor);
|
||||
void OnTerminalBurstTimePlan2(ushort interactiveNetworkId, Tbtp2 tbtp2);
|
||||
void OnFrameComposition2(ushort? networkId, Fct2 fct2);
|
||||
void OnFrameComposition2(ushort networkId, Fct2 fct2);
|
||||
void OnBroadcastConfiguration(ushort networkId, Bct bct);
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
|
||||
namespace skyscraper5.src.InteractionChannel
|
||||
{
|
||||
@ -205,11 +206,24 @@ namespace skyscraper5.src.InteractionChannel
|
||||
return;
|
||||
}
|
||||
|
||||
Handler.OnFrameComposition2(NetworkId, fct2);
|
||||
Handler.OnFrameComposition2(NetworkId.Value, fct2);
|
||||
return;
|
||||
case 0xAC: //BCT
|
||||
//see en_30154502v010401p.pdf, page 49
|
||||
throw new NotImplementedException("BCT");
|
||||
InteractionChannelSiSectionHeader bctHeader = new InteractionChannelSiSectionHeader(ms);
|
||||
if (!bctHeader.Valid)
|
||||
{
|
||||
_handler.OnInteractionChannelError(InteractionChannelErrorState.HeaderInvalid);
|
||||
return;
|
||||
}
|
||||
NetworkId = bctHeader.InteractiveNetworkId;
|
||||
Bct bct = new Bct(ms);
|
||||
if (!bct.Valid)
|
||||
{
|
||||
_handler.OnInteractionChannelError(InteractionChannelErrorState.BctInvalid);
|
||||
return;
|
||||
}
|
||||
Handler.OnBroadcastConfiguration(NetworkId.Value, bct);
|
||||
return;
|
||||
case 0xAD: //TBTP2
|
||||
InteractionChannelSiSectionHeader tbtp2Header = new InteractionChannelSiSectionHeader(ms);
|
||||
if (!tbtp2Header.Valid)
|
||||
|
||||
43
skyscraper8/InteractionChannel/Model2/Bct.cs
Normal file
43
skyscraper8/InteractionChannel/Model2/Bct.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.Skyscraper;
|
||||
using skyscraper5.Skyscraper.IO;
|
||||
|
||||
namespace skyscraper8.InteractionChannel.Model2
|
||||
{
|
||||
/// <summary>
|
||||
/// Broadcast Configuration Table as found on ETSI EN 301 545-2 V1.4.1, page 59
|
||||
/// </summary>
|
||||
public class Bct : Validatable
|
||||
{
|
||||
public Bct(MemoryStream ms)
|
||||
{
|
||||
byte loopCount = ms.ReadUInt8();
|
||||
TxTypes = new BroadcastConfiguration[loopCount];
|
||||
for (int i = 0; i < loopCount; i++)
|
||||
{
|
||||
TxTypes[i] = new BroadcastConfiguration();
|
||||
TxTypes[i].TxType = ms.ReadUInt8();
|
||||
TxTypes[i].TxContentType = ms.ReadUInt8();
|
||||
TxTypes[i].TxFormatClass = ms.ReadUInt8();
|
||||
byte txFormatDataLengnth = ms.ReadUInt8();
|
||||
TxTypes[i].TxFormatData = ms.ReadBytes(txFormatDataLengnth);
|
||||
}
|
||||
|
||||
Valid = true;
|
||||
}
|
||||
|
||||
public BroadcastConfiguration[] TxTypes { get; private set; }
|
||||
|
||||
public class BroadcastConfiguration
|
||||
{
|
||||
public byte TxType { get; set; }
|
||||
public byte TxContentType { get; set; }
|
||||
public byte TxFormatClass { get; set; }
|
||||
public byte[] TxFormatData { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8,6 +8,7 @@ using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
|
||||
namespace skyscraper5.src.InteractionChannel
|
||||
{
|
||||
@ -27,9 +28,18 @@ namespace skyscraper5.src.InteractionChannel
|
||||
|
||||
}
|
||||
|
||||
public void OnFrameComposition2(ushort networkId, Fct2 fct2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnBroadcastConfiguration(ushort networkId, Bct bct)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnFrameComposition2(ushort? networkId, Fct2 fct2)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
}
|
||||
|
||||
public void OnContentionControl(PhysicalAddress macAddress, _0xab_ContentionControlDescriptor ccd)
|
||||
|
||||
@ -80,6 +80,7 @@ using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper8.Experimentals.NdsSsu;
|
||||
using skyscraper8.Experimentals.OtvSsu;
|
||||
using skyscraper8.GSE;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
using skyscraper8.Skyscraper.Net;
|
||||
using skyscraper8.Skyscraper.Scraper;
|
||||
using Tsubasa.IO;
|
||||
@ -2413,14 +2414,26 @@ namespace skyscraper5.Skyscraper.Scraper
|
||||
}
|
||||
}
|
||||
|
||||
public void OnFrameComposition2(ushort? networkId, Fct2 fct2)
|
||||
public void OnFrameComposition2(ushort networkId, Fct2 fct2)
|
||||
{
|
||||
foreach (Fct2.Frame frame in fct2.FrameTypes)
|
||||
{
|
||||
if (!DataStorage.TestForFrameComposition2(networkId.Value, frame))
|
||||
if (!DataStorage.TestForFrameComposition2(networkId, frame))
|
||||
{
|
||||
LogEvent(SkyscraperContextEvent.FrameComposition2,String.Format("Network ID = {0}, Frame Type = {1}",networkId.Value,frame.FrameType));
|
||||
DataStorage.InsertFct2Frame(networkId.Value, frame);
|
||||
LogEvent(SkyscraperContextEvent.FrameComposition2,String.Format("Network ID = {0}, Frame Type = {1}",networkId,frame.FrameType));
|
||||
DataStorage.InsertFct2Frame(networkId, frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnBroadcastConfiguration(ushort networkId, Bct bct)
|
||||
{
|
||||
foreach (Bct.BroadcastConfiguration txType in bct.TxTypes)
|
||||
{
|
||||
if (!DataStorage.TestForBroadcastConfiguration(networkId, txType.TxType))
|
||||
{
|
||||
LogEvent(SkyscraperContextEvent.BroadcastConfiguration, String.Format("Network ID = {0}, Broadcast Configuration #{1}", networkId, txType.TxType));
|
||||
DataStorage.InsertBroadcastConfiguration(networkId, txType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,6 +87,7 @@
|
||||
NdsSsuFileAnnounced,
|
||||
NdsSsuProgress,
|
||||
TerminalBurstTimePlan2,
|
||||
FrameComposition2
|
||||
FrameComposition2,
|
||||
BroadcastConfiguration
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,6 +28,7 @@ using skyscraper8.Ses;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
using Platform = skyscraper5.Dvb.SystemSoftwareUpdate.Model.Platform;
|
||||
|
||||
namespace skyscraper8.Skyscraper.Scraper.Storage
|
||||
@ -198,5 +199,7 @@ namespace skyscraper8.Skyscraper.Scraper.Storage
|
||||
void StoreTerminalBurstTimePlan2(ushort interactiveNetworkId, byte tbtp2GroupId, Tbtp2.Frame frame);
|
||||
bool TestForFrameComposition2(ushort networkId, Fct2.Frame fct2);
|
||||
void InsertFct2Frame(ushort networkId, Fct2.Frame frame);
|
||||
bool TestForBroadcastConfiguration(ushort networkId, byte txTypeTxType);
|
||||
void InsertBroadcastConfiguration(ushort networkId, Bct.BroadcastConfiguration txType);
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,6 +38,7 @@ using skyscraper8.DvbI;
|
||||
using skyscraper8.DvbNip;
|
||||
using skyscraper8.Experimentals.NdsSsu;
|
||||
using skyscraper8.Ietf.FLUTE;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
using skyscraper8.Ses;
|
||||
using skyscraper8.SimpleServiceDiscoveryProtocol;
|
||||
using skyscraper8.Skyscraper.Drawing;
|
||||
@ -1176,6 +1177,16 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TestForBroadcastConfiguration(ushort networkId, byte txTypeTxType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void InsertBroadcastConfiguration(ushort networkId, Bct.BroadcastConfiguration txType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<Tuple<int, int, ProgramMapping>> SelectAllPmt()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
@ -38,6 +38,7 @@ using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper8.Ietf.FLUTE;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage;
|
||||
using skyscraper8.Skyscraper.Scraper.Storage.Utilities;
|
||||
using Platform = skyscraper5.Dvb.SystemSoftwareUpdate.Model.Platform;
|
||||
@ -1005,6 +1006,25 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
|
||||
_fct2Frames.Add(key, frame);
|
||||
}
|
||||
|
||||
private Dictionary<Tuple<ushort, byte>, Bct.BroadcastConfiguration> broadcastConfigurations;
|
||||
public bool TestForBroadcastConfiguration(ushort networkId, byte txTypeTxType)
|
||||
{
|
||||
if (broadcastConfigurations == null)
|
||||
return false;
|
||||
|
||||
Tuple<ushort, byte> key = new Tuple<ushort, byte>(networkId, txTypeTxType);
|
||||
return broadcastConfigurations.ContainsKey(key);
|
||||
}
|
||||
|
||||
public void InsertBroadcastConfiguration(ushort networkId, Bct.BroadcastConfiguration txType)
|
||||
{
|
||||
if (broadcastConfigurations == null)
|
||||
broadcastConfigurations = new Dictionary<Tuple<ushort, byte>, Bct.BroadcastConfiguration>();
|
||||
|
||||
Tuple<ushort, byte> key = new Tuple<ushort, byte>(networkId, txType.TxType);
|
||||
broadcastConfigurations.Add(key, txType);
|
||||
}
|
||||
|
||||
public IEnumerable<Tuple<int, int, ProgramMapping>> SelectAllPmt()
|
||||
{
|
||||
for (int x = 0; x < pmtEntries.Length; x++)
|
||||
|
||||
@ -12,6 +12,7 @@ using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using skyscraper5.src.InteractionChannel.Model2;
|
||||
using skyscraper8.InteractionChannel.Model2;
|
||||
|
||||
namespace skyscraper5.src.Skyscraper.Scraper.StreamAutodetection.Contestants
|
||||
{
|
||||
@ -193,9 +194,28 @@ namespace skyscraper5.src.Skyscraper.Scraper.StreamAutodetection.Contestants
|
||||
}
|
||||
}
|
||||
|
||||
public void OnFrameComposition2(ushort networkId, Fct2 fct2)
|
||||
{
|
||||
if (fct2.FrameTypes.Length > 0)
|
||||
{
|
||||
Score++;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnBroadcastConfiguration(ushort networkId, Bct bct)
|
||||
{
|
||||
if (bct.TxTypes.Length > 0)
|
||||
{
|
||||
Score++;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnFrameComposition2(ushort? networkId, Fct2 fct2)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (fct2.FrameTypes.Length > 0)
|
||||
{
|
||||
Score++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user