1 // Copyright (c) 2008-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 EIRDATACODEC_H
17 #define EIRDATACODEC_H
27 The state of the EIR data, either partial or complete
29 enum TEIRDataCompleteness
35 const TUint16 KNameRecord8BitMaxLength=248;
38 Extended Inquiry Response Data Types
40 enum TExtendedInquiryResponseDataType
44 // Standard Data Types
46 EEirUUID16Partial = 0x02,
47 EEirUUID16Complete = 0x03,
48 EEirUUID32Partial = 0x04,
49 EEirUUID32Complete = 0x05,
50 EEirUUID128Partial = 0x06,
51 EEirUUID128Complete = 0x07,
52 EEirLocalNamePartial = 0x08,
53 EEirLocalNameComplete = 0x09,
54 EEirTxPowerLevel = 0x0A,
55 // OOB Tags: Not used in EIR itself
56 EEirOobClassOfDevice = 0x0D,
57 EEirOobSimplePairingHash = 0x0E,
58 EEirOobSimplePairingRandomizerR = 0x0F,
60 EEirVendorSpecific = 0xFF,
67 Extended Inquiry Response Parser Class
68 This class takes a reference from inquiry result, which could hold both local name and Extended Inquiry Response. It provides API to parse and return the local name and data for any Extended Inquiry Response tag.
70 NONSHARABLE_CLASS(TExtendedInquiryResponseDataCodec)
73 IMPORT_C TExtendedInquiryResponseDataCodec();
74 IMPORT_C explicit TExtendedInquiryResponseDataCodec(const TNameRecord& aNameRecord);
75 IMPORT_C explicit TExtendedInquiryResponseDataCodec(TNameRecord& aNameRecord);
76 IMPORT_C explicit TExtendedInquiryResponseDataCodec(const TDesC8& aDes);
77 IMPORT_C explicit TExtendedInquiryResponseDataCodec(TDes8& aDes);
78 IMPORT_C TInt GetData(TExtendedInquiryResponseDataType aDataType, TPtrC8& aDes) const;
79 IMPORT_C TExtendedInquiryResponseDataType GetNextData(TPtrC8& aDes);
80 IMPORT_C TBool IsDataTypePresent(TExtendedInquiryResponseDataType aDataType) const;
81 IMPORT_C TInt GetDeviceName(TPtrC8& aName) const;
82 IMPORT_C TInt SetDeviceName(const TPtrC8& aName, TBool iIsComplete);
83 IMPORT_C void Set(const TNameRecord& aNameRecord);
84 IMPORT_C void Set(TNameRecord& aNameRecord);
85 IMPORT_C void Set(const TDesC8& aDes);
86 IMPORT_C void Set(TDes8& aDes);
87 IMPORT_C void Copy(TDesC8& aDes);
88 IMPORT_C TInt DoSanityCheck(TDes8& aDes);
91 TUint16 ComputeSignificantLength(const TDesC8& aDes);
92 TInt NextDataType(TInt aOffs) const;
93 TBool IsValideDataType(TInt aDataType);
98 TNameRecord* iNameRecord;
105 EEirBadDescriptor = 0,
107 EEirCodecDataTooLarge = 2,
109 _LIT(KEirCodecPanicName, "ExtendedInquiryResponseCodec");
111 #endif /*EIRDATACODEC_H*/