equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
189 EXPORT_C TInt CBTEngSettings::GetLocalName( TDes& aName ) |
189 EXPORT_C TInt CBTEngSettings::GetLocalName( TDes& aName ) |
190 { |
190 { |
191 TRACE_FUNC_ENTRY |
191 TRACE_FUNC_ENTRY |
192 aName.Zero(); |
192 aName.Zero(); |
193 TBool nameStatus = EFalse; |
193 TBool nameStatus = EFalse; |
194 TBuf<KHCILocalDeviceNameMaxLength> tmpName; |
194 TBuf<KMaxBluetoothNameLen> tmpName; |
195 |
195 |
196 TInt err = GetLocalNameModified( nameStatus ); |
196 TInt err = GetLocalNameModified( nameStatus ); |
197 |
197 |
198 if( err || nameStatus == EBTLocalNameDefault ) |
198 if( err || nameStatus == EBTLocalNameDefault ) |
199 { |
199 { |
411 } |
411 } |
412 |
412 |
413 if( !err ) |
413 if( !err ) |
414 { |
414 { |
415 // BT registry keeps the device name in UTF-8 format. |
415 // BT registry keeps the device name in UTF-8 format. |
416 TBuf8<KHCILocalDeviceNameMaxLength> utf8Name; |
416 TBuf8<KMaxBluetoothNameLen> utf8Name; |
417 if( aName.Length() == 0 ) |
417 if( aName.Length() == 0 ) |
418 { |
418 { |
419 // The error can be > 0 if there are unconverted characters. |
419 // The error can be > 0 if there are unconverted characters. |
420 err = CnvUtfConverter::ConvertToUnicodeFromUtf8( aName, |
420 err = CnvUtfConverter::ConvertToUnicodeFromUtf8( aName, |
421 localDev.DeviceName() ); |
421 localDev.DeviceName() ); |