|
1 // Copyright (c) 2004-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 */ |
|
20 |
|
21 #ifndef __RBNEPSETUPCONNECTIONREQUESTCONTROL_H |
|
22 #define __RBNEPSETUPCONNECTIONREQUESTCONTROL_H |
|
23 |
|
24 #include <bttypes.h> |
|
25 #include "RBnepControl.h" |
|
26 |
|
27 NONSHARABLE_CLASS(RBnepSetupConnectionRequestControl) : public RBnepControl |
|
28 { |
|
29 typedef enum |
|
30 { |
|
31 KUUIDSizeOffset = 1, |
|
32 KUUIDSizeLength = 1, |
|
33 KUUIDOffset = 2, |
|
34 KLocalUUID = 0, |
|
35 KRemoteUUID = 1, |
|
36 KMaxSizeOfSetupRequest = KSizeOfBnepControlType + 1 + 2 * KSdpUUIDMaxLength // Type, UUID size, 2x UUIDs |
|
37 } SetupRequestConstants; |
|
38 public: |
|
39 void InitL (); |
|
40 TInt LocalRole (TUUID& aRole); |
|
41 TInt RemoteRole (TUUID& aRole); |
|
42 void SetRolesL (TUUID& aLocalRole, TUUID& aRemoteRole); |
|
43 |
|
44 private: |
|
45 TInt GetRole (TUUID& aRole, TInt aOffset); |
|
46 }; |
|
47 |
|
48 /** |
|
49 Fill in the supplied TUUID with the local role. |
|
50 @param aRole Updated to reflect the requested local role. |
|
51 In the case where an invalid UUID length has been specified in the connection |
|
52 request, aRole is set to EUnknown. |
|
53 @return Standard error codes. KErrCorrupt is returned when UUID length was invalid. |
|
54 */ |
|
55 inline TInt RBnepSetupConnectionRequestControl::LocalRole (TUUID& aRole) |
|
56 { |
|
57 return GetRole(aRole, KLocalUUID); |
|
58 } |
|
59 |
|
60 /** |
|
61 Fill in the supplied TUUID with the remote role. |
|
62 @param aRole Updated to reflect the requested local role. |
|
63 In the case where an invalid UUID length has been specified in the connection |
|
64 request, aRole is set to EUnknown. |
|
65 @return Standard error codes. KErrCorrupt is returned when UUID length was invalid. |
|
66 */ |
|
67 inline TInt RBnepSetupConnectionRequestControl::RemoteRole (TUUID& aRole) |
|
68 { |
|
69 return GetRole(aRole, KRemoteUUID); |
|
70 } |
|
71 |
|
72 |
|
73 #endif |