1 // Copyright (c) 1999-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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef BTDEFCOMMPORT_H__
17 #define BTDEFCOMMPORT_H__
23 #include <btmanclient.h>
26 KBTDefaultServiceSecurityNone
27 Security setting for virtual serial port - in this case no security
31 static const TUint8 KBTDefaultServiceSecurityNone = 0;
34 KBTDefaultServiceSecurityAuthenticateOnly
35 Security setting for virtual serial port
36 The virtual serial connection will apply Bluetooth authentication
40 static const TUint8 KBTDefaultServiceSecurityAuthenticateOnly = 1;
43 KBTDefaultServiceSecurityAuthenticateAndEncrypt
44 Security setting for virtual serial port
45 The virtual serial connection will apply Bluetooth authentication and encryption
49 static const TUint8 KBTDefaultServiceSecurityAuthenticateAndEncrypt = 2;
53 The maximum virtual serial port number supported
54 ie. BTCOMM::KCommHighUnit is the maximum Bluetooth serial port that can be opened
58 static const TUint8 KCommHighUnit=63;
60 NONSHARABLE_CLASS(TBTCommPortSettings)
62 Used to configure a virtual serial port. The very least that is needed to configure a virtual serial port
63 is the Bluetooth device address of the remote, and the SDP UUID to use on that device.
65 This info can then be saved by the registry and retrieved when needed.
71 IMPORT_C TBTCommPortSettings(const TDesC& aName, TUUID aUUID,TUint32 aBTCommPort, TUint8 aSecurityLevel, TBTDevAddr aBDAddr);
72 IMPORT_C TBTCommPortSettings();
73 IMPORT_C const TDesC& Name() const; ///< Returns the name of the service.
74 IMPORT_C TUUID UUID() const; ///< Returns the unique id of the service.
75 IMPORT_C TBTDevAddr BDAddr() const; ///< Returns the address of the default device associated with the service.
76 IMPORT_C TUint32 Port() const;
77 IMPORT_C TBool IsSecuritySet() const;
78 IMPORT_C TBool IsEncryptionSet() const;
79 IMPORT_C TBool IsAuthenticationOnlySet() const;
80 IMPORT_C void SetName(const TDesC& aName); ///< Sets the name of the service.
81 IMPORT_C void SetUUID(TUUID aUUID); ///< Sets the unique id of the service.
82 IMPORT_C void SetPort(TUint32 aBTCommPort);
83 IMPORT_C void SetAuthentication();
84 IMPORT_C void SetAuthenticationAndEncryption(); // enforces authentication as well
85 IMPORT_C void SetNoSecurity(); // resets the above two
86 IMPORT_C void SetBTAddr(TBTDevAddr aBDAddr); ///< Sets the address of the default device associated with the service.
88 IMPORT_C TUint8 SecurityLevel() const;
89 IMPORT_C void SetSecurityLevel(TUint8 aLevel);
91 TBuf<32> iName; // The name of the service
92 TUUID iUUID; // The UUID of the service
93 TUint32 iPort; // The port no of the virtual serial port opened by the legacy app
94 TUint8 iSecurityLevel; // for that default service (i.e 0,1,2 = none,auth,encrypt+auth)
95 TBTDevAddr iBDAddr; // The address of the default device
97 // This data padding has been added to help prevent future binary compatibility breaks
98 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
104 typedef TPckgBuf<TBTCommPortSettings> TBTCommPortSettingsPckg; /*!< Handy package to send TBTCommPortSettings over IPC*/
109 A subsession on the Bluetooth Registry server
110 This subsession allows the virtual serial ports to be updated, modified, examined etc.
115 NONSHARABLE_CLASS(RBTCommPortSettings) : public RBTManSubSession
118 IMPORT_C RBTCommPortSettings();
119 IMPORT_C TInt Open(RBTRegServ& aSession); // creates the subsession server side
120 IMPORT_C TInt Get(TBTCommPortSettings& aSettings); //synchronous
121 IMPORT_C void Modify(const TBTCommPortSettings& aSettings, TRequestStatus& aStatus); // may add if not present
122 IMPORT_C void Delete(const TBTCommPortSettings& aSettings, TRequestStatus& aStatus);
123 IMPORT_C void Close();
125 TPckgBuf<TBTCommPortSettings> iPortPckg;
127 // This data padding has been added to help prevent future binary compatibility breaks
128 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used