Update contrib.
1 // Copyright (c) 1995-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 the License "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 // hal\tsrc\savehal.cpp
22 _LIT(KHalDataFileName, "\\system\\data\\HAL.DAT");
24 RTest test(_L("SAVEHAL"));
26 const TInt KHalProperties=HAL::EEntryDynamic|HAL::EEntryValid;
32 test.Start(_L("Get HAL data"));
35 TInt r=HAL::GetAll(nEntries, pE);
37 test.Printf(_L("%d entries\n"),nEntries);
39 const HAL::SEntry* pS=pE;
40 const HAL::SEntry* pEnd=pS+nEntries;
43 for (; pS<pEnd; ++pS, ++s)
45 if ((pS->iProperties & KHalProperties)==KHalProperties)
52 TInt nSaved=(pD-(TInt*)pE)>>1;
53 test.Printf(_L("%d entries to be saved\n"),nSaved);
55 test.Next(_L("Connect to file server"));
60 test.Next(_L("Open file"));
62 r=file.Replace(fs,KHalDataFileName,EFileWrite|EFileShareExclusive);
65 test.Next(_L("Save data"));
67 r=HAL::Get(HAL::EMachineUid, muid());
71 TPtrC8 ptr((const TUint8*)pE, nSaved*8);