bluetoothengine/btaudioman/src/BTAccInfo.cpp
changeset 0 f63038272f30
child 2 0b192a3a05a4
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "BTAccInfo.h"
       
    21 
       
    22 /////////////////////////////// TAccInfo implementation /////////////////////////
       
    23 // -----------------------------------------------------------------------------
       
    24 // TAccInfo::TAccInfo
       
    25 // -----------------------------------------------------------------------------
       
    26 //
       
    27 void TAccInfo::SetBDAddress(const TBTDevAddr& aAddr)
       
    28     {
       
    29     iAddr = aAddr; 
       
    30     iSuppProfiles = 0x00;
       
    31     iConnProfiles = 0x00;
       
    32     iAudioOpenedProfiles = 0x00;
       
    33     iModel = 0x00;
       
    34     iCapturingSupport = EFalse;
       
    35     for (TInt x=0; x<iSupportedFeatures.Count(); x++)
       
    36         {
       
    37         iSupportedFeatures.At(x) = 0x00;    
       
    38         }    
       
    39     }
       
    40         
       
    41 // -----------------------------------------------------------------------------
       
    42 // TAccInfo::GetBDAddress
       
    43 // -----------------------------------------------------------------------------
       
    44 //
       
    45 const TBTDevAddr&  TAccInfo::GetBDAddress()
       
    46     {
       
    47     return iAddr;     
       
    48     }
       
    49         
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // TAccInfo::SetCapturingSupport
       
    53 // -----------------------------------------------------------------------------
       
    54 //
       
    55 void TAccInfo::SetCapturingSupport(TBool aCapturingSupport)
       
    56     {
       
    57     iCapturingSupport = aCapturingSupport;
       
    58     }
       
    59 
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // TAccInfo::GetCapturingSupport
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 TBool TAccInfo::GetCapturingSupport()
       
    66     {
       
    67     return iCapturingSupport;     
       
    68     }
       
    69 
       
    70 
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // TAccInfo::SetSuppportedProfiles
       
    74 // -----------------------------------------------------------------------------
       
    75 //
       
    76 void  TAccInfo::SetSuppportedProfiles(TUint8 aSuppProfiles)
       
    77     {
       
    78     iSuppProfiles = aSuppProfiles;     
       
    79     }
       
    80         
       
    81 // -----------------------------------------------------------------------------
       
    82 // TAccInfo::SupportedProfiles
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85 TUint8 TAccInfo::SupportedProfiles() const
       
    86     {
       
    87     return iSuppProfiles;
       
    88     }
       
    89         
       
    90 // -----------------------------------------------------------------------------
       
    91 // TAccInfo::SetConnectedProfiles
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 void TAccInfo::SetConnectedProfiles(TUint8 aConnProfiles)  
       
    95     {
       
    96     iConnProfiles = aConnProfiles;     
       
    97     }
       
    98     
       
    99 // -----------------------------------------------------------------------------
       
   100 // TAccInfo::ConnectedProfiles
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 TUint8 TAccInfo::ConnectedProfiles()  const  
       
   104     {
       
   105     return iConnProfiles;
       
   106     }
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 // TAccInfo::SetDeviceType
       
   110 // -----------------------------------------------------------------------------
       
   111 //
       
   112 void TAccInfo::SetDeviceType(TUint8 aDeviceType)
       
   113     {
       
   114     iDeviceType = aDeviceType;
       
   115     }
       
   116 
       
   117     
       
   118 // -----------------------------------------------------------------------------
       
   119 // TAccInfo::DeviceType
       
   120 // -----------------------------------------------------------------------------
       
   121 //
       
   122 TUint8 TAccInfo::DeviceType() const
       
   123     {
       
   124     return iDeviceType;        
       
   125     }    
       
   126 
       
   127 
       
   128 // -----------------------------------------------------------------------------
       
   129 // TAccInfo::SetModel
       
   130 // -----------------------------------------------------------------------------
       
   131 //
       
   132 void TAccInfo::SetModel(TUint16 aModel)
       
   133     {
       
   134     iModel = aModel;
       
   135     }
       
   136 
       
   137 
       
   138 // -----------------------------------------------------------------------------
       
   139 // TAccInfo::Model
       
   140 // -----------------------------------------------------------------------------
       
   141 //
       
   142 TUint16 TAccInfo::Model() const
       
   143     {
       
   144     return iModel;
       
   145     }
       
   146 
       
   147 // -----------------------------------------------------------------------------
       
   148 // TAccInfo::SetSupportedFeature
       
   149 // -----------------------------------------------------------------------------
       
   150 //
       
   151 void TAccInfo::SetSupportedFeature(TUint16 aSupportedFeature, TInt aPosition)
       
   152     {
       
   153     iSupportedFeatures.At(aPosition) = aSupportedFeature; 
       
   154     }
       
   155     
       
   156     
       
   157 // -----------------------------------------------------------------------------
       
   158 // TAccInfo::SupportedFeatureL
       
   159 // -----------------------------------------------------------------------------
       
   160 //    
       
   161 TUint16 TAccInfo::SupportedFeatureL(TInt aPosition)    const
       
   162     {
       
   163     if ( aPosition < iSupportedFeatures.Count() )
       
   164         {
       
   165         return iSupportedFeatures.At(aPosition);            
       
   166         }
       
   167     else
       
   168         {
       
   169         User::Leave(KErrOverflow);
       
   170         }
       
   171     return 0x00;
       
   172     }