This topic gives information about how to receive the broadcast data.
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.
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.
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:
The Following tasks will be covered in this tutorial:
//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); }
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.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.