mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Improved CAM connection initialization (workaround)
This commit is contained in:
parent
a6a25e48bf
commit
05c37e5f59
19
ci.c
19
ci.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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
|
/* XXX TODO
|
||||||
@ -396,6 +396,8 @@ const uint8_t *cCiTransportConnection::Data(int &Length)
|
|||||||
return tpdu->Data(Length);
|
return tpdu->Data(Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MAX_CONNECT_RETRIES 20
|
||||||
|
|
||||||
int cCiTransportConnection::CreateConnection(void)
|
int cCiTransportConnection::CreateConnection(void)
|
||||||
{
|
{
|
||||||
if (state == stIDLE) {
|
if (state == stIDLE) {
|
||||||
@ -405,13 +407,14 @@ int cCiTransportConnection::CreateConnection(void)
|
|||||||
return OK;
|
return OK;
|
||||||
// the following is a workaround for CAMs that don't quite follow the specs...
|
// the following is a workaround for CAMs that don't quite follow the specs...
|
||||||
else {
|
else {
|
||||||
dbgprotocol("*** no reaction on T_CREATE_TC - retrying\n");
|
for (int i = 0; i < MAX_CONNECT_RETRIES; i++) {
|
||||||
if (RecvTPDU() == T_CTC_REPLY) {
|
dsyslog("CAM: retrying to establish connection");
|
||||||
dbgprotocol("*** received T_CTC_REPLY\n");
|
if (RecvTPDU() == T_CTC_REPLY) {
|
||||||
RecvTPDU();
|
dsyslog("CAM: connection established");
|
||||||
dbgprotocol("*** done dummy RecvTPDU()\n");
|
return OK;
|
||||||
}
|
}
|
||||||
return OK;
|
}
|
||||||
|
return ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user