~ubuntu-branches/ubuntu/lucid/mythtv/lucid

« back to all changes in this revision

Viewing changes to libs/libmythtv/dvbdev/dvbci.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey), Jamie Bennett, Mario Limonciello, Dave Walker (Daviey)
  • Date: 2010-03-23 19:32:33 UTC
  • mfrom: (1.1.49 upstream)
  • Revision ID: james.westby@ubuntu.com-20100323193233-5sv9djoxtlmwt3ca
Tags: 0.23.0+fixes23789-0ubuntu1
[ Jamie Bennett ]
* Fix FTBFS on armel (LP: #537714)

[ Mario Limonciello ]
* mythtv-{common,backend}.{config,templates,postinst}: (LP: #483748)
  - Simplify debconf questions by avoiding showing the generated pw
  - Don't warn about mythtv group.
  - Don't notify about running mythtv-setup.  This is optional (but
    of course encouraged!)
* Set version to include a "+" delimitter.
* Restore libfaad-dev dependency. (LP: #546552)

[ Dave Walker (Daviey) ]
* New snapshot (r23789), based from 0.23-fixes.
* debian/control:
  - mythtv-frontend set to Conflict with mythflix, as it's dropped
    upstream. (LP: #544521)
  - Remove unnecessary and potentially problematic use of Pre-Depends.
  - Set the debug package to Priority extra.
  - Change *-perl Section's from libs to perl
  - add ${shlibs:Depends} for mythtv-common Depends field
  - Minor spelling fix.
  - Fixes the long description for one of the packages, ensuring the
    description doesn't exceed 80 characters.
  - Vcs-* set to -fixes, rather than -trunk.
* debian/rules:
  - Use debconf-updatepo to update translations when required
  - Ensure license files are not included in the binary packages, except 
    for debian/copyright.
  - Fixes the permissions of certain files in the packaging.
* debian/copyright:
  - updated to reflect that mythtv is GPL-2 only.
  - inserted better licence statement and Copyright reference.
* debian/mythtv-*.templates
  - Simplified strings; removed verbosity and improved readability.
* Prevent the maintainer scripts from failing in case any questions 
  can't be displayed.
* Added holding debian/mythtv-frontend.config, mainly to appease lintian.
* debian/mythtv-frontend.menu: Changed section to Applications/Graphics.
* debian/mythtv-backend.postinst: Load debconf libraries.
* debian/source.lintian-overrides: Removes the unecessary override of the 
  binNMU warnings.
* Fix perl binding installation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
519
519
           _connected=true;
520
520
           return OK;
521
521
        // the following is a workaround for CAMs that don't quite follow the specs...
522
 
        } else {
 
522
        } else {
523
523
           for (int i = 0; i < MAX_CONNECT_RETRIES; i++) {
524
524
               dsyslog("CAM: retrying to establish connection");
525
525
               if (RecvTPDU() == T_CTC_REPLY) {
1706
1706
            {
1707
1707
                switch (*Data)
1708
1708
                {
1709
 
                    case ST_SESSION_NUMBER:         
 
1709
                    case ST_SESSION_NUMBER:
1710
1710
                        if (Length > 4)
1711
1711
                        {
1712
1712
                            int SessionId = ntohs(*(short *)&Data[2]);
1726
1726
                                esyslog("ERROR: unknown session id: %d", SessionId);
1727
1727
                        }
1728
1728
                        break;
1729
 
                    
 
1729
 
1730
1730
                    case ST_OPEN_SESSION_REQUEST:
1731
1731
                        OpenSession(Length, Data);
1732
1732
                        break;
1865
1865
int cHlCiHandler::CommHL(unsigned tag, unsigned function, struct ca_msg *msg)
1866
1866
{
1867
1867
    if (tag) {
1868
 
        msg->msg[2] = tag & 0xff;
1869
 
        msg->msg[1] = (tag & 0xff00) >> 8;
1870
 
        msg->msg[0] = (tag & 0xff0000) >> 16;
1871
 
        esyslog("Sending message=[%02x %02x %02x ]",
1872
 
                       msg->msg[0], msg->msg[1], msg->msg[2]);
 
1868
        msg->msg[2] = tag & 0xff;
 
1869
        msg->msg[1] = (tag & 0xff00) >> 8;
 
1870
        msg->msg[0] = (tag & 0xff0000) >> 16;
 
1871
        esyslog("Sending message=[%02x %02x %02x ]",
 
1872
                       msg->msg[0], msg->msg[1], msg->msg[2]);
1873
1873
    }
1874
 
    
 
1874
 
1875
1875
    return ioctl(fdCa, function, msg);
1876
1876
}
1877
1877
 
1892
1892
    struct ca_msg msg;
1893
1893
    switch(state) {
1894
1894
    case 0:
1895
 
        // Get CA_system_ids
1896
 
        /*      Enquire         */
1897
 
        if ((SendData(AOT_CA_INFO_ENQ, &msg)) < 0) {
1898
 
            esyslog("HLCI communication failed");
1899
 
        } else {
1900
 
            dbgprotocol("==> Ca Info Enquiry");
1901
 
            /*  Receive         */
1902
 
            if ((GetData(AOT_CA_INFO, &msg)) < 0) {
1903
 
                esyslog("HLCI communication failed");
1904
 
            } else {
1905
 
                printf("Debug: ");
1906
 
                for(int i = 0; i < 20; i++) {
1907
 
                    printf("%d ", msg.msg[i]);
1908
 
                }
1909
 
                printf("\n");
1910
 
                dbgprotocol("<== Ca Info");
1911
 
                int l = msg.msg[3];
1912
 
                const uint8_t *d = &msg.msg[4];
1913
 
                while (l > 1) {
1914
 
                    unsigned short id = ((unsigned short)(*d) << 8) | *(d + 1);
1915
 
                    dbgprotocol(" %04X", id);
1916
 
                    d += 2;
1917
 
                    l -= 2;
1918
 
                    if (numCaSystemIds < MAXCASYSTEMIDS) {
1919
 
                        caSystemIds[numCaSystemIds++] = id;
1920
 
                        caSystemIds[numCaSystemIds] = 0;
1921
 
                    }
1922
 
                    else
1923
 
                        esyslog("ERROR: too many CA system IDs!");
1924
 
                }
1925
 
                dbgprotocol("\n");
1926
 
            }
1927
 
            state = 1;
1928
 
            break;
1929
 
        }
 
1895
        // Get CA_system_ids
 
1896
        /*      Enquire         */
 
1897
        if ((SendData(AOT_CA_INFO_ENQ, &msg)) < 0) {
 
1898
            esyslog("HLCI communication failed");
 
1899
        } else {
 
1900
            dbgprotocol("==> Ca Info Enquiry");
 
1901
            /*  Receive         */
 
1902
            if ((GetData(AOT_CA_INFO, &msg)) < 0) {
 
1903
                esyslog("HLCI communication failed");
 
1904
            } else {
 
1905
                printf("Debug: ");
 
1906
                for(int i = 0; i < 20; i++) {
 
1907
                    printf("%d ", msg.msg[i]);
 
1908
                }
 
1909
                printf("\n");
 
1910
                dbgprotocol("<== Ca Info");
 
1911
                int l = msg.msg[3];
 
1912
                const uint8_t *d = &msg.msg[4];
 
1913
                while (l > 1) {
 
1914
                    unsigned short id = ((unsigned short)(*d) << 8) | *(d + 1);
 
1915
                    dbgprotocol(" %04X", id);
 
1916
                    d += 2;
 
1917
                    l -= 2;
 
1918
                    if (numCaSystemIds < MAXCASYSTEMIDS) {
 
1919
                        caSystemIds[numCaSystemIds++] = id;
 
1920
                        caSystemIds[numCaSystemIds] = 0;
 
1921
                    }
 
1922
                    else
 
1923
                        esyslog("ERROR: too many CA system IDs!");
 
1924
                }
 
1925
                dbgprotocol("\n");
 
1926
            }
 
1927
            state = 1;
 
1928
            break;
 
1929
        }
1930
1930
    }
1931
1931
 
1932
1932
    bool result = true;
1966
1966
 
1967
1967
    if (CaPmt.length > (256 - 4))
1968
1968
    {
1969
 
        esyslog("CA message too long");
1970
 
        return false;
 
1969
        esyslog("CA message too long");
 
1970
        return false;
1971
1971
    }
1972
1972
 
1973
1973
    memcpy(&msg.msg[4], CaPmt.capmt, CaPmt.length);
1974
1974
 
1975
1975
    if ((SendData(AOT_CA_PMT, &msg)) < 0) {
1976
 
        esyslog("HLCI communication failed");
1977
 
        return false;
 
1976
        esyslog("HLCI communication failed");
 
1977
        return false;
1978
1978
    }
1979
 
    
 
1979
 
1980
1980
    return true;
1981
1981
}
1982
1982
 
1983
1983
bool cHlCiHandler::Reset(int)
1984
1984
{
1985
1985
    if ((ioctl(fdCa, CA_RESET)) < 0) {
1986
 
        esyslog("ioctl CA_RESET failed.");
1987
 
        return false;
 
1986
        esyslog("ioctl CA_RESET failed.");
 
1987
        return false;
1988
1988
    }
1989
1989
    return true;
1990
1990
}
1992
1992
bool cHlCiHandler::NeedCaPmt(void)
1993
1993
{
1994
1994
    if(state == 1)
1995
 
        return true;
 
1995
        return true;
1996
1996
 
1997
1997
    return false;
1998
1998
}