1.1 --- a/epoc32/include/bt_sock.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/bt_sock.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,9 +1,9 @@
1.4 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 // All rights reserved.
1.6 // This component and the accompanying materials are made available
1.7 -// 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
1.8 +// under the terms of "Eclipse Public License v1.0"
1.9 // which accompanies this distribution, and is available
1.10 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.12 //
1.13 // Initial Contributors:
1.14 // Nokia Corporation - initial contribution.
1.15 @@ -15,8 +15,6 @@
1.16 //
1.17 //
1.18
1.19 -
1.20 -
1.21 /**
1.22 @file
1.23 @publishedAll
1.24 @@ -26,12 +24,26 @@
1.25 #ifndef BT_SOCK_H
1.26 #define BT_SOCK_H
1.27
1.28 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
1.29 +#include <bthci.h>
1.30 +#include <bluetooth/lmoptions.h>
1.31 +#endif
1.32 +
1.33 +#include <bluetooth/btscoparams.h>
1.34 +#include <bluetooth/btbaseband.h>
1.35 +#include <btsocketoptionlevels.h>
1.36 +#include <btdevice.h>
1.37 +
1.38 #include <es_sock.h>
1.39 #include <bttypes.h>
1.40 #include <d32comm.h> // for RS232 signal names for RFCOMM
1.41 #include <bluetooth/hci/hcierrors.h>
1.42 -#include <btsecmanclient.h>
1.43 +#include <btmanclient.h>
1.44 #include <bt_subscribe.h>
1.45 +#include <btsockaddr.h>
1.46 +#include <btsecurity.h>
1.47 +#include <btbasebandpolicy.h>
1.48 +#include <btsyncbandwidth.h>
1.49
1.50
1.51
1.52 @@ -56,36 +68,7 @@
1.53 const TInt KBTMinor = 1; /*!< BT version number for minor version */
1.54 const TInt KBTBuild = 1; /*!< BT version number for build version */
1.55
1.56 -// Socket Options
1.57 -const TUint KSolBtBlog =0x1000; /*!< Logging socket option */
1.58 -const TUint KSolBtHCI =0x1010; /*!< HCI socket option */
1.59 -const TUint KSolBtLM =0x1011; /*!< Link Manager socket option */
1.60 -const TUint KSolBtL2CAP =0x1012; /*!< L2CAP socket option */
1.61 -const TUint KSolBtRFCOMM=0x1013; /*!< RFCOMM socket option */
1.62 -const TUint KSolBtAVCTP =0x1014; /*!< AVCTP socket option */
1.63 -const TUint KSolBtACL =0x1015; /*!< ACL socket option */
1.64 -/**
1.65 -Decimal Value: 4118.
1.66 -*/
1.67 -const TUint KSolBtAVDTPSignalling =0x1016;
1.68 -/**
1.69 -Decimal Value: 4119.
1.70 -*/
1.71 -const TUint KSolBtAVDTPMedia =0x1017;
1.72 -/**
1.73 -Decimal Value: 4120.
1.74 -*/
1.75 -const TUint KSolBtAVDTPReporting =0x1018;
1.76 -/**
1.77 -Decimal Value: 4121.
1.78 -*/
1.79 -const TUint KSolBtAVDTPRecovery =0x1019;
1.80 -/**
1.81 -Decimal Value: 4128.
1.82 -*/
1.83 -const TUint KSolBtAVDTPInternal =0x1020;
1.84 -const TUint KSolBtLMProxy = 0x2011; /*!< Link Manager Proxy socket option */
1.85 -const TUint KSolBtSAPBase = 0x2020; /*!< CBluetoothSAP handles SetOpt first */
1.86 +// The Socket Options are now in btsocketoptionlevels.h
1.87
1.88 const static TUint8 KSCOListenQueSize = 1; /*!< Length of SCO listening queue */
1.89
1.90 @@ -111,130 +94,6 @@
1.91 */
1.92 const static TUint16 KMinPSM = 0x1001;
1.93
1.94 -/**
1.95 -An enumeration to represent the possible levels of Man-in-the-Middle protection
1.96 -that a Bluetooth service may specify.
1.97 -*/
1.98 -enum TBluetoothMitmProtection
1.99 - {
1.100 - EMitmNotRequired = 0x0, /*!< No Man-in-the-Middle protection is required. */
1.101 - EMitmDesired = 0x1, /*!< Man-in-the-Middle protection should be used where possible. */
1.102 - EMitmRequired = 0x2 /*!< Man-in-the-Middle protection is required. */
1.103 - };
1.104 -
1.105 -NONSHARABLE_CLASS(TBTAccessRequirements)
1.106 -/** The access requirements set up by a bluetooth service.
1.107 -
1.108 -An incoming connection must satisfy these criteria before the connection may proceed.
1.109 -Not spectacularly useful for applications; mainly used by other Bluetooth libraries
1.110 -@publishedAll
1.111 -@released
1.112 -*/
1.113 - {
1.114 -public:
1.115 - IMPORT_C TBTAccessRequirements();
1.116 - IMPORT_C void SetAuthentication(TBool aPreference);
1.117 - IMPORT_C void SetAuthorisation(TBool aPreference);
1.118 - IMPORT_C void SetEncryption(TBool aPreference);
1.119 - IMPORT_C void SetDenied(TBool aPreference);
1.120 - IMPORT_C void SetAuthentication(TBluetoothMitmProtection aPreference);
1.121 - IMPORT_C TInt SetPasskeyMinLength(TUint aPasskeyMinLength);
1.122 - IMPORT_C TBool AuthenticationRequired() const;
1.123 - IMPORT_C TBool AuthorisationRequired() const;
1.124 - IMPORT_C TBool EncryptionRequired() const;
1.125 - IMPORT_C TBool Denied() const;
1.126 - IMPORT_C TUint PasskeyMinLength() const;
1.127 - IMPORT_C TBool operator==(const TBTAccessRequirements& aRequirements) const;
1.128 - IMPORT_C TBluetoothMitmProtection MitmProtection() const;
1.129 -
1.130 -private:
1.131 - TUint8 iRequirements;
1.132 - TUint iPasskeyMinLength;
1.133 -
1.134 -private:
1.135 - enum TBTServiceSecuritySettings
1.136 - {
1.137 - EAuthenticate = 0x01,
1.138 - EAuthorise = 0x02,
1.139 - EEncrypt = 0x04,
1.140 - EDenied = 0x08,
1.141 - EMitm = 0x30, // 2 bit field for MITM
1.142 - };
1.143 -
1.144 - enum TBTAccessRequirementsMitmProtection
1.145 - {
1.146 - EAccessRequirementsMitmUndefined = 0x00,
1.147 - EAccessRequirementsMitmNotRequired = 0x10,
1.148 - EAccessRequirementsMitmDesired = 0x20,
1.149 - EAccessRequirementsMitmRequired = 0x30
1.150 - };
1.151 - };
1.152 -
1.153 -NONSHARABLE_CLASS(TBTServiceSecurity)
1.154 -/** The security settings of a bluetooth service.
1.155 -
1.156 -Contains information regarding the service UID and the access requirements.
1.157 -@publishedAll
1.158 -@released
1.159 -*/
1.160 - {
1.161 -public:
1.162 - IMPORT_C TBTServiceSecurity(const TBTServiceSecurity& aService);
1.163 - IMPORT_C TBTServiceSecurity();
1.164 - IMPORT_C void SetUid(TUid aUid);
1.165 - IMPORT_C void SetAuthentication(TBool aPreference);
1.166 - IMPORT_C void SetAuthorisation(TBool aPreference);
1.167 - IMPORT_C void SetEncryption(TBool aPreference);
1.168 - IMPORT_C void SetDenied(TBool aPreference);
1.169 - IMPORT_C void SetAuthentication(TBluetoothMitmProtection aPreference);
1.170 - IMPORT_C TInt SetPasskeyMinLength(TUint aPasskeyMinLength);
1.171 - IMPORT_C TBool AuthorisationRequired() const;
1.172 - IMPORT_C TBool EncryptionRequired() const;
1.173 - IMPORT_C TBool AuthenticationRequired() const;
1.174 - IMPORT_C TBool Denied() const;
1.175 - IMPORT_C TUint PasskeyMinLength() const;
1.176 - IMPORT_C TUid Uid() const;
1.177 - IMPORT_C TBluetoothMitmProtection MitmProtection() const;
1.178 -
1.179 -private:
1.180 - TUid iUid; ///<The UID of the service. Will be used by the UI to work out the name of the service when prompting the user.
1.181 - TBTAccessRequirements iSecurityRequirements; ///<Whether the service requires authentication, authorisation, encryption or min passkey len.
1.182 - };
1.183 -
1.184 -typedef TPckgBuf<TBTServiceSecurity> TBTServiceSecurityPckg; /*!< Package definition for securty settings */
1.185 -
1.186 -NONSHARABLE_CLASS(TBTSockAddr) : public TSockAddr
1.187 -/** Bluetooth socket address
1.188 -
1.189 -Stores bluetooth device address, and security - these are common to all Bluetooth addresses
1.190 -@publishedAll
1.191 -@released
1.192 -*/
1.193 - {
1.194 -struct SBTAddrSecurity
1.195 - {
1.196 - TBTDevAddr iAddress;
1.197 - TBTServiceSecurity iSecurity;
1.198 - };
1.199 -
1.200 -public:
1.201 - IMPORT_C TBTSockAddr();
1.202 - IMPORT_C TBTSockAddr(const TSockAddr& aAddr);
1.203 - IMPORT_C TBTDevAddr BTAddr() const;
1.204 - IMPORT_C void SetBTAddr(const TBTDevAddr& aRemote);
1.205 - IMPORT_C void SetSecurity(const TBTServiceSecurity& aSecurity);
1.206 - IMPORT_C TBTServiceSecurity BTSecurity() const;
1.207 - IMPORT_C static TBTSockAddr& Cast(const TSockAddr& aAddr);
1.208 -
1.209 -protected:
1.210 - IMPORT_C TAny* EndBTSockAddrPtr() const;
1.211 -
1.212 -private:
1.213 - SBTAddrSecurity& BTAddrSecStruct() const;
1.214 - TPtr8 AddressPtr() const;
1.215 - };
1.216 -
1.217 -
1.218 const static TInt KErrBtEskError = -6999; /*!< BT ESK error code */
1.219
1.220
1.221 @@ -286,6 +145,18 @@
1.222 @internalComponent*/
1.223 const static TInt KErrL2CAPConfigAlreadyInProgress = KL2CAPErrBase - 19;/*!< L2CAP attempt to alter config whilst configuration is in progress error code*/
1.224 const static TInt KErrL2CAPNoFreeCID = KL2CAPErrBase - 21; /*!< L2CAP no more channel IDs available error code*/
1.225 +const static TInt KErrL2CAPPeerDoesNotSupportRequestedChannelMode = KL2CAPErrBase - 22; /*!< L2CAP peer doesn't support channel modes satisfying requested channel configuration. */
1.226 +const static TInt KErrL2CAPInvalidPacketSequenceNumber = KL2CAPErrBase - 23; /*!< L2CAP packet with an invalid sequence number was received */
1.227 +const static TInt KErrL2CAPInvalidAcknowledgementNumber = KL2CAPErrBase - 24; /*!< L2CAP invalid acknowledgment number was received */
1.228 +const static TInt KErrL2CAPIllegalRemoteBehavior = KL2CAPErrBase - 25; /*!< L2CAP remote broke the L2CAP specification */
1.229 +const static TInt KErrL2CAPNegotiatedDifferentModesForEachDirection = KL2CAPErrBase - 26; /*!< L2CAP different channel modes were negotiated for incoming and outgoing direction */
1.230 +const static TInt KErrL2CAPIncomingSduSegmentationError = KL2CAPErrBase - 27; /*!< L2CAP received I-Frame does not match the sequence of start, continuation, end of SDU */
1.231 +const static TInt KErrL2CAPIncomingSduTooBig = KL2CAPErrBase - 28; /*!< L2CAP received SDU size is larger than the negotiated MTU */
1.232 +const static TInt KErrL2CAPIncomingIFrameTooSmall = KL2CAPErrBase - 29; /*!< L2CAP Incoming I-Frame size is too small */
1.233 +const static TInt KErrL2CAPIncomingIFrameTooBig = KL2CAPErrBase - 30; /*!< L2CAP Incoming I-Frame information payload is larger than the negotiated MPS */
1.234 +const static TInt KErrL2CAPInvalidIncomingSFrameSize = KL2CAPErrBase - 31; /*!< L2CAP Incoming S-Frame size is incorrect */
1.235 +const static TInt KErrL2CAPAttemptToSetMinMtuGreaterThanMtu = KL2CAPErrBase - 32; /*!< L2CAP An attempt to configure minimal acceptable MTU that's larger than the preferred MTU was made */
1.236 +const static TInt KErrL2CAPAttemptToSetMinMruGreaterThanMru = KL2CAPErrBase - 33; /*!< L2CAP An attempt to configure minimal acceptable MRU that's larger than the preferred MRU was made */
1.237
1.238 // Host Resolver
1.239 const static TInt KErrHostResNoMoreResults = KErrEof; /*!< Host resolver has no more results error code */
1.240 @@ -296,99 +167,11 @@
1.241 const static TUint KHostResEir = 64; /*!< Host resolver Eir option. This is mutually exclusive with KHostResName */
1.242
1.243 // L2CAP Ioctls
1.244 -const static TInt KL2CAPEchoRequestIoctl = 0; /*!< Echo Request Ioctl name */
1.245 -const static TInt KL2CAPIncomingMTUIoctl = 1; /*!< Change incoming MTU Ioctl name */
1.246 -const static TInt KL2CAPOutgoingMTUIoctl = 2; /*!< Change outgoing MTU Ioctl name */
1.247 -const static TInt KL2CAPUpdateChannelConfigIoctl = 3;/*!< Change conguration parameters Ioctl name */
1.248 -
1.249 -
1.250 -// Link Manager Ioctls
1.251 -
1.252 -/** Link manager Ioctl codes.*/
1.253 -enum TBTLMIoctls
1.254 - {
1.255 - /** Disconnect ACL Ioctl code
1.256 - @deprecated
1.257 - */
1.258 - KLMDisconnectACLIoctl,
1.259 - /** Set Packet type Ioctl code
1.260 - @deprecated
1.261 - */
1.262 - KLMSetPacketTypeIoctl,
1.263 - /** Wait for SCO notification Ioctl code
1.264 - @internalComponent
1.265 - */
1.266 - KLMWaitForSCONotificationIoctl,
1.267 - /** One-shot baseband notification Ioctl code
1.268 - @internalComponent
1.269 - */
1.270 - KLMBasebandEventOneShotNotificationIoctl,
1.271 - /** Baseband event notification Ioctl code
1.272 - @internalComponent
1.273 - */
1.274 - KLMBasebandEventNotificationIoctl,
1.275 - /** Read Failed Contact Counter Ioctl
1.276 - @internalComponent
1.277 - */
1.278 - KLMReadFailedContactCounterIoctl,
1.279 - /** Read Link Quality Ioctl
1.280 - @internalComponent
1.281 - */
1.282 - KLMReadLinkQualityIoctl,
1.283 - /** Read RSSI Ioctl
1.284 - @internalComponent
1.285 - */
1.286 - KLMReadRssiIoctl,
1.287 - /** Read Current Transmit Power Level Ioctl
1.288 - @internalComponent
1.289 - */
1.290 - KLMReadCurrentTransmitPowerLevelIoctl,
1.291 - };
1.292 -
1.293 -
1.294 -/** Paging policy for baseband.*/
1.295 -enum TBasebandPageTimePolicy
1.296 - {
1.297 - EPagingDontCare, /*!< Don't care setting */
1.298 - EPagingNormal, /*!< Normal setting */
1.299 - EPagingBestEffort, /*!< Best effort setting */
1.300 - EPagingQuick, /*!< Quick paging setting */
1.301 - };
1.302 -
1.303 -struct TBasebandPolicyParams
1.304 -/** Baseband policy parameters.*/
1.305 - {
1.306 - TBasebandPageTimePolicy iPageTimePolicy; /*!< Page time policy */
1.307 - };
1.308 -
1.309 -struct TSetBasebandPolicy
1.310 -/** Set baseband policy.
1.311 -
1.312 -@deprecated
1.313 -@see RBTBaseband, TPhysicalLinkQuickConnectionToken
1.314 -*/
1.315 - {
1.316 - TBTDevAddr iDevAddr; /*!< Device Address */
1.317 - TBasebandPolicyParams iPolicy; /*!< Policy parameters */
1.318 - };
1.319 -
1.320 -/** Package for SetBasebandPolicy structure
1.321 -@deprecated
1.322 -*/
1.323 -typedef TPckgBuf<TSetBasebandPolicy> TSetBasebandPolicyBuf;
1.324 -
1.325 -struct TPhysicalLinkQuickConnectionToken
1.326 -/** Specifies details for faster connection.*/
1.327 - {
1.328 - TBTNamelessDevice iDevice; /*!< Nameless device */
1.329 - TBasebandPolicyParams iPolicy; /*!< New policy */
1.330 - };
1.331 -
1.332 -typedef TPckgBuf<TPhysicalLinkQuickConnectionToken> TPhysicalLinkQuickConnectionTokenBuf; /*!< Package for TPhysicalLinkQuickConnectionToken structure */
1.333 -
1.334 -#define KBasebandSlotTime 0.000625 /*!< Baseband timeslot duration (0.000625 seconds) */
1.335 -static const TUint KDefaultBasebandConnectionTimeout = 10; /*!< Default baseband connection timeout (10 seconds) */
1.336 -
1.337 +const static TInt KL2CAPEchoRequestIoctl = 0; /*!< Echo Request Ioctl name */
1.338 +const static TInt KL2CAPIncomingMTUIoctl = 1; /*!< Change incoming MTU Ioctl name */
1.339 +const static TInt KL2CAPOutgoingMTUIoctl = 2; /*!< Change outgoing MTU Ioctl name */
1.340 +const static TInt KL2CAPUpdateChannelConfigIoctl = 3; /*!< Change configuration parameters Ioctl name */
1.341 +const static TInt KL2CAPPretendIncomingSduQFull = 4; /*!< Pretend incoming SDU Queue is full - internal testing only @internalComponent */
1.342
1.343 struct TLMDisconnectACLIoctl
1.344 /**
1.345 @@ -409,52 +192,6 @@
1.346 _LIT8(KDisconnectOnePhysicalLink, "1"); /*!< Specifes one physical link should be disconnected */
1.347 _LIT8(KDisconnectAllPhysicalLinks, "A"); /*!< Specifes all physical links should be disconnected */
1.348
1.349 -
1.350 -/** Link manager options.
1.351 -@internalComponent
1.352 -*/
1.353 -enum TBTLMOptions
1.354 - {
1.355 - ELMOutboundACLSize, /*!< Outbound ACL size option */
1.356 - ELMInboundACLSize, /*!< Inbound ACL size option */
1.357 - KLMGetACLHandle, /*!< Get ACL Handle option */
1.358 - KLMGetACLLinkCount, /*!< Get ACL link count option */
1.359 - KLMGetACLLinkArray, /*!< Get ACL link array option */
1.360 - KLMSetBasebandConnectionPolicy, /*!< Set baseband connection policy option */
1.361 - KLMGetBasebandHandle, /*!< Get baseband handle option */
1.362 - EBBSubscribePhysicalLink, /*!< Subscribe physical link option */
1.363 - EBBBeginRaw, /*!< Enable raw broadcast option */
1.364 - EBBRequestRoleMaster, /*!< Request switch to master option */
1.365 - EBBRequestRoleSlave, /*!< Request switch to slave option */
1.366 - EBBCancelModeRequest, /*!< Cancel mode request option */
1.367 - EBBRequestSniff, /*!< Request sniff mode option */
1.368 - EBBRequestPark, /*!< Request park mode option */
1.369 - EBBRequestPreventRoleChange, /*!< Request to prevent a role (master / slave) switch option */
1.370 - EBBRequestAllowRoleChange, /*!< Request to allow a role (master / slave) switchoption */
1.371 - EBBRequestChangeSupportedPacketTypes, /*!< Request to cange the current supported packet types option */
1.372 - EBBEnumeratePhysicalLinks, /*!< Enumerate physical links option */
1.373 - EBBGetPhysicalLinkState, /*!< Get the physical link state option */
1.374 - EBBGetSniffInterval, /*!< Get Sniff Interval option */
1.375 - EBBRequestLinkAuthentication, /*!< Request authentication on the link */
1.376 - EBBRequestExplicitActiveMode, /*!< Explicitly request the link to go into active mode */
1.377 -
1.378 - //Allow combination of options below...
1.379 - EBBRequestPreventSniff = 0x100, /*!< Request to prevent entering sniff mode option */
1.380 - EBBRequestPreventHold = 0x200, /*!< Request to prevent entering hold mode option */
1.381 - EBBRequestPreventPark = 0x400, /*!< Request to prevent entering park mode option */
1.382 - EBBRequestPreventAllLowPowerModes =
1.383 - (EBBRequestPreventSniff |
1.384 - EBBRequestPreventHold |
1.385 - EBBRequestPreventPark), /*!< Request to prevent entering all modes option */
1.386 - EBBRequestAllowSniff = 0x800, /*!< Request to allow entering sniff mode option */
1.387 - EBBRequestAllowHold = 0x1000, /*!< Request to allow entering hold mode option */
1.388 - EBBRequestAllowPark = 0x2000, /*!< Request to allow entering park mode option */
1.389 - EBBRequestAllowAllLowPowerModes =
1.390 - (EBBRequestAllowSniff |
1.391 - EBBRequestAllowHold |
1.392 - EBBRequestAllowPark), /*!< Request to allow entering-all-modes option. */
1.393 - };
1.394 -
1.395 // HCI Ioctls
1.396 /** Add SCO connnection Ioctl
1.397 @deprecated
1.398 @@ -722,7 +459,7 @@
1.399 KL2CAPNegotiatedOutboundMTU,
1.400
1.401 KL2CAPTestConfigure,
1.402 - KL2CAPDebugFlush,
1.403 + KL2CAPDebugFlush, // not implemented anymore, just a placeholder for BC
1.404 KL2CAPVersion1_2,
1.405 KL2CAPHeapAlloc,
1.406 KL2CAPDataPlaneConfig,
1.407 @@ -733,6 +470,8 @@
1.408 that still want an optimal MTU but have their own restrictions on packet size.
1.409 */
1.410 KL2CAPOutboundMTUForBestPerformanceWithRestriction,
1.411 + KL2CAPLocalPSM, /*!< Return local PSM of the socket (only works before the socket is accepted, stack internal use only) @internalTechnology */
1.412 + KL2CAPNegotiatedChannelMode /*!< Get the negotiated L2CAP channel mode */
1.413 };
1.414
1.415 typedef TUint16 TL2CAPPort; /*!< Definition of a L2CAP port number type */
1.416 @@ -860,46 +599,6 @@
1.417 TPtr8 AddressPtr() const;
1.418 };
1.419
1.420 -
1.421 -enum TACLPort
1.422 -/** ACL port types.
1.423 -@internalComponent
1.424 -*/
1.425 - {
1.426 - EACLPortRaw = 0x00, /*!< Raw port type */
1.427 - EACLPortL2CAP = 0x01, /*!< L2CAP port type */
1.428 - EACLPortUnset = 0xFF, /*!< Unspecified ACL port type */
1.429 - };
1.430 -
1.431 -
1.432 -// SAP types for baseband
1.433 -/** ACL socket type
1.434 -@internalTechnology
1.435 -*/
1.436 -static const TUint KSockBluetoothTypeACL = KMaxTUint;
1.437 -/** Raw broadcast socket type
1.438 -@internalTechnology
1.439 -*/
1.440 -static const TUint KSockBluetoothTypeRawBroadcast = KMaxTUint-2;
1.441 -
1.442 -NONSHARABLE_CLASS(TACLSockAddr) : public TBTSockAddr
1.443 -/** ACL Socket Address.
1.444 -
1.445 -Use this class to specify a local or remote baseband connection end-point,
1.446 -This is tied to the flags field in ACL data packets
1.447 -@internalComponent
1.448 -*/
1.449 - {
1.450 -public:
1.451 - IMPORT_C TACLSockAddr();
1.452 - IMPORT_C TACLSockAddr(const TSockAddr& aSockAddr);
1.453 - IMPORT_C static TACLSockAddr& Cast(const TSockAddr& aSockAddr);
1.454 - //
1.455 - IMPORT_C TACLPort Port() const;
1.456 - IMPORT_C void SetPort(TACLPort aPort);
1.457 - };
1.458 -
1.459 -
1.460 //
1.461 // RFCOMM
1.462 //
1.463 @@ -1098,97 +797,7 @@
1.464 class CBTBasebandPropertySubscriber;
1.465
1.466 class MBasebandObserver;
1.467 -/** Array of device addresses
1.468 -@see Enumerate method
1.469 -*/
1.470 -typedef RArray<TBTDevAddr> RBTDevAddrArray;
1.471 -
1.472 -NONSHARABLE_CLASS(RBTBaseband)
1.473 -/** API useful for Bluetooth as seen from a single physical link perspective
1.474 -@internalTechnology
1.475 -@released
1.476 -*/
1.477 - {
1.478 -public:
1.479 - RBTBaseband();
1.480 - //API useful for Bluetooth as seen from a single physical link perspective
1.481 - TInt Open(RSocketServ& aSocketServ, RSocket& aSocket);
1.482 - TInt Open(RSocketServ& aSocketServ, const TBTDevAddr& aDevAddr);
1.483 - void Close();
1.484 - TInt PhysicalLinkState(TUint32& aState);
1.485 - TInt BasebandState(TUint32& aState);
1.486 - TInt PreventRoleSwitch();
1.487 - TInt AllowRoleSwitch();
1.488 - TInt RequestMasterRole();
1.489 - TInt RequestSlaveRole();
1.490 - TInt PreventLowPowerModes(TUint32 aLowPowerModes);
1.491 - TInt AllowLowPowerModes(TUint32 aLowPowerModes);
1.492 - TInt ActivateSniffRequester();
1.493 - TInt ActivateParkRequester();
1.494 - TInt CancelLowPowerModeRequester();
1.495 - TInt RequestExplicitActiveMode(TBool aActive);
1.496 - TInt RequestChangeSupportedPacketTypes(TUint16 aPacketTypes);
1.497 - //THE TWO NOTIFY METHODS BELOW MUST NOT BE CALLED CONCURRENTLY
1.498 - //Method to be used if only the next event should be notified
1.499 - void ActivateNotifierForOneShot(TBTBasebandEvent& aEventNotification,
1.500 - TRequestStatus& aStatus,
1.501 - TUint32 aEventMask);
1.502 - //Method to be used if it is intended to call it again
1.503 - //(or call CancelNextBasebandChangeEventNotifier) when it completes
1.504 - // - this sets up a continuous monitoring of events on the server.
1.505 - //Each time ActivateNotifierForOneShot is called it will either return
1.506 - //the next event in the servers notification queue or if the
1.507 - //queue is empty it will await the next event.
1.508 - void ActivateNotifierForRecall(TBTBasebandEvent& aEventNotification,
1.509 - TRequestStatus& aStatus,
1.510 - TUint32 aEventMask);
1.511 - void ReadNewPhysicalLinkMetricValue(TRequestStatus& aStatus,
1.512 - TDes8& aData,
1.513 - TBTLMIoctls aIoctl);
1.514 - void CancelPhysicalLinkMetricUpdate();
1.515 - void CancelNextBasebandChangeEventNotifier();
1.516 - TInt Authenticate();
1.517 -
1.518 - //API useful for Bluetooth as seen from a device perspective
1.519 - TInt Open(RSocketServ& aSocketServ);
1.520 - void Connect(const TBTDevAddr& aDevAddr, TRequestStatus& aStatus);
1.521 - void Connect(const TPhysicalLinkQuickConnectionToken& aToken, TRequestStatus& aStatus);
1.522 - TInt Broadcast(const TDesC8& aData); // testing broadcast writes
1.523 - TInt ReadRaw(TDes8& aData);
1.524 - TInt Enumerate(RBTDevAddrArray& aBTDevAddrArray, TUint aMaxNumber);
1.525 - void TerminatePhysicalLink(TInt aReason);
1.526 - void TerminatePhysicalLink(TInt aReason, TRequestStatus& aStatus);
1.527 - void TerminatePhysicalLink(TInt aReason, const TBTDevAddr& aDevAddr, TRequestStatus& aStatus);
1.528 - void ShutdownPhysicalLink(TRequestStatus& aStatus);
1.529 - void TerminateAllPhysicalLinks(TInt aReason);
1.530 - void TerminateAllPhysicalLinks(TInt aReason, TRequestStatus& aStatus);
1.531 - TInt SubSessionHandle() const;
1.532 -
1.533 -private:
1.534 - TInt RequestRole(TBTLMOptions aRole);
1.535 - TInt RequestEncrypt(THCIEncryptModeFlag aEnable);
1.536 - void LocalComplete(TRequestStatus& aStatus, TInt aErr);
1.537 - void SetClientPending(TRequestStatus& aStatus);
1.538 - void DoConnect(TRequestStatus& aStatus);
1.539 - TInt Enumerate(TDes8& aData);
1.540 - TInt Construct();
1.541
1.542 -private:
1.543 - TAny* iUnusedPointer;
1.544 - RSocket iSocket;
1.545 -
1.546 - TRequestStatus* iClientRequestStatus;
1.547 - TBTSockAddr iSocketAddress;
1.548 - TPhysicalLinkQuickConnectionTokenBuf iConnectToken;
1.549 - TBuf8<1> iConnectInData; // not used yet - needed tho!
1.550 - TBuf8<1> iDummySCOShutdownDescriptor;
1.551 -
1.552 - // This data padding has been added to help prevent future binary compatibility breaks
1.553 - // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
1.554 - TUint32 iPadding1;
1.555 - TUint32 iPadding2;
1.556 - };
1.557 -
1.558 NONSHARABLE_CLASS(RBTPhysicalLinkAdapter)
1.559 /** Class to enable modification of a physical link:
1.560
1.561 @@ -1745,57 +1354,10 @@
1.562 class CBTSynchronousLinkBaseband;
1.563
1.564 /**
1.565 -@publishedAll
1.566 -@released
1.567 -
1.568 -A pair of transmit and receive bandwidths for use on synchronous Bluetooth links
1.569 -*/
1.570 -NONSHARABLE_CLASS(TBTSyncBandwidth)
1.571 - {
1.572 - public:
1.573 - IMPORT_C TBTSyncBandwidth();
1.574 - IMPORT_C TBTSyncBandwidth(TUint aBandwidth);
1.575 -
1.576 - TUint32 iTransmit;
1.577 - TUint32 iReceive;
1.578 -
1.579 - private:
1.580 - // This data padding has been added to help prevent future binary compatibility breaks
1.581 - // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
1.582 - TUint32 iPadding1;
1.583 - TUint32 iPadding2;
1.584 - };
1.585 -
1.586 -/**
1.587 eSCO 64Kbit link utility constant.
1.588 */
1.589 static const TUint KBTSync64KBit = (64000 / 8);
1.590
1.591 -/**
1.592 -@internalTechnology
1.593 -Used internally to hold eSCO link parameters. Not intended for use.
1.594 -*/
1.595 -NONSHARABLE_CLASS(TBTeSCOLinkParams)
1.596 - {
1.597 - public:
1.598 - TBTeSCOLinkParams() {};
1.599 - TBTeSCOLinkParams(TUint aBandwidth, TUint16 aCoding, TUint16 aLatency, TUint8 aRetransmission);
1.600 -
1.601 - TBTSyncBandwidth iBandwidth;
1.602 - TUint16 iCoding;
1.603 - TUint16 iLatency;
1.604 - TUint8 iRetransmissionEffort;
1.605 - };
1.606 -
1.607 -enum TSCOType
1.608 -/** Bluetooth link SCO type
1.609 -@internalTechnology
1.610 -*/
1.611 - {
1.612 - ESCO=0x01, /*!< Synchronous Connection Oriented link */
1.613 - EeSCO=0x02 /*!< eSCO link */
1.614 - };
1.615 -
1.616 NONSHARABLE_CLASS(CBluetoothSynchronousLink): public CBase
1.617 /** Provides Bluetooth SCO functionality.
1.618
1.619 @@ -1980,27 +1542,33 @@
1.620 //Callback methods called by active object RunLs.
1.621 //NB These methods kill the active objects that call them
1.622 /**
1.623 + This method is for internal sub-system use only and should be not be used otherwise.
1.624 @internalTechnology
1.625 */
1.626 void HandleCreateConnectionCompleteL(TInt aErr);
1.627 /**
1.628 + This method is for internal sub-system use only and should be not be used otherwise.
1.629 @internalTechnology
1.630 */
1.631 void HandleDisconnectCompleteL(TInt aErr);
1.632 /**
1.633 + This method is for internal sub-system use only and should be not be used otherwise.
1.634 @internalTechnology
1.635 */
1.636 void HandleDisconnectAllCompleteL(TInt aErr);
1.637
1.638 /**
1.639 + This method is for internal sub-system use only and should be not be used otherwise.
1.640 @internalTechnology
1.641 */
1.642 RSocketServ& SockServer();
1.643 /**
1.644 + This method is for internal sub-system use only and should be not be used otherwise.
1.645 @internalTechnology
1.646 */
1.647 RBTBaseband& BTBaseband();
1.648 /**
1.649 + This method is for internal sub-system use only and should be not be used otherwise.
1.650 @internalTechnology
1.651 */
1.652 MBluetoothPhysicalLinksNotifier& Notifier();
1.653 @@ -2019,64 +1587,4 @@
1.654 RBTBaseband iBTBaseband;
1.655 };
1.656
1.657 -
1.658 -
1.659 -
1.660 -NONSHARABLE_CLASS(RBluetoothPowerSwitch)
1.661 -/** This is intended for controlling whether the Bluetooth hardware is switched on or not.
1.662 -
1.663 -@publishedPartner
1.664 -@deprecated
1.665 -@see HCI_v2 documentation
1.666 -*/
1.667 - {
1.668 - public:
1.669 -
1.670 - IMPORT_C RBluetoothPowerSwitch();
1.671 - IMPORT_C void RequestSwitchOn();
1.672 - IMPORT_C void RequestSwitchOff();
1.673 - };
1.674 -
1.675 -
1.676 -
1.677 -class RHCIServerSession;
1.678 -class RSocketBasedHciDirectAccess;
1.679 -
1.680 -NONSHARABLE_CLASS(RHCIDirectAccess)
1.681 -/**
1.682 -API used for licensee-specific direct HCI access
1.683 -
1.684 -This class allows vendor-specific messages to be passed through to the HCI for
1.685 -customised (licensee-specific) HCI functionality.
1.686 -
1.687 -Note: No use of this class should be required by default. It is provided to
1.688 -assist with hardware workarounds, or link policy not implemented by the
1.689 -Bluetooth stack.
1.690 -
1.691 -Do not use unless entirely familar with this API and the specific HCI in use!!!!
1.692 -
1.693 -@publishedPartner
1.694 -@released
1.695 -*/
1.696 - {
1.697 -public:
1.698 - IMPORT_C RHCIDirectAccess();
1.699 - //API used for licensee-specific direct HCI access
1.700 - IMPORT_C TInt Open();
1.701 - IMPORT_C TInt Open(RSocketServ& aSocketServ);
1.702 - IMPORT_C void Close();
1.703 -
1.704 - IMPORT_C void Ioctl(TUint aCommand, TRequestStatus &aStatus, TDes8* aDesc=NULL,TUint aLevel = KSolBtHCI);
1.705 - IMPORT_C void CancelIoctl();
1.706 -
1.707 - IMPORT_C void AsyncMessage(TUint aCommand, TRequestStatus &aStatus, TDes8* aDesc);
1.708 - IMPORT_C void CancelAsyncMessage();
1.709 -
1.710 - IMPORT_C TInt SubSessionHandle();
1.711 -private:
1.712 - RHCIServerSession* iHCIServerSession;
1.713 - RSocketBasedHciDirectAccess* iSocketAccess;
1.714 - TUint32 iReserved; // Padding for possible future "per-copy" state.
1.715 - };
1.716 -
1.717 #endif