|
@@ -239,15 +239,25 @@ static int camd35_send_emm(struct ts *ts, uint16_t ca_id, uint8_t *data, uint8_t
|
239
|
239
|
if (ret <= 0) {
|
240
|
240
|
ts_LOGf("EMM | Error sending packet.\n");
|
241
|
241
|
camd35_reconnect(ts);
|
|
242
|
+ } else {
|
|
243
|
+ c->emm_count++;
|
242
|
244
|
}
|
243
|
245
|
return ret;
|
244
|
246
|
}
|
245
|
247
|
|
246
|
248
|
static void camd_do_msg(struct camd_msg *msg) {
|
|
249
|
+ struct camd35 *c = &msg->ts->camd35;
|
247
|
250
|
if (msg->type == EMM_MSG)
|
248
|
251
|
camd35_send_emm(msg->ts, msg->ca_id, msg->data, msg->data_len);
|
249
|
252
|
if (msg->type == ECM_MSG)
|
250
|
253
|
camd35_send_ecm(msg->ts, msg->ca_id, msg->service_id, msg->idx, msg->data, msg->data_len);
|
|
254
|
+
|
|
255
|
+ if (msg->ts->emm_send && c->emm_count_last_report + c->emm_count_report_interval <= time(NULL)) {
|
|
256
|
+ ts_LOGf("EMM | Send %d messages in %d seconds.\n", c->emm_count, c->emm_count_report_interval);
|
|
257
|
+ c->emm_count = 0;
|
|
258
|
+ c->emm_count_last_report = time(NULL);
|
|
259
|
+ }
|
|
260
|
+
|
251
|
261
|
camd_msg_free(&msg);
|
252
|
262
|
}
|
253
|
263
|
|