diff --git a/src/descrambler/capmt.c b/src/descrambler/capmt.c index fc468d03..4f8be5ad 100755 --- a/src/descrambler/capmt.c +++ b/src/descrambler/capmt.c @@ -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"); } diff --git a/src/descrambler/cwc.c b/src/descrambler/cwc.c index d5641a0e..ce1688b9 100755 --- a/src/descrambler/cwc.c +++ b/src/descrambler/cwc.c @@ -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); }