src/zapit/src/fastscan.cpp: fix modulation, added delsys debug, changed var to unsigned types.

Origin commit data
------------------
Commit: fcf8c75082
Author: [CST] Bas <bas@coolstreamtech.com>
Date: 2014-09-01 (Mon, 01 Sep 2014)
This commit is contained in:
[CST] Bas
2014-09-01 09:52:02 +02:00
committed by [CST] Focus
parent 3738250243
commit 75fcff13f6

View File

@@ -742,8 +742,8 @@ void CServiceScan::process_service_list_descriptor(const unsigned char * const b
void CServiceScan::process_satellite_delivery_system_descriptor(const unsigned char * const buffer, FrontendParameters * feparams, t_satellite_position * satellitePosition) void CServiceScan::process_satellite_delivery_system_descriptor(const unsigned char * const buffer, FrontendParameters * feparams, t_satellite_position * satellitePosition)
{ {
uint32_t modulationSystem, modulationType, rollOff;
stiterator tI; stiterator tI;
int modulationSystem, modulationType, rollOff, fec_inner;
feparams->frequency = ( feparams->frequency = (
((buffer[2] >> 4) * 100000000) + ((buffer[2] >> 4) * 100000000) +
@@ -762,11 +762,10 @@ void CServiceScan::process_satellite_delivery_system_descriptor(const unsigned c
((buffer[7] >> 4) * 10) + ((buffer[7] >> 4) * 10) +
((buffer[7] & 0x0F) * 1) ((buffer[7] & 0x0F) * 1)
); );
feparams->inversion = INVERSION_AUTO;
rollOff = (buffer[8] >> 4) & 0x03; //alpha_0_35, alpha_0_25, alpha_0_20, alpha_auto rollOff = (buffer[8] >> 4) & 0x03; // alpha_0_35, alpha_0_25, alpha_0_20, alpha_auto
modulationSystem = (buffer[8] >> 2) & 0x01; // 1= DVB_S2 modulationSystem = (buffer[8] >> 2) & 0x01; // 1= DVB_S2
modulationType = (buffer[8]) & 0x03; // 1=QPSK, 2=M8PSK modulationType = (buffer[8]) & 0x03; // 1=QPSK, 2=M8PSK
feparams->symbol_rate = ( feparams->symbol_rate = (
((buffer[9] >> 4) * 100000000) + ((buffer[9] >> 4) * 100000000) +
@@ -786,12 +785,24 @@ void CServiceScan::process_satellite_delivery_system_descriptor(const unsigned c
feparams->rolloff = CFrontend::getRolloff(rollOff); feparams->rolloff = CFrontend::getRolloff(rollOff);
} }
fec_inner = CFrontend::getCodeRate(buffer[12] & 0x0F, feparams->delsys); switch (modulationType) {
if(modulationType == 2) case 0: // AUTO
fec_inner += 9; feparams->modulation = QAM_AUTO;
break;
case 1: // QPSK
feparams->modulation = QPSK;
break;
case 2: // 8PSK
feparams->modulation = PSK_8;
break;
case 3: // QAM_16
feparams->modulation = QAM_16;
break;
}
feparams->fec_inner = (fe_code_rate_t) fec_inner; feparams->inversion = INVERSION_AUTO;
feparams->polarization = (buffer[8] >> 5) & 0x03; feparams->fec_inner = CFrontend::getCodeRate(buffer[12] & 0x0F, feparams->delsys);
feparams->polarization = (buffer[8] >> 5) & 0x03;
/* workarounds for braindead broadcasters (e.g. on Telstar 12 at 15.0W) */ /* workarounds for braindead broadcasters (e.g. on Telstar 12 at 15.0W) */
if (feparams->frequency >= 100000000) if (feparams->frequency >= 100000000)
@@ -802,6 +813,12 @@ void CServiceScan::process_satellite_delivery_system_descriptor(const unsigned c
feparams->frequency = (int) 1000 * (int) round ((double) feparams->frequency / (double) 1000); feparams->frequency = (int) 1000 * (int) round ((double) feparams->frequency / (double) 1000);
#ifdef SCAN_DEBUG #ifdef SCAN_DEBUG
printf("[FNT] new TP: sat %d freq %d SR %d fec %d pol %d\n", *satellitePosition, feparams->frequency, feparams->symbol_rate, fec_inner, feparams->polarization); printf("[FNT] new TP: sat %d delsys %d freq %d SR %d fec %d pol %d\n",
*satellitePosition,
feparams->delsys,
feparams->frequency,
feparams->symbol_rate,
feparams->fec_inner,
feparams->polarization);
#endif #endif
} }