]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
change the streamguard cwc_emm function.
authorsangood <sangood@macmini.lan>
Fri, 25 Jul 2014 02:02:46 +0000 (10:02 +0800)
committerJaroslav Kysela <perex@perex.cz>
Mon, 4 Aug 2014 17:03:57 +0000 (19:03 +0200)
src/descrambler/capmt.c
src/descrambler/cwc.c

index fc468d03225777c1f021df3347af5b7c6b3b4c72..4f8be5ad2111cedc60d36b1dee01e4562f438ba4 100755 (executable)
@@ -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");
     }
index d5641a0e42c833e000b87375a7338c755a8aa1cb..ce1688b9eeab5f9eee487edd0d4fa3864164c6b0 100755 (executable)
@@ -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);
 }