/// Turbosight.cs
private enum BdaExtensionProperty
{
Reserved = 0,
NBC_PARAMS = 10, // Property for setting the DVB-S2 parameter
BlindScan = 11, // Property for accessing and controlling the hardware blind scan capabilities.
TbsAccess = 21 // TBS property for enabling control of the common properties in the BdaExtensionCommand enum.
}
private struct BDA_NBC_PARAMS
{
public int rolloff;
public int pilot;
public int dvbtype;// 1 for dvbs 2 for dvbs2 0 for auto
public int fecrate;
public int modtype;
}
private const int TbsNBCParamsSize = 20;
/// <summary>
/// Sets the DVB-Type for TBS PCIe Card.
/// </summary>
/// <param name="reply">The reply message.</param>
/// <returns><c>true</c> if a reply is successfully received, otherwise <c>false</c></returns>
public void SetDVBS2(DVBSChannel channel)
{
//Set the Pilot
Log.Log.Info("Turbosight: Set DVB-S2");
if(channel.ModulationType != ModulationType.ModNbc8Psk && channel.ModulationType != ModulationType.ModNbcQpsk)
return;
int hr;
KSPropertySupport supported;
_propertySet.QuerySupported(BdaExtensionPropertySet, (int)BdaExtensionProperty.NBC_PARAMS,
out supported);
if ((supported & KSPropertySupport.Set) == KSPropertySupport.Set)
{
BDA_NBC_PARAMS DVBNBCParams = new BDA_NBC_PARAMS();
DVBNBCParams.fecrate = (int)channel.InnerFecRate;
DVBNBCParams.modtype = (int)channel.ModulationType;
DVBNBCParams.pilot = (int)channel.Pilot;
DVBNBCParams.rolloff = (int)channel.Rolloff;
DVBNBCParams.dvbtype = 2; //DVB-S2
Log.Log.Info("Turbosight: Set DVB-S2: {0}", DVBNBCParams.dvbtype);
Marshal.StructureToPtr(DVBNBCParams, _generalBuffer, true);
DVB_MMI.DumpBinary(_generalBuffer, 0, TbsNBCParamsSize);
hr = _propertySet.Set(_propertySetGuid,(int)BdaExtensionProperty.NBC_PARAMS,
_generalBuffer, TbsNBCParamsSize,
_generalBuffer, TbsNBCParamsSize
);
if (hr != 0)
{
Log.Log.Info("Turbosight: Set DVB-S2 returned {0}", hr, DsError.GetErrorText(hr));
}
}
else
{
Log.Log.Info("Turbosight: Set DVB-S2 not supported");
}
}
SetDVBS2(channel); // Don't need to know the result of this.
return (successDiseqc && successTone);
}
Thanks DjBlu!
Will I get away with just running these files in your custom data grabber install or does it need the TBSV2 svn?
Thanks again, been trying to get to bottom of the slow changes for ages!
No prob DJBlu
Thanks for the code - I attempted last night but to compile I need the Win SDK installed, I downloaded over night and in typical MS style - failed to install
I only have 3g web access atm (yes it's painful) and it used up most of my months download allowance
I'll download the full sdk iso when I'm next at my parents house.
Thanks for your help
Talk about laying it on thick! lol
I'll have a look into it in the week if you can wait.