First public contribution.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Example implementation of RDvbhReceiver
24 #include "dvbhreceiver.h"
25 #include "dvbhreceiverbody.h"
29 EXPORT_C RDvbhReceiver::RDvbhReceiver()
30 : iBody(NULL) //Not a C-class so no free initialisation
34 EXPORT_C TInt RDvbhReceiver::GetSupportedReceiverTypes( RArray<TDvbhReceiverType>& aReceiverTypes )
36 //RBody::GetSupportedReceiverTypes is static.
37 return RBody::GetSupportedReceiverTypes(aReceiverTypes);
40 EXPORT_C TInt RDvbhReceiver::GetDriverVersion( TVersion& aVersion )
42 //RBody::GetDriverVersion is static.
43 return RBody::GetDriverVersion(aVersion);
46 EXPORT_C TInt RDvbhReceiver::Open( const TDvbhReceiverType aReceiverType )
49 TRAPD(err, OpenL( aReceiverType ));
53 EXPORT_C void RDvbhReceiver::Close()
63 ASSERT(EFalse); //Generate a panic in debug builds to help developers detect this situation.
67 EXPORT_C TInt RDvbhReceiver::PowerOn( TRequestStatus& aStatus )
71 return iBody->PowerOn(aStatus);
79 EXPORT_C void RDvbhReceiver::CancelPowerOn()
83 return iBody->CancelPowerOn();
87 ASSERT(EFalse); //Generate a panic in debug builds to help developers detect this situation.
91 EXPORT_C void RDvbhReceiver::PowerOff( TRequestStatus& aStatus )
95 iBody->PowerOff(aStatus);
99 ASSERT(EFalse); //Generate a panic in debug builds to help developers detect this situation.
103 EXPORT_C void RDvbhReceiver::CancelPowerOff()
107 iBody->CancelPowerOff();
111 ASSERT(EFalse); //Generate a panic in debug builds to help developers detect this situation.
115 EXPORT_C void RDvbhReceiver::SetDisabled( TBool aDisable, TRequestStatus& aStatus )
119 iBody->SetDisabled(aDisable, aStatus);
123 ASSERT(EFalse); //Generate a panic in debug builds to help developers detect this situation.
127 EXPORT_C void RDvbhReceiver::CancelSetDisabled()
131 iBody->CancelSetDisabled();
135 ASSERT(EFalse); //Generate a panic in debug builds to help developers detect this situation.
139 EXPORT_C TInt RDvbhReceiver::SetScanConfiguration( const TDvbhScanConfiguration& aScanConfiguration )
143 return iBody->SetScanConfiguration(aScanConfiguration);
151 EXPORT_C TInt RDvbhReceiver::GetScanConfiguration( TDvbhScanConfiguration& aScanConfiguration )
155 return iBody->GetScanConfiguration(aScanConfiguration);
163 EXPORT_C TInt RDvbhReceiver::GetDvbhVersion( TVersion& aVersion )
167 return iBody->GetDvbhVersion(aVersion);
175 EXPORT_C TInt RDvbhReceiver::GetHardwareInfo( TDvbhHardwareInfo& aHardwareInfo )
179 return iBody->GetHardwareInfo(aHardwareInfo);
187 EXPORT_C TInt RDvbhReceiver::Scan( MDvbhScanObserver& aObserver, TRequestStatus& aStatus )
191 return iBody->Scan(aObserver, aStatus);
199 EXPORT_C void RDvbhReceiver::CancelScan()
207 ASSERT(EFalse); //Generate a panic in debug builds to help developers detect this situation.
211 EXPORT_C TInt RDvbhReceiver::SetPlatform( const TDvbhNetwork& aNetwork, const TDvbhPlatform& aPlatform, TRequestStatus& aStatus )
215 return iBody->SetPlatform(aNetwork, aPlatform, aStatus);
223 EXPORT_C void RDvbhReceiver::CancelSetPlatform()
227 iBody->CancelSetPlatform();
231 ASSERT(EFalse); //Generate a panic in debug builds to help developers detect this situation.
235 EXPORT_C TInt RDvbhReceiver::CreateFilter( const TIp6Addr& aDestAddress, TInt& aFilterId, TRequestStatus& aStatus )
239 return iBody->CreateFilter(aDestAddress, aFilterId, aStatus);
247 EXPORT_C TInt RDvbhReceiver::CancelFilter( TInt aFilterId )
251 return iBody->CancelFilter(aFilterId);
259 EXPORT_C TInt RDvbhReceiver::ReceiveIPData( MDvbhDataObserver& aObserver )
263 return iBody->ReceiveIPData(aObserver);
271 EXPORT_C void RDvbhReceiver::CancelReceiveIPData()
275 iBody->CancelReceiveIPData();
279 ASSERT(EFalse); //Generate a panic in debug builds to help developers detect this situation.
283 EXPORT_C TInt RDvbhReceiver::UpdateNetworkTime( TRequestStatus& aStatus )
287 return iBody->UpdateNetworkTime(aStatus);
295 EXPORT_C void RDvbhReceiver::CancelUpdateNetworkTime()
299 iBody->CancelUpdateNetworkTime();
303 ASSERT(EFalse); //Generate a panic in debug builds to help developers detect this situation.
307 EXPORT_C TInt RDvbhReceiver::CustomCommand(
309 const TDesC8& aInputData,
310 TDes8& aOutputBuffer,
311 TRequestStatus& aStatus )
315 return iBody->CustomCommand(aCommand, aInputData, aOutputBuffer, aStatus);
323 EXPORT_C void RDvbhReceiver::CancelCustomCommand( TRequestStatus& aStatus )
327 iBody->CancelCustomCommand(aStatus);
331 ASSERT(EFalse); //Generate a panic in debug builds to help developers detect this situation.
335 EXPORT_C TInt RDvbhReceiver::CustomCommand( TInt aCommand, const TDesC8& aInputData )
339 return iBody->CustomCommand(aCommand, aInputData);
347 void RDvbhReceiver::OpenL( const TDvbhReceiverType aReceiverType )
351 iBody = new (ELeave) RBody;
353 User::LeaveIfError(iBody->Open( aReceiverType ));