change the streamguard cwc_emm function.

This commit is contained in:
sangood 2014-07-25 10:02:46 +08:00 committed by Jaroslav Kysela
parent f0dcb7532d
commit a916197ecf
2 changed files with 22 additions and 5 deletions

View file

@ -1654,12 +1654,12 @@ capmt_send_request(capmt_service_t *ct, int lm)
cad.cad_length = 0x07;
cad.cad_data[5] = cce2->cce_providerid >> 8;
cad.cad_data[6] = cce2->cce_providerid & 0xff;
} else if (cce2->cce_caid == 0x4ad2) {
cad.cad_length = 0x04;
cad.cad_data[3] = cce2->cce_providerid & 0xffffff;
}else if (cce2->cce_caid >> 8 == 0x4a && cce2->cce_caid!=0x4ad2) {
cad.cad_length = 0x05;
cad.cad_data[4] = cce2->cce_providerid & 0xff;
}else if (cce2->cce_caid == 0x4ad2) {
cad.cad_length = 0x05;
cad.cad_data[4] = cce2->cce_providerid & 0xffffff;
}else
tvhlog(LOG_WARNING, "capmt", "Unknown CAID type, don't know where to put provider ID");
}

View file

@ -1856,9 +1856,26 @@ cwc_emm_nds(cwc_t *cwc, struct cs_card_data *pcard, const uint8_t *data, int len
void
cwc_emm_streamguard(cwc_t *cwc, struct cs_card_data *pcard, const uint8_t *data, int len)
{
//sangood todo
int match = 1;
//todo
tvhlog(LOG_INFO, "cwc", "cwc_emm_streamguard streamguard card data emm get,here lots of works todo...");
int match = 0;
if (data[0] == 0x87) {
if (memcmp(&data[3], &pcard->cwc_ua[4], 4) == 0) {
match = 1;
}
}
else if (data[0] == 0x86) {
int i;
for (i=0; i < pcard->cwc_num_providers; i++) {
if (memcmp(&data[40], &pcard->cwc_providers[i].sa[4], 4) == 0) {
/* if (memcmp(&data[3], &cwc->cwc_providers[i].sa[4], 1) == 0) { */
match = 1;
break;
}
}
}
if (match)
cwc_send_msg(cwc, data, len, 0, 1, 0, 0);
}