summaryrefslogtreecommitdiff
path: root/ci.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-02-09 12:45:00 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2003-02-09 12:45:00 +0100
commit05c37e5f5917837cdf776fc7c93dab4cc21a9e20 (patch)
tree208caad89e2aea72151d1652ca5dedbafba7eba1 /ci.c
parenta6a25e48bf64c47a14089ac2701017f8f51fea35 (diff)
downloadvdr-05c37e5f5917837cdf776fc7c93dab4cc21a9e20.tar.gz
vdr-05c37e5f5917837cdf776fc7c93dab4cc21a9e20.tar.bz2
Improved CAM connection initialization (workaround)
Diffstat (limited to 'ci.c')
-rw-r--r--ci.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/ci.c b/ci.c
index f99be7d4..b602219f 100644
--- a/ci.c
+++ b/ci.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: ci.c 1.4 2003/02/09 11:54:22 kls Exp $
+ * $Id: ci.c 1.5 2003/02/09 12:45:00 kls Exp $
*/
/* XXX TODO
@@ -396,6 +396,8 @@ const uint8_t *cCiTransportConnection::Data(int &Length)
return tpdu->Data(Length);
}
+#define MAX_CONNECT_RETRIES 20
+
int cCiTransportConnection::CreateConnection(void)
{
if (state == stIDLE) {
@@ -405,13 +407,14 @@ int cCiTransportConnection::CreateConnection(void)
return OK;
// the following is a workaround for CAMs that don't quite follow the specs...
else {
- dbgprotocol("*** no reaction on T_CREATE_TC - retrying\n");
- if (RecvTPDU() == T_CTC_REPLY) {
- dbgprotocol("*** received T_CTC_REPLY\n");
- RecvTPDU();
- dbgprotocol("*** done dummy RecvTPDU()\n");
- }
- return OK;
+ for (int i = 0; i < MAX_CONNECT_RETRIES; i++) {
+ dsyslog("CAM: retrying to establish connection");
+ if (RecvTPDU() == T_CTC_REPLY) {
+ dsyslog("CAM: connection established");
+ return OK;
+ }
+ }
+ return ERROR;
}
}
}