CHWRMFmTx Class Reference

class CHWRMFmTx : public CBase

Base class of FM Tx Client API of HWRM

The HWRM FM Tx API provides the ability to control the device's FM radio transmitter

Inherits from

Public Member Functions
void CancelGetNextClearFrequency ()
void CancelSetNextClearFrequency ()
void ClearRadiotextData ()
void ClearRdsData ()
void DisableAutoFrequencyL ()
void DisableL ()
void EnableAutoFrequencyL ()
void EnableL ( TInt )
TInt Frequency ()
void GetFrequencyRangeL ( TFmTxFrequencyRange &)
void GetNextClearFrequency ( TRequestStatus &, TInt &)
void GetNextClearFrequencyL ( TInt &)
void GetNextClearFrequencyL ( TClearFrequencyArray &, TUint &)
void GetNextClearFrequencyL ( TRequestStatus &, TClearFrequencyArray &, TUint &)
void GetRdsData ( TFmTxRdsData &)
TBool IsAutoFrequencyEnabled ()
IMPORT_C CHWRMFmTx * NewL ( MHWRMFmTxObserver *)
IMPORT_C CHWRMFmTx * NewLC ( MHWRMFmTxObserver *)
void Release ()
void ReserveL ( TBool )
void SetFrequencyL ( TInt )
void SetNextClearFrequency ( TRequestStatus &, TInt &)
void SetNextClearFrequencyL ( TInt &)
void SetRadiotextL ( TDes &)
void SetRadiotextPlusL ( TDes &, TRtPlusContentType )
void SetRadiotextPlusL ( TDes &, TRtPlusTag )
void SetRadiotextPlusL ( TDes &, TRtPlusTag , TRtPlusTag )
void SetRdsLanguageIdL ( TRdsLanguageIdType )
void SetRdsMsL ( TBool )
void SetRdsPtyL ( TRdsProgrammeType )
void SetRdsPtynL ( TRdsProgrammeTypeName &)
TFmTxState Status ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()

Member Functions Documentation

CancelGetNextClearFrequency()

void CancelGetNextClearFrequency ( ) [pure virtual]

The CancelGetNextClearFrequency method cancels any outstanding GetNextClearFrequency requests. If no requests have been made, then this has no effect. Note that the request may complete, before it can be cancelled.

CancelSetNextClearFrequency()

void CancelSetNextClearFrequency ( ) [pure virtual]

The CancelSetNextClearFrequency method cancels any outstanding SetNextClearFrequency requests. If no requests have been made, then this has no effect. Note that the request may complete, before it can be cancelled.

ClearRadiotextData()

void ClearRadiotextData ( ) [pure virtual]

The ClearRdsData method clears any Radiotext or Radiotext+ data previously set by clients.

ClearRdsData()

void ClearRdsData ( ) [pure virtual]

The ClearRdsData method clears any RDS data previously set by clients. This does not include Radiotext or Radiotext+ data.

DisableAutoFrequencyL()

void DisableAutoFrequencyL ( ) [pure virtual]

The DisableAutoFrequency method disables the FM Tx automatic frequency tuning mode.

Exceptions
KErrInUse

if reserved by another client. KErrGeneral if there is a hardware error.

DisableL()

void DisableL ( ) [pure virtual]

The DisableL method switches the FM transmitter off. This is a synchronous method that will block the client application.

Exceptions
KErrInUse

if reserved by another client. KErrGeneral if there is a hardware error.

EnableAutoFrequencyL()

void EnableAutoFrequencyL ( ) [pure virtual]

The EnableAutoFrequency method enables the FM Tx automatic frequency tuning mode. In this mode, the transmitter will continuously scan for interference from other transmitters. When interference is detected, the FM Tx frequency will change automatically, resulting in a MHWRMFmTxObserver::FmTxFrequencyChanged indication.

Exceptions
KErrInUse

if reserved by another client. KErrNotSupported if auto frequency is unsupported KErrGeneral if there is a hardware error. KErrNotReady if FM Tx is not enabled

EnableL(TInt)

void EnableL ( TInt aFrequency = 0 ) [pure virtual]

The EnableL method switches the FM transmitter on. This is a synchronous method that will block the client application.

Exceptions
KErrInUse

if reserved by another client. KErrArgument if frequency is out of range KErrNotReady if there is a wired accessory conflict. Some accessories are mutually exclusive with FM Tx. KErrNoMemory if there is a memory allocation failure. KErrGeneral if there is a hardware error.

Parameters

TInt aFrequency = 0 The initial transmitter frequency. Defaults to the previous frequency setting in Central Repository.

Frequency()

TInt Frequency ( ) const [pure virtual]

The Frequency method queries the current FM Tx frequency

GetFrequencyRangeL(TFmTxFrequencyRange &)

void GetFrequencyRangeL ( TFmTxFrequencyRange & aFrequencyRange ) const [pure virtual]

The GetFrequencyRangeL method queries the valid FM frequency range

Exceptions
KErrInUse

if reserved by another client KErrGeneral if there is a hardware error

Parameters

TFmTxFrequencyRange & aFrequencyRange On return, min. and max. frequencies and step size of the FM range (kHz)

GetNextClearFrequency(TRequestStatus &, TInt &)

void GetNextClearFrequency ( TRequestStatus & aStatus,
TInt & aClearFrequency
) [pure virtual]

The GetNextClearFrequency method requests a new clear frequency suggestion. This results in a RSSI scan at the hardware level, starting from the frequency increment after the previous suggested clear frequency. This is an asynchronous method.

Parameters

TRequestStatus & aStatus This will be completed when a clear frequency is found
TInt & aClearFrequency The clear frequency is returned in this parameter, which is only valid when aStatus == KErrNone.

GetNextClearFrequencyL(TInt &)

void GetNextClearFrequencyL ( TInt & aClearFrequency ) [pure virtual]

The GetNextClearFrequency method requests a new clear frequency suggestion. This results in a RSSI scan at the hardware level, starting from the frequency increment after the previous suggested clear frequency. This is a synchronous method that will block the client application.

Exceptions
KErrInUse

if reserved by another client KErrNotSupported if RSSI scanning is unsupported KErrGeneral if there is a hardware error KErrNotReady if FM Tx is not enabled

Parameters

TInt & aClearFrequency On return, this is set to a new (suggested) clear frequency.

GetNextClearFrequencyL(TClearFrequencyArray &, TUint &)

void GetNextClearFrequencyL ( TClearFrequencyArray & aClearFrequencyArray,
TUint & aCount
) [pure virtual]

The GetNextClearFrequency method requests a new clear frequency suggestion. This results in a RSSI scan at the hardware level, starting from the frequency increment after the previous suggested clear frequency. This is a synchronous method that will block the client application.

Exceptions
KErrInUse

if reserved by another client KErrArgument If aCount is out of range KErrNotSupported if RSSI scanning is unsupported KErrGeneral if there is a hardware error KErrNotReady if FM Tx is not enabled

Parameters

TClearFrequencyArray & aClearFrequencyArray On return, this contains 0-KClearFrequencyArrayMax clear frequencies.
TUint & aCount The number of clear frequencies requested (1-KClearFrequencyArrayMax) On return, this is set to the actual number of clear frequencies found.

GetNextClearFrequencyL(TRequestStatus &, TClearFrequencyArray &, TUint &)

void GetNextClearFrequencyL ( TRequestStatus & aStatus,
TClearFrequencyArray & aClearFrequencyArray,
TUint & aCount
) [pure virtual]

The GetNextClearFrequency method requests a new clear frequency suggestion. This results in a RSSI scan at the hardware level, starting from the frequency increment after the previous suggested clear frequency. This is an asynchronous method.

Exceptions
KErrArgument

if aCount is out of range

Parameters

TRequestStatus & aStatus This will be completed when a clear frequency is found
TClearFrequencyArray & aClearFrequencyArray On return, this contains 0-KClearFrequencyArrayMax clear frequencies.
TUint & aCount The number of clear frequencies requested (1-KClearFrequencyArrayMax). On completion, this is set to the actual number of clear frequencies found.

GetRdsData(TFmTxRdsData &)

void GetRdsData ( TFmTxRdsData & aData ) [pure virtual]

The GetRdsData method Queries the current FM Tx RDS data. If FM Tx is enabled, then this data is being transmitted.

Parameters

TFmTxRdsData & aData The current FM Tx RDS data.

IsAutoFrequencyEnabled()

TBool IsAutoFrequencyEnabled ( ) [pure virtual]

The IsAutoFrequencyEnabled method queries whether auto frequency mode is enabled.

NewL(MHWRMFmTxObserver *)

IMPORT_C CHWRMFmTx * NewL ( MHWRMFmTxObserver * aCallback = NULL ) [static]

Two-phased constructor for implementation class. Use this method for creating a FM Tx client with callbacks.

Exceptions
KErrNotSupported

Device doesn't support FM Tx feature. KErrNoMemory if there is a memory allocation failure.

Parameters

MHWRMFmTxObserver * aCallback = NULL Pointer to callback instance (NULL if callbacks are not required).

NewLC(MHWRMFmTxObserver *)

IMPORT_C CHWRMFmTx * NewLC ( MHWRMFmTxObserver * aCallback = NULL ) [static]

Two-phased constructor for implementation class. Use this method for creating a FM Tx client with callbacks. Leaves instance on cleanup stack.

Exceptions
KErrNotSupported

Device doesn't support FM Tx feature. KErrNoMemory if there is a memory allocation failure.

Parameters

MHWRMFmTxObserver * aCallback = NULL Pointer to callback instance (NULL if callbacks are not required).

Release()

void Release ( ) [pure virtual]

Releases FM Tx resource, if it was previously reserved for this client. If this client has not reserved FM Tx, then this method does nothing.

ReserveL(TBool)

void ReserveL ( TBool aForceNoCCoeEnv ) [pure virtual]

Reserves FM Tx resource exclusively for this client. A higher priority client may cause lower priority client reservation to be temporarily suspended. If FM Tx is already reserved by a higher or equal priority application, reserving will still succeed, but reservation is immediately suspended. The suspended client will not get any notification about suspension. Any ongoing commands will be cancelled, when a client s reservation is suspended. Only reservation and status query commands may be issued, in the suspended state.

Exceptions
KErrAccessDenied

if aForceNoCCoeEnv is ETrue and client is not trusted. KErrBadHandle if aForceNoCCoeEnv is EFalse and no CCoeEnv present. KErrNotReady if trying to reserve while on background and aForceNoCCoeEnv is EFalse. KErrNoMemory if there is a memory allocation failure.

Parameters

TBool aForceNoCCoeEnv If EFalse, then reservation requires that this client is on the foreground at the time of reservation and FM Tx will be automatically released and re-reserved based on background/foreground status of the this client. This also implies that CCoeEnv::Static() != NULL is required. If ETrue, the client will not require CCoeEnv to be present nor does it automatically reserve/release FM Tx. Only trusted clients are allowed to set this flag to ETrue.

SetFrequencyL(TInt)

void SetFrequencyL ( TInt aFrequency ) [pure virtual]

The SetFrequencyL method sets the FM transmission frequency. FM Tx does not need to be enabled. This is a synchronous method that will block the client application.

Exceptions
KErrInUse

if reserved by another client KErrArgument if frequency parameter is out of range KErrGeneral if there is a hardware error

Parameters

TInt aFrequency

SetNextClearFrequency(TRequestStatus &, TInt &)

void SetNextClearFrequency ( TRequestStatus & aStatus,
TInt & aClearFrequency
) [pure virtual]

The SetNextClearFrequency method sets the FM Tx frequency to a new clear frequency suggested. This is equivalent to calling SetFrequencyL, with a result returned from GetNextClearFrequency. This is an asynchronous method.

Parameters

TRequestStatus & aStatus This will be completed when a clear frequency is found
TInt & aClearFrequency The clear frequency is returned in this parameter, which is only valid when aStatus == KErrNone.

SetNextClearFrequencyL(TInt &)

void SetNextClearFrequencyL ( TInt & aClearFrequency ) [pure virtual]

The SetNextClearFrequency method sets the FM Tx frequency to a new clear frequency suggested. This is equivalent to calling SetFrequencyL, with a result returned from GetNextClearFrequency. This is a synchronous method that will block the client application.

Exceptions
KErrInUse

if reserved by another client. KErrNotSupported if RSSI scanning is unsupported KErrGeneral if there is a hardware error. KErrNotReady if FM Tx is not enabled

Parameters

TInt & aClearFrequency On return, this is set to the new Tx frequency.

SetRadiotextL(TDes &)

void SetRadiotextL ( TDes & aText ) [pure virtual]

The SetRadiotext method sets the Radiotext to be transmitted.

Exceptions
KErrInUse

if reserved by another client. KErrNotSupported if Radiotext is unsupported KErrArgument if non-latin characters are supplied KErrGeneral if there is a hardware error. KErrNotReady if FM Tx is not enabled

Parameters

TDes & aText The new Radiotext data.

SetRadiotextPlusL(TDes &, TRtPlusContentType)

void SetRadiotextPlusL ( TDes & aText,
TRtPlusContentType aContentType
) [pure virtual]

The SetRadiotextPlus method sets the Radiotext+ to be transmitted.

Exceptions
KErrInUse

if reserved by another client. KErrNotSupported if Radiotext+ is unsupported KErrArgument if non-latin characters are supplied or if content type not valid. KErrGeneral if there is a hardware error. KErrNotReady if FM Tx is not enabled

Parameters

TDes & aText The new Radiotext+ data.
TRtPlusContentType aContentType

SetRadiotextPlusL(TDes &, TRtPlusTag)

void SetRadiotextPlusL ( TDes & aText,
TRtPlusTag aTag
) [pure virtual]

The SetRadiotextPlus method sets the Radiotext+ to be transmitted.

Exceptions
KErrInUse

if reserved by another client. KErrNotSupported if Radiotext+ is unsupported KErrArgument if non-latin characters are supplied or if RT-plus tag content not valid. KErrGeneral if there is a hardware error. KErrNotReady if FM Tx is not enabled

Parameters

TDes & aText The new Radiotext+ data.
TRtPlusTag aTag A Radiotext+ tag.

SetRadiotextPlusL(TDes &, TRtPlusTag, TRtPlusTag)

void SetRadiotextPlusL ( TDes & aText,
TRtPlusTag aTag1,
TRtPlusTag aTag2
) [pure virtual]

The SetRadiotextPlus method sets the Radiotext+ to be transmitted.

Exceptions
KErrInUse

if reserved by another client. KErrNotSupported if Radiotext+ is unsupported KErrArgument if non-latin characters are supplied or if RT-plus tag content not valid. KErrGeneral if there is a hardware error. KErrNotReady if FM Tx is not enabled

Parameters

TDes & aText The new Radiotext+ data.
TRtPlusTag aTag1
TRtPlusTag aTag2

SetRdsLanguageIdL(TRdsLanguageIdType)

void SetRdsLanguageIdL ( TRdsLanguageIdType aLanguageId ) [pure virtual]

The SetRdsLanguageId method sets the RDS language ID. Only relevant if MS flag is set to Speech.

Exceptions
KErrInUse

if reserved by another client. KErrNotSupported if RDS is unsupported KErrArgument if aLanguageId out of range KErrGeneral if there is a hardware error. KErrNotReady if FM Tx is not enabled

Parameters

TRdsLanguageIdType aLanguageId The new language ID.

SetRdsMsL(TBool)

void SetRdsMsL ( TBool aMusic ) [pure virtual]

The SetRdsMS method sets the RDS Music/Speech flag

Exceptions
KErrInUse

if reserved by another client. KErrNotSupported if RDS is unsupported KErrGeneral if there is a hardware error. KErrNotReady if FM Tx is not enabled

Parameters

TBool aMusic ETrue if transmitting music. EFalse if transmitting speech.

SetRdsPtyL(TRdsProgrammeType)

void SetRdsPtyL ( TRdsProgrammeType aPty ) [pure virtual]

The SetRdsPTY method sets the RDS Programme Type to be transmitted.

Exceptions
KErrInUse

if reserved by another client. KErrNotSupported if RDS is unsupported KErrArgument if aPty out of range KErrGeneral if there is a hardware error. KErrNotReady if FM Tx is not enabled

Parameters

TRdsProgrammeType aPty The new Programme Type

SetRdsPtynL(TRdsProgrammeTypeName &)

void SetRdsPtynL ( TRdsProgrammeTypeName & aPtyn ) [pure virtual]

The SetRdsPTYN method sets the RDS Programme Type Name to be transmitted.

Exceptions
KErrInUse

if reserved by another client. KErrNotSupported if RDS is unsupported KErrArgument if non-latin characters are supplied or programme type name too long KErrGeneral if there is a hardware error. KErrNotReady if FM Tx is not enabled

Parameters

TRdsProgrammeTypeName & aPtyn The new Programme Type Name

Status()

TFmTxState Status ( ) const [pure virtual]

This method retrieves the current FM Tx state.

MHWRMFmTxObserver