DVB CSS Protocol modules

Module: dvbcss.protocol

The dvbcss.protocol module contains classes to implement the CSS-CII, CSS-TS and CSS-WC protocols. For each protocol there are objects to represent the messages that flow across the protocols and classes that implement clients and servers for the protocols.

See Protocol server implementation details for information on how the servers are implemented.

Common types and objects

Signalling that a property is to be omitted from a message

dvbcss.protocol.OMIT object[source]

When this object is assigned to an attribute of a protocol message object this indicates that the corresponding property is not included in the JSON representation of that message (it is omitted).

Here is an example. By default nearly all properties of a freshly created CII message object are ‘OMIT’:

>>> from dvbcss.protocol.cii import CII
>>> from dvbcss.protocol import OMIT

>>> c=CII()
>>> print repr(c.contentId)
OMIT

>>> c.wcUrl = "udp://192.168.1.1:6677"
>>> print repr(c.wcUrl)
'udp://192.168.1.1:6677'

>>> c.wcUrl = OMIT
>>> print repr(c.wcUrl)
OMIT

Private data

Some protocol messages contain optional properties to carry private data.

Private data is encoded in message objects here as a list of dict objects where each has a key “type” whose value is a URI.

Each dict can contain any other keys and values you wish so long as they can be parsed by the python json module’s encoder. For example:

example_private_data = [
    { "type" : "urn:bbc.co.uk:pid", "pid":"b00291843",
      "entity":"episode"
    },
    { "type" : "tag:bbc.co.uk/programmes/clips/link-url",
      "http://www.bbc.co.uk/programmes/b1290532/"
    }
]

Exceptions

class dvbcss.protocol.client.ConnectionError[source]

Exception that is raised when it was not possible to open a connection to a server.