ch = new cChannel();
ch->SetId(0, 1, sidmsg->sid, 0);
- //set source type to Satellite. Use orbit and E/W data
- int source = 0x8000 | (BCD2INT(sidmsg->nit.orbit) & 0x7ff) | ((int)sidmsg->nit.is_east << 11);
- static char Polarizations[] = { 'h', 'v', 'l', 'r' };
- ch->SetSatTransponderData(source, BCD2INT(sidmsg->nit.frequency)/100, Polarizations[sidmsg->nit.polarization], BCD2INT(sidmsg->nit.symbolrate), 0);
+ if(sidmsg->nit.type==0x43) { //set source type to Satellite. Use orbit and E/W data
+ int source = 0x8000 | (BCD2INT(sidmsg->nit.orbit) & 0x7ff) | ((int)sidmsg->nit.is_east << 11);
+ static char Polarizations[] = { 'h', 'v', 'l', 'r' };
+ ch->SetSatTransponderData(source, BCD2INT(sidmsg->nit.frequency)/100, Polarizations[sidmsg->nit.polarization], BCD2INT(sidmsg->nit.symbolrate)/10, 0);
+ }
+ else if(sidmsg->nit.type==0x44) { //set source type to Cable
+ ch->SetCableTransponderData(0x4000, BCD2INT(sidmsg->nit.frequency)/10, 0, BCD2INT(sidmsg->nit.symbolrate)/10, 0);
+ }
dcnt = (MAXDPIDS >= sidmsg->epid_count) ?
sidmsg->epid_count : MAXDPIDS;
memcpy(dpid, sidmsg->epid, sizeof(int)*dcnt);
tag = buf[pos+6];
tag_len = buf[pos+7];
if(tag == 0x43 && tag_len >= 11) { //satellite descriptor
+ nit->type = tag;
nit->frequency = (buf[pos+8] << 24) | (buf[pos+9]<<16) | (buf[pos+10]<<8) | buf[pos+11];
nit->orbit = (buf[pos+12] << 8) | buf[pos+13];
nit->is_east = buf[pos+14] >> 7;
nit->fec = buf[pos+18];
printf("Orbit: %08x%c\n", nit->orbit, nit->is_east ? 'E' : 'W');
return 1;
+ } else if(tag == 0x44 && tag_len >= 11) { //cable descriptor
+ nit->type = tag;
+ nit->frequency = (buf[pos+8] << 24) | (buf[pos+9]<<16) | (buf[pos+10]<<8) | buf[pos+11];
+ nit->modulation = buf[pos+14];
+ nit->symbolrate = (buf[pos+15]<<16) | (buf[pos+16]<<8) | buf[pos+17];
+ nit->fec = buf[pos+18];
+ printf("Cable: %08x\n", nit->frequency);
+ return 1;
}
pos += tag_len+2;
td_len -= tag_len+2;
coderateH = CoderateH;
return true;
}
+bool cChannel::SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH)
+{
+ source = Source;
+ frequency = Frequency;
+ modulation = Modulation;
+ srate = Srate;
+ coderateH = CoderateH;
+ return true;
+}
void cChannel::SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int Tpid)
{
vpid = Vpid;