Turn On Broadcast Receiver Tutorial

This document helps you to understand how RDvbhReceiver handles session setup and power-up, to communicate with the Broadcast Receiver hardware.

Purpose

This tutorial tells you about how to open a session and to power on the Broadcast Receiver hardware. The purpose is to end up with a session to a powered-on receiver.

Required Background

In order to open a session an RDvbhReceiver instance is created between it and the receiver.

Introduction

You may think of a RDvbhReceiver instance as a handle to the DVB-H receiver hardware resource. This resource may have many simultaneous handles and provides reference counts to keep track of and manage its simultaneous clients.

Setup and Configuration Requirements

For efficient use of RDvbhReceiver handles in general, it is recommended that you follow these guidelines:

Clients should be aware when they call methods on their instances, that there may be other RDvbhReceiver clients accessing the same shared resource. For example, if a client disables the receiver by calling RDvbhReceiver::SetDisabled() with the argument as ETrue this disables the receiver for all clients, not just for the one that made the call. So it is important that the mobile TV middleware as a whole carefully manages its RDvbhReceiver instances to avoid contention.

Using Turn On Broadcast Receiver Tutorial

The following tasks will be covered in this tutorial:

Basic Procedure To Open Session For Broadcast Reciever

The high level steps to open a session for the Broadcast Reciever are shown here:

  1. A session to the Broadcast Receiver is created by calling RDvbhReceiver::Open(). The Client is not in contact with the receiver until RDvbhReceiver::Open() is successfully called.

  2. RDvbhReceiver::Open() should normally not fail. But the error code should always be checked in case of unusual situations like the device running out of memory. In this case KErrNoMemory would be returned and the session to the Broadcast Receiver would not be opened. Clients should be prepared to accept any other system-wide error code.

    If a client calls a method on a RDvbhReceiver instance before RDvbhReceiver::Open() has been successfully called, KErrNotReady will be returned.

    Note:- You can call RDvbhReceiver::GetDvbhVersion() to retrieve the version of DVB-H hardware from the receiver, before calling RDvbhReceiver::Open().

Example



TInt result = iReceiver.Open();
if (result != KErrNone)
    {
    //Take some action.
    return HandleOpenError(result);
    };
//A communication channel to the receiver is established, so you can use it.

Basic Procedure To Power-on The Broadcast Receiver

The high level steps to power-on the Broadcast Receiver are shown here:

To receive the DVB-H broadcasts, the receiver must be powered on. Each client which requires the hardware to remain power on must call RDvbhReceiver::PowerOn().

  1. To power on, call RDvbhReceiver::PowerOn() which causes the receiver to boot hardware, if it is not already powered on. Once done, it need not be done again unless the receiver is powered down, disabled or goes into fatal error state.

  2. Once the booting sequence is successfully completed, the receiver may configure and use the DVB-H receiver.

Example



//Pre condition – iReceiver.Open() has previously been called successfully
TInt result = iReceiver.PowerOn();
if (result != KErrNone)
    {
    //Take some action.
    return HandlePowerOnFailure(result);
    }
//Post condition – the receiver is powered on