Receiving Broadcast Data

This topic gives information about how to receive the broadcast data.

Purpose

This tutorial is about creating IP filters, removing the IP filters and updating the network time.

Required Background

IP platform contains many services, so each service is an IP data stream identified by the IP address.

Introduction

For a DVB-H application, you have to receive a small number of services. So you need to filter out from a large number of IP data packets for a small number of services. This is done by asking the receiver to only send IP packets matching a specific IP address, or a small number of IP addresses. This is called filtering.

The receiver has the ability to filter network time from a DVB-H broadcast, for you to get network updated time.

Setup and Configuration Requirements

The initial step to create a filter is to obtain the IP address of desired services. Further setup is beyond the scope of this document, but some typical steps are:

  • You can setup a well-known IP address of bootstrap ESG service for an IP platform.

  • You can obtain from the bootstrap, the ESG IP address of a particular ESG service for an IP platform

  • You can obtain an ESG service from the IP address of a TV programme.

Using Receiving Broadcast Data Tutorial

The Following tasks will be covered in this tutorial:

Example



//Context: The following takes place in some method of an active object
//that implements MDvbhDataObserver (e.g. CExampleClient : public
//CActive, public MDvbhDataObserver).  Its member iReceiver is a 
//RDvbhReceiver that has previously been initialised.  Its member iAddress
//contains the IP address to filter.
//Assume that CExampleClient previously registered itself as a
//MDvbhDataObserver as in Figure 8.

TInt filterId = 0;
User::LeaveIfError(iReceiver.CreateFilter(iAddress, 
                                          filterId, 
                                          iStatus));

StoreFilterIdL(filterId , iAddress);
SetActive();

//Filter now active. For as long as it remains active, any IP data the
//receiver gets that matches the IP address will be sent to the client.

//....At some later stage, perhaps within another function:

User::LeaveIfError(iReceiver.CancelFilter(filterId));

//Filter removal initiated.  When complete, CExampleFilter::RunL will be
//called and related IP data will no longer be filtered.

//Example CExampleFilter::RunL()
void CExampleFilter::RunL()
    {
    //CreateFilter() operation has completed, which means the filter no
      //longer exists.  Check iStatus for completion code (KErrCancelled,
      //KErrNotReady, etc.) and act accordingly.  For example:
    RemoveFilterIdFromStorage(iAddress);
    }

Removing IP Filters

In order to remove an active IP filter on the receiver, call RDvbhReceiver::CancelFilter(). The instance is passed through filter ID. If it represents an active filter, then the filter is removed and its corresponding asynchronous request is completed with error reason as KErrCancelled. According to it, IP packets for that filter will no longer be sent to the client.

If the filterId does not represent an active filter, an error will be returned. As long as there exists at least one active filter on the receiver, it will be in a receiving state. When the last active filter has been removed, the receiver will move to ready state.