1 // Copyright (c) 2001-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.
14 // $Workfile: btHeader.h $
17 // $Date: 23/01/02 13:31 $
22 #if !defined (__BTHEADER_H__)
23 #define __BTHEADER_H__
27 #include <obexheader.h> //CObexMtmHeader
28 #include <obex.h> //TObexBluetoothProtocolInfo
32 class RMsvWriteStream;
35 // Stream version -- increment by one each time the externalized data format changes
36 // for a significant release.
37 const TInt32 KBtMessageStreamVersion = 1;///<Stream version
38 const TUid KUidStreamBtHeaders = {0x1000AABC}; ///< Stream UID for the CBtHeaders object
39 _LIT(KBtTransport, "RFCOMM");
41 class CBtHeader : public CObexMtmHeader
43 Base class for OBEX object headers. Allows them to be stored and restored to and from the
56 IMPORT_C ~CBtHeader();
59 * Second-phase constructor. Calls BaseConstructL to initialise the base members
62 IMPORT_C void ConstructL();
65 * Canonical NewL factory function
68 IMPORT_C static CBtHeader* NewL();
73 * Get the BT protocol info of the recipient
75 * @return The protocol info of the recipient (NB: only one recipient is currently supported)
78 IMPORT_C virtual const TObexBluetoothProtocolInfo& BtProtocolInfo() const;
81 * Get the BT address of the recipient
83 * @return The address of the recipient (NB: only one recipient is currently supported)
86 IMPORT_C virtual TPtrC8 Addr() const;
89 * Set the BT address of the recipient. The RfComm service slot will be obtained through
90 * an SDP lookup in the server side MTM.
92 * @param aAddr the address of the recipient (NB: only one recipient is currently supported)
95 IMPORT_C virtual void SetAddrL(const TDesC8& aAddr);
97 //Called by Store/Restore--must be implelented in the base class, and must call
98 //BaseExternalizeL/BaseInternaliseL first
101 * Internaliser. Reads data in from aReadStream. Calls BaseInternalizeL() to read in the base
104 * @param aReadStream Stream to read data in from
105 * @leave KErrXXX Standard EPOC stream leave codes
108 IMPORT_C virtual void InternalizeL(RMsvReadStream& aReadStream);
111 * Externaliser. Writes data out to aWriteStream. Calls BaseExternalizeL() to write out
112 * the base data first.
114 * @param aWriteStream Stream to write data to
115 * @leave KErrXXX Standard SymbianOS stream leave codes
118 IMPORT_C virtual void ExternalizeL(RMsvWriteStream& aWriteStream) const;
123 * Default constructor, initialises the base class and sets the value of iBtProtocolInfo.iTransport
124 * as appropriate for BT
130 TObexBluetoothProtocolInfo iBtProtocolInfo; ///< Protocol info to be internalised/externalised
133 #endif //!defined (__BTHEADER_H__)