b/lib/libdvben50221/en50221_session.c
@@ -715,13 +715,13 @@
uint8_t connection_id)
{
// check
- if (data_length < 5) {
+ if (data_length < 4) {
print(LOG_LEVEL, ERROR, 1,
"Received data with invalid length from module on slot
%02x\n",
slot_id);
return;
}
- if (data[0] != 4) {
+ if (data[0] != 3) {
print(LOG_LEVEL, ERROR, 1,
"Received data with invalid length from module on slot
%02x\n",
slot_id);
b/lib/libdvben50221/en50221_stdcam_llci.c
@@ -32,7 +32,7 @@
#include "en50221_app_tags.h"
#include "en50221_stdcam.h"
-#define LLCI_RESPONSE_TIMEOUT_MS 1000
+#define LLCI_RESPONSE_TIMEOUT_MS 10*1000
#define LLCI_POLL_DELAY_MS 100
/* resource IDs we support */
@@ -207,7 +207,16 @@
en50221_app_mmi_destroy(llci->stdcam.mmi_resource);
if (closefd)
+ {
+ // Read the buffer before closing the device to remove the
last polling answer
+ uint8_t r_slot_id;
+ uint8_t connection_id;
+ uint8_t data[4096];
+ dvbca_link_read(llci->cafd, &r_slot_id,
+ &connection_id,
+ data, sizeof(data));
close(llci->cafd);
+ }
free(llci);
}
@@ -243,9 +252,14 @@
if (llci->datetime_session_number != -1) {
time_t cur_time = time(NULL);
if (llci->datetime_response_interval && (cur_time >
llci->datetime_next_send)) {
- en50221_app_datetime_send(llci->datetime_resource,
-
llci->datetime_session_number,
- llci->datetime_dvbtime, 0);
+ if (llci->datetime_dvbtime>0)
+
en50221_app_datetime_send(llci->datetime_resource,
+
llci->datetime_session_number,
+
llci->datetime_dvbtime, -1);
+ else
+
en50221_app_datetime_send(llci->datetime_resource,
+
llci->datetime_session_number,
+ time(NULL), -1);
llci->datetime_next_send = cur_time +
llci->datetime_response_interval;
}
}
@@ -334,12 +348,14 @@
return -3;
break;
case EN50221_APP_CA_RESOURCEID:
- if (llci->stdcam.ca_session_number != -1)
- return -3;
+ // As ressources are declared when used but
not when released, limiting session is buggy...
+ // if (llci->stdcam.ca_session_number != -1)
+ // return -3;
break;
case EN50221_APP_MMI_RESOURCEID:
- if (llci->stdcam.mmi_session_number != -1)
- return -3;
+ // As ressources are declared when used but
not when released, limiting session is buggy...
+ // if (llci->stdcam.mmi_session_number !=
-1)
+ // return -3;
break;
}
@@ -377,9 +393,7 @@
break;
case S_SCALLBACK_REASON_CLOSE:
- if (resource_id == EN50221_APP_MMI_RESOURCEID) {
- llci->stdcam.mmi_session_number = -1;
- } else if (resource_id == EN50221_APP_DATETIME_RESOURCEID) {
+ if (resource_id == EN50221_APP_DATETIME_RESOURCEID) {
llci->datetime_session_number = -1;
} else if (resource_id == EN50221_APP_AI_RESOURCEID) {
llci->stdcam.ai_session_number = -1;
@@ -438,7 +452,10 @@
if (response_interval) {
llci->datetime_next_send = time(NULL) + response_interval;
}
- en50221_app_datetime_send(llci->datetime_resource, session_number,
llci->datetime_dvbtime, 0);
+ if (llci->datetime_dvbtime>0)
+ en50221_app_datetime_send(llci->datetime_resource,
session_number, llci->datetime_dvbtime, -1);
+ else
+ en50221_app_datetime_send(llci->datetime_resource,
session_number, time(NULL), -1);
return 0;
}
root@video-showroom-1:/usr/src-coexsi/dvb-apps.20110303#
root@video-showroom-1:/usr/src-coexsi/dvb-apps.20110303# hg export --git
1415:abf3b2af3520
# HG changeset patch
# User Sebastien RAILLARD <sr@coexsi.fr>
# Date 1306272533 -7200
# Node ID abf3b2af35200cd2f1e50a2746a7bab7eac4027e
# Parent 1f246cbf810416eab545824b7f9448b693e19dcc
correct some issues in libdvben50221
b/lib/libdvben50221/en50221_session.c
@@ -715,13 +715,13 @@
uint8_t connection_id)
{
// check
- if (data_length < 5) {
+ if (data_length < 4) {
print(LOG_LEVEL, ERROR, 1,
"Received data with invalid length from module on slot
%02x\n",
slot_id);
return;
}
- if (data[0] != 4) {
+ if (data[0] != 3) {
print(LOG_LEVEL, ERROR, 1,
"Received data with invalid length from module on slot
%02x\n",
slot_id);
b/lib/libdvben50221/en50221_stdcam_llci.c
@@ -32,7 +32,7 @@
#include "en50221_app_tags.h"
#include "en50221_stdcam.h"
-#define LLCI_RESPONSE_TIMEOUT_MS 1000
+#define LLCI_RESPONSE_TIMEOUT_MS 10*1000
#define LLCI_POLL_DELAY_MS 100
/* resource IDs we support */
@@ -207,7 +207,16 @@
en50221_app_mmi_destroy(llci->stdcam.mmi_resource);
if (closefd)
+ {
+ // Read the buffer before closing the device to remove the
last polling answer
+ uint8_t r_slot_id;
+ uint8_t connection_id;
+ uint8_t data[4096];
+ dvbca_link_read(llci->cafd, &r_slot_id,
+ &connection_id,
+ data, sizeof(data));
close(llci->cafd);
+ }
free(llci);