]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add config option whether or not we sound send EMM to card server
authorAndreas Öman <andreas@lonelycoder.com>
Sun, 15 Nov 2009 21:19:06 +0000 (21:19 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Sun, 15 Nov 2009 21:19:06 +0000 (21:19 +0000)
docs/html/config_cwc.html
src/cwc.c
src/webui/static/app/cwceditor.js

index a0f31d69d2ae2ebba8709f6393b769f4de18a5b6..6140ffdafcdd10e28efee8a8e1c063a3e26233ee 100644 (file)
@@ -48,6 +48,9 @@
   <dt>DES Key
   <dd>Initial DES key.
 
+  <dt>Update Card
+  <dd>Forward Entitlement Management Messages (EMMs) to the server.
+
   <dt>Comment
   <dd>Allows the administrator to set a comment only visible in this editor.
       It does not serve any active purpose.
index eb3052adbc02f0e5afb926e13712130651a47cb5..b3bc8b6c1ec3682b2b89688ea007854225f95abb 100644 (file)
--- a/src/cwc.c
+++ b/src/cwc.c
@@ -181,6 +181,7 @@ typedef struct cwc {
   char *cwc_hostname;
   int cwc_port;
   char *cwc_id;
+  int cwc_emm;
 
   const char *cwc_errtxt;
 
@@ -487,6 +488,11 @@ cwc_decode_card_data_reply(cwc_t *cwc, uint8_t *msg, int len)
     cwc->cwc_provider_ids[i] = id;
     msg += 11;
   }
+
+  tvhlog(LOG_INFO, "cwc", "%s: Will %sforward EMMs",
+        cwc->cwc_hostname,
+        cwc->cwc_emm ? "" : "not "); 
+
   return 0;
 }
 
@@ -932,8 +938,10 @@ cwc_table_input(struct th_descrambler *td, struct th_transport *t,
     break;
 
   default:
-    /* EMM */
-    cwc_send_msg(cwc, data, len, sid);
+    if (cwc->cwc_emm) {
+      /* EMM */
+      cwc_send_msg(cwc, data, len, sid);
+    }
     break;
   }
 }
@@ -1151,7 +1159,7 @@ cwc_record_build(cwc_t *cwc)
           cwc->cwc_confedkey[0xd]);       
   
   htsmsg_add_str(e, "deskey", buf);
-
+  htsmsg_add_u32(e, "emm", cwc->cwc_emm);
   htsmsg_add_str(e, "comment", cwc->cwc_comment ?: "");
 
   return e;
@@ -1237,6 +1245,9 @@ cwc_entry_update(void *opaque, const char *id, htsmsg_t *values, int maycreate)
     memcpy(cwc->cwc_confedkey, key, 14);
   }
 
+  if(!htsmsg_get_u32(values, "emm", &u32))
+    cwc->cwc_emm = u32;
+
   cwc->cwc_reconfigure = 1;
 
   if(cwc->cwc_fd != -1)
index db507e4f51ec792c1ac39504c4cb03aaa258ef88..ac57f90fc0cabcfa0b5aae40810c76f097aefd31 100644 (file)
@@ -8,6 +8,12 @@ tvheadend.cwceditor = function() {
        width: 60
     });
 
+    var emmColumn = new Ext.grid.CheckColumn({
+       header: "Update Card",
+       dataIndex: 'emm',
+       width: 100
+    });
+
     function setMetaAttr(meta, record){
         var enabled = record.get('enabled');
         if(!enabled) return;
@@ -64,7 +70,9 @@ tvheadend.cwceditor = function() {
                return '<span class="tvh-grid-unset">Hidden</span>';
            },
            editor: new fm.TextField({allowBlank: false})
-       },{
+       },
+       emmColumn,
+       {
            header: "Comment",
            dataIndex: 'comment',
            width: 400,
@@ -77,7 +85,7 @@ tvheadend.cwceditor = function() {
     ]);
 
     var rec = Ext.data.Record.create([
-       'enabled','connected','hostname','port','username','password','deskey','comment'
+       'enabled','connected','hostname','port','username','password','deskey','emm','comment'
     ]);
 
     store = new Ext.data.JsonStore({