1 // Copyright (c) 2000-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
28 /** The UID of the SDP Server.
30 @see TBTServiceSecurity */
31 static const TUid KUidServiceSDP = {0x100095FA};
34 typedef TUint16 TSdpAttributeID;
36 // Universal Attributes
37 /** Service Record Handle. */
38 static const TSdpAttributeID KSdpAttrIdServiceRecordHandle = 0x0000;
39 /** Service ClassID List. */
40 static const TSdpAttributeID KSdpAttrIdServiceClassIDList = 0x0001;
41 /** Service Record State. */
42 static const TSdpAttributeID KSdpAttrIdServiceRecordState = 0x0002;
44 static const TSdpAttributeID KSdpAttrIdServiceID = 0x0003;
45 /** Protocol Descriptor List. */
46 static const TSdpAttributeID KSdpAttrIdProtocolDescriptorList = 0x0004;
47 /** Browse Group List. */
48 static const TSdpAttributeID KSdpAttrIdBrowseGroupList = 0x0005;
49 /** Language Base Attribute ID List. */
50 static const TSdpAttributeID KSdpAttrIdLanguageBaseAttributeIDList = 0x0006;
51 /** Service Info Time To Live. */
52 static const TSdpAttributeID KSdpAttrIdServiceInfoTimeToLive = 0x0007;
53 /** Service Availability. */
54 static const TSdpAttributeID KSdpAttrIdServiceAvailability = 0x0008;
55 /** Bluetooth Profile Descriptor List. */
56 static const TSdpAttributeID KSdpAttrIdBluetoothProfileDescriptorList = 0x0009;
57 /** Documentation URL. */
58 static const TSdpAttributeID KSdpAttrIdDocumentationURL = 0x000A;
59 /** Client Executable URL. */
60 static const TSdpAttributeID KSdpAttrIdClientExecutableURL = 0x000B;
62 static const TSdpAttributeID KSdpAttrIdIconURL = 0x000C;
63 /** Additional protocol descriptor list. */
64 static const TSdpAttributeID KSdpAttrIdAdditionalProtocolDescriptorList = 0x000D;
67 /** PAN Profile Security enforcement */
68 static const TSdpAttributeID KSdpAttrIdSecurityDescription = 0x030a;
70 /** PAN Profile, NAP access type */
71 static const TSdpAttributeID KSdpAttrIdNetAccessType = 0x030b;
73 /** PAN Profile, NAP maximum throughput of uplink network (octets/second) */
74 static const TSdpAttributeID KSdpAttrIdMaxNetAccessRate = 0x030c;
76 /** PAN Profile, NAP IPv4 Subnet */
77 static const TSdpAttributeID KSdpAttrIdIPv4Subnet = 0x030d;
79 /** PAN Profile, NAP IPv6 Subnet */
80 static const TSdpAttributeID KSdpAttrIdIPv6Subnet = 0x030e;
82 /** SupportedCapabilities */
83 static const TSdpAttributeID KSdpAttrIdSupportedCapabilities = 0x0310;
84 /** SupportedFeatures */
85 static const TSdpAttributeID KSdpAttrIdSupportedFeatures = 0x0311;
86 /** SupportedFunctions */
87 static const TSdpAttributeID KSdpAttrIdSupportedFunctions = 0x0312;
90 // Language specific attributes
92 /** Primary Language. */
93 static const TSdpAttributeID KSdpAttrIdBasePrimaryLanguage = 0x0100;
94 static const TSdpAttributeID KSdpAttrIdCharacterEncodingUTF8 = 0x006a;
98 This is an offset that should be added to the attribute ID base (contained
99 in the LanguageBaseAttributeIDList attribute). */
100 static const TInt KSdpAttrIdOffsetServiceName = 0x0000; // + Language offset
103 /** Service Description.
105 This is an offset that should be added to the attribute ID base (contained
106 in the LanguageBaseAttributeIDList attribute). */
107 static const TInt KSdpAttrIdOffsetServiceDescription = 0x0001; // + Language offset
112 This is an offset that should be added to the attribute ID base (contained
113 in the LanguageBaseAttributeIDList attribute). */
114 static const TInt KSdpAttrIdOffsetProviderName = 0x0002; // + Language offset
117 // SDP server specific attributes
118 /** Version Number List. */
119 static const TSdpAttributeID KSdpAttrIdSdpServerVersionNumberList = 0x0200;
120 /** Service Database State. */
121 static const TSdpAttributeID KSdpAttrIdSdpServerServiceDatabaseState = 0x0201;
123 static const TSdpAttributeID KSdpAttrIdSdpServerGroupID = 0x0200;
126 // Protocol UUIDs (add to these as necessary)
127 static const TInt KL2CAPUUID = 0x0100;
128 static const TInt KBnepUUID = 0x000f;
129 static const TInt KAvctpUUID = 0x0017;
130 static const TInt KAvdtpUUID = 0x0019;
131 static const TInt KObexProtocolUUID = 0x0008;
132 static const TInt KRFCommUUID = 0x0003;
134 // Service class UUIDs (add to these as necessary)
135 /** L2CAP UUID used for continuation tests*/
136 static const TUint32 KSdpContTestUUID = 0x100;
137 /** Serial Port UUID */
138 static const TInt KSerialPortUUID = 0x1101;
139 /** Dial Networking UUID */
140 static const TInt KDialUpNetworkingUUID = 0x1103;
141 /** General Networking UUID */
142 static const TInt KGenericNetworkingUUID = 0x1201;
144 static const TInt KFaxUUID = 0x1111;
145 /** Generic Telaphony UUID */
146 static const TInt KGenericTelephonyUUID = 0x1204;
148 static const TInt KObexUUID = 0x1105;
149 /** Attribute number for the Protocol Descriptor List */
150 static const TInt KProtocolDescriptorListUUID = 0x0004;
151 /** Public Browse Group UUID */
152 static const TInt KPublicBrowseGroupUUID = 0x1002;
153 /** Browse Group Descriptor Service Class UUID */
154 static const TInt KBrowseGroupDescriptorServiceClassUUID = 0x1001;
155 /** Service Discovery Server Service Class UUID */
156 static const TInt KServiceDiscoveryServerServiceClassUUID = 0x1000;
157 /** PAN Service Class UUID */
158 static const TInt KPanUUUID = 0x1115;
159 /** PAN NAP Service Class UUID */
160 static const TInt KPanNapUUID = 0x1116;
161 /** PAN GN Service Class UUID */
162 static const TInt KPanGnUUID = 0x1117;
163 /** Audio Source (service class) UUID */
164 static const TInt KAudioSourceUUID = 0x110a;
165 /** Audio Sink (service class) UUID */
166 static const TInt KAudioSinkUUID = 0x110b;
167 /** Remote control target (service class) UUID */
168 static const TInt KAVRemoteControlTargetUUID = 0x110c;
169 /** Advanced audio distribution (A2DP) (profile descriptor) UUID */
170 static const TInt KAdvancedAudioDistributionUUID = 0x110d;
171 /** Remote control (service class) UUID */
172 static const TInt KAVRemoteControlUUID = 0x110E;
173 /** Remote control controller (service class) UUID */
174 static const TInt KAVRemoteControlControllerUUID = 0x110F;
175 /** PBAP PSE Service Class UUID */
176 static const TInt KPbapPseUUID = 0x112F;
179 // Language codes, as per "ISO 639:1988 (E/F)"
181 static const TInt16 KLanguageAfar = 0x6161; // aa
183 static const TInt16 KLanguageAbkhazian = 0x6162; // ab
185 static const TInt16 KLanguageAfrikaans = 0x6166; // af
187 static const TInt16 KLanguageAmharic = 0x616D; // am
189 static const TInt16 KLanguageArabic = 0x6172; // ar
191 static const TInt16 KLanguageAssamese = 0x6173; // as
193 static const TInt16 KLanguageAymara = 0x6179; // ay
195 static const TInt16 KLanguageAzerbaijani = 0x617A; // az
197 static const TInt16 KLanguageBashkir = 0x6261; // ba
199 static const TInt16 KLanguageByelorussian = 0x6265; // be
201 static const TInt16 KLanguageBulgarian = 0x6267; // bg
203 static const TInt16 KLanguageBihari = 0x6268; // bh
205 static const TInt16 KLanguageBislama = 0x6269; // bi
207 static const TInt16 KLanguageBengali = 0x626E; // bn - also Bangala
209 static const TInt16 KLanguageTibetan = 0x626F; // bo
211 static const TInt16 KLanguageBreton = 0x6272; // br
213 static const TInt16 KLanguageCatalan = 0x6361; // ca
215 static const TInt16 KLanguageCorsican = 0x636F; // co
217 static const TInt16 KLanguageCzech = 0x6373; // cs
219 static const TInt16 KLanguageWelsh = 0x6379; // cy
221 static const TInt16 KLanguageDanish = 0x6461; // da
223 static const TInt16 KLanguageGerman = 0x6465; // de
225 static const TInt16 KLanguageBhutani = 0x647A; // dz
227 static const TInt16 KLanguageGreek = 0x656C; // el
229 static const TInt16 KLanguageEnglish = 0x656E; // en
231 static const TInt16 KLanguageEsperanto = 0x656F; // eo
233 static const TInt16 KLanguageSpanish = 0x6573; // es
235 static const TInt16 KLanguageEstonian = 0x6574; // et
237 static const TInt16 KLanguageBasque = 0x6575; // eu
239 static const TInt16 KLanguagePersian = 0x6661; // fa
241 static const TInt16 KLanguageFinnish = 0x6669; // fi
243 static const TInt16 KLanguageFiji = 0x666A; // fj
245 static const TInt16 KLanguageFaroese = 0x666F; // fo
247 static const TInt16 KLanguageFrench = 0x6672; // fr
249 static const TInt16 KLanguageFrisian = 0x6679; // fy
251 static const TInt16 KLanguageIrish = 0x6761; // ga
253 static const TInt16 KLanguageScotsGaelic = 0x6764; // gd
255 static const TInt16 KLanguageGalician = 0x676C; // gl
257 static const TInt16 KLanguageGuarani = 0x676E; // gn
259 static const TInt16 KLanguageGujarati = 0x6775; // gu
261 static const TInt16 KLanguageHausa = 0x6861; // ha
263 static const TInt16 KLanguageHebrew = 0x6865; // he - formerly iw
265 static const TInt16 KLanguageHindi = 0x6869; // hi
267 static const TInt16 KLanguageCroatian = 0x6872; // hr
269 static const TInt16 KLanguageHungarian = 0x6875; // hu
271 static const TInt16 KLanguageArmenian = 0x6879; // hy
273 static const TInt16 KLanguageInterlingua = 0x6961; // ia
275 static const TInt16 KLanguageIndonesian = 0x6964; // id - formerly in
277 static const TInt16 KLanguageInterlingue = 0x6965; // ie
279 static const TInt16 KLanguageInupiak = 0x696B; // ik
281 static const TInt16 KLanguageIcelandic = 0x6973; // is
283 static const TInt16 KLanguageItalian = 0x6974; // it
285 static const TInt16 KLanguageInuktitut = 0x6975; // iu
287 static const TInt16 KLanguageJapanese = 0x6A61; // ja
289 static const TInt16 KLanguageJavanese = 0x6A77; // jw
291 static const TInt16 KLanguageGeorgian = 0x6B61; // ka
293 static const TInt16 KLanguageKazakh = 0x6B6B; // kk
295 static const TInt16 KLanguageGreenlandic = 0x6B6C; // kl
297 static const TInt16 KLanguageCambodian = 0x6B6D; // km
299 static const TInt16 KLanguageKannada = 0x6B6E; // kn
301 static const TInt16 KLanguageKorean = 0x6B6F; // ko
303 static const TInt16 KLanguageKashmiri = 0x6B73; // ks
305 static const TInt16 KLanguageKurdish = 0x6B75; // ku
307 static const TInt16 KLanguageKirghiz = 0x6B79; // ky
309 static const TInt16 KLanguageLatin = 0x6C61; // la
311 static const TInt16 KLanguageLingala = 0x6C6E; // ln
313 static const TInt16 KLanguageLaothian = 0x6C6F; // lo
315 static const TInt16 KLanguageLithuanian = 0x6C74; // lt
317 static const TInt16 KLanguageLatvian = 0x6C76; // lv - also Lettish
319 static const TInt16 KLanguageMalagasy = 0x6D67; // mg
321 static const TInt16 KLanguageMaori = 0x6D69; // mi
323 static const TInt16 KLanguageMacedonian = 0x6D6B; // mk
325 static const TInt16 KLanguageMalayalam = 0x6D6C; // ml
327 static const TInt16 KLanguageMongolian = 0x6D6E; // mn
329 static const TInt16 KLanguageMoldavian = 0x6D6F; // mo
331 static const TInt16 KLanguageMarathi = 0x6D72; // mr
333 static const TInt16 KLanguageMalay = 0x6D73; // ms
335 static const TInt16 KLanguageMaltese = 0x6D74; // mt
337 static const TInt16 KLanguageBurmese = 0x6D79; // my
339 static const TInt16 KLanguageNauru = 0x6E61; // na
341 static const TInt16 KLanguageNepali = 0x6E65; // ne
343 static const TInt16 KLanguageDutch = 0x6E6C; // nl
345 static const TInt16 KLanguageNorwegian = 0x6E6F; // no
347 static const TInt16 KLanguageOccitan = 0x6F63; // oc
349 static const TInt16 KLanguageOromo = 0x6F6D; // om - (Afan)
351 static const TInt16 KLanguageOriya = 0x6F72; // or
353 static const TInt16 KLanguagePunjabi = 0x7061; // pa
355 static const TInt16 KLanguagePolish = 0x706C; // pl
357 static const TInt16 KLanguagePashto = 0x7073; // ps
359 static const TInt16 KLanguagePortuguese = 0x7074; // pt
361 static const TInt16 KLanguageQuechua = 0x7175; // qu
362 /** Rhaeto Romance */
363 static const TInt16 KLanguageRhaetoRomance = 0x726D; // rm
365 static const TInt16 KLanguageKirundi = 0x726E; // rn
367 static const TInt16 KLanguageRomanian = 0x726F; // ro
369 static const TInt16 KLanguageRussian = 0x7275; // ru
371 static const TInt16 KLanguageKinyarwanda = 0x7277; // rw
373 static const TInt16 KLanguageSanskrit = 0x7361; // sa
375 static const TInt16 KLanguageSindhi = 0x7364; // sd
377 static const TInt16 KLanguageSangho = 0x7367; // sg
379 static const TInt16 KLanguageSerboCroatian = 0x7368; // sh
381 static const TInt16 KLanguageSinhalese = 0x7369; // si
383 static const TInt16 KLanguageSlovak = 0x736B; // sk
385 static const TInt16 KLanguageSlovenian = 0x736C; // sl
387 static const TInt16 KLanguageSamoan = 0x736D; // sm
389 static const TInt16 KLanguageShona = 0x736E; // sn
391 static const TInt16 KLanguageSomali = 0x736F; // so
393 static const TInt16 KLanguageAlbanian = 0x7371; // sq
395 static const TInt16 KLanguageSerbian = 0x7372; // sr
397 static const TInt16 KLanguageSiswati = 0x7373; // ss
399 static const TInt16 KLanguageSesotho = 0x7374; // st
401 static const TInt16 KLanguageSundanese = 0x7375; // su
403 static const TInt16 KLanguageSwedish = 0x7376; // sv
405 static const TInt16 KLanguageSwahili = 0x7377; // sw
407 static const TInt16 KLanguageTamil = 0x7461; // ta
409 static const TInt16 KLanguageTelugu = 0x7465; // te
411 static const TInt16 KLanguageTajik = 0x7467; // tg
413 static const TInt16 KLanguageThai = 0x7468; // th
415 static const TInt16 KLanguageTigrinya = 0x7469; // ti
417 static const TInt16 KLanguageTurkmen = 0x746B; // tk
419 static const TInt16 KLanguageTagalog = 0x746C; // tl
421 static const TInt16 KLanguageSetswana = 0x746E; // tn
423 static const TInt16 KLanguageTonga = 0x746F; // to
425 static const TInt16 KLanguageTurkish = 0x7472; // tr
427 static const TInt16 KLanguageTsonga = 0x7473; // ts
429 static const TInt16 KLanguageTatar = 0x7474; // tt
431 static const TInt16 KLanguageTwi = 0x7477; // tw
433 static const TInt16 KLanguageUighur = 0x7567; // ug
435 static const TInt16 KLanguageUkrainian = 0x756B; // uk
437 static const TInt16 KLanguageUrdu = 0x7572; // ur
439 static const TInt16 KLanguageUzbek = 0x757A; // uz
441 static const TInt16 KLanguageVietnamese = 0x7669; // vi
443 static const TInt16 KLanguageVolapuk = 0x766F; // vo
445 static const TInt16 KLanguageWolof = 0x776F; // wo
447 static const TInt16 KLanguageXhosa = 0x7868; // xh
449 static const TInt16 KLanguageYiddish = 0x7969; // yi - formerly ji
451 static const TInt16 KLanguageYoruba = 0x796F; // yo
453 static const TInt16 KLanguageZhuang = 0x7A61; // za
455 static const TInt16 KLanguageChinese = 0x7A68; // zh
457 static const TInt16 KLanguageZulu = 0x7A75; // zu
459 //***********************************************************************/
461 // SDP database server API
463 //***********************************************************************/
465 /** Typedef for a TSdpAttributeID package buf */
466 typedef TPckgBuf<TSdpAttributeID> TSdpAttributeIDPckgBuf;
467 /** Handle to a service record. */
468 typedef TUint32 TSdpServRecordHandle;
469 /** Typedef for a TSdpServRecordHandle package buf */
470 typedef TPckgBuf<TSdpServRecordHandle> TSdpServRecordHandlePckgBuf;
472 NONSHARABLE_CLASS(RSdp) : public RSessionBase
473 /** Provides a session to the Service Discovery Database.
475 Used to create subsessions to database functionality. A clients must create
476 and connect a session, before using a RSdpDatabase subsession to access the
483 IMPORT_C TInt Connect();
484 IMPORT_C TVersion Version() const;
485 IMPORT_C void ResourceCountMarkStart();
486 IMPORT_C void ResourceCountMarkEnd();
487 IMPORT_C TInt ResourceCount();
488 IMPORT_C TInt __DbgMarkHeap();
489 IMPORT_C TInt __DbgCheckHeap(TInt aCount);
490 IMPORT_C TInt __DbgMarkEnd(TInt aCount);
491 IMPORT_C TInt __DbgFailNext(TInt aCount);
494 // This data padding has been added to help prevent future binary compatibility breaks
495 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
500 NONSHARABLE_CLASS(RSdpSubSession) : public RSubSessionBase
501 /** Base class used in the derivation of RSdpDatabase.
503 The class contains basic subssession functionality. It has no user accessible
507 /** Opens subsession on an RSdp session
508 @param aSession The session on which the subsession is being opened.
510 IMPORT_C virtual TInt Open(RSdp& aSession)=0;
511 /** Closes subsession */
512 IMPORT_C virtual void Close()=0;
515 // This data padding has been added to help prevent future binary compatibility breaks
516 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
523 class CSdpAttrValueDES;
526 NONSHARABLE_CLASS(RSdpDatabase) : public RSdpSubSession
527 /** Subsession to the SDP through which service records and their attributes can
528 be added, deleted, and updated. */
531 IMPORT_C RSdpDatabase();
532 IMPORT_C TInt Open(RSdp& aSession);
533 IMPORT_C void Close();
534 IMPORT_C void CreateServiceRecordL(const TUUID& aUUID, TSdpServRecordHandle& aHandle);
535 IMPORT_C void CreateServiceRecordL(CSdpAttrValueDES& aUUIDList, TSdpServRecordHandle& aHandle);
536 IMPORT_C void UpdateAttributeL(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID, CSdpAttrValue& aAttrValue);
537 IMPORT_C void UpdateAttributeL(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID, TUint aUintValue);
538 IMPORT_C void UpdateAttributeL(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID, const TDesC16& aDesCValue);
539 IMPORT_C void UpdateAttributeL(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID, const TDesC8& aDesCValue);
540 IMPORT_C void DeleteAttributeL(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID);
541 IMPORT_C void DeleteAttribute(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID);
542 IMPORT_C void DeleteRecordL(TSdpServRecordHandle aHandle);
543 IMPORT_C void DeleteRecord(TSdpServRecordHandle aHandle);
545 HBufC8* iBuffer; //used for synchronous requests (could have been local)
547 // This data padding has been added to help prevent future binary compatibility breaks
548 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
554 class MSdpElementBuilder
555 /** Constructs an attribute value, or a set of attributes, from multiple data elements.
557 The builder interface is used for building single attribute values, and sets of attribute
558 value, attribute ID pairs, as for example in a service record.
560 In particular, the builder interface can be implemented to receive the results from
561 CSdpAgent attribute queries.
563 Each member function itself returns an MSdpElementBuilder interface that can
564 then be used to add further elements.
566 For more on the format of attribute values, see [BS1 Service Discovery Protocol
569 Note that the interface defines each function to leave with the error KErrGeneral.
571 @see CSdpAgent::AttributeRequestL() */
574 IMPORT_C virtual MSdpElementBuilder* BuildUnknownL(TUint8 aType, TUint8 aSizeDesc, const TDesC8& aData);
575 IMPORT_C virtual MSdpElementBuilder* BuildNilL();
576 IMPORT_C virtual MSdpElementBuilder* BuildUintL(const TDesC8& aUint);
577 IMPORT_C virtual MSdpElementBuilder* BuildIntL(const TDesC8& aInt);
578 IMPORT_C virtual MSdpElementBuilder* BuildUUIDL(const TUUID& aUUID);
579 IMPORT_C virtual MSdpElementBuilder* BuildBooleanL(TBool aBool);
580 IMPORT_C virtual MSdpElementBuilder* BuildStringL(const TDesC8& aString);
581 IMPORT_C virtual MSdpElementBuilder* BuildDESL(); // Must not return NULL
582 IMPORT_C virtual MSdpElementBuilder* BuildDEAL(); // ditto
583 IMPORT_C virtual MSdpElementBuilder* StartListL(); // ditto
584 IMPORT_C virtual MSdpElementBuilder* EndListL();
585 IMPORT_C virtual MSdpElementBuilder* BuildURLL(const TDesC8& aURL);
588 Returns a null aObject if the extension is not implemented, or a pointer to another interface if it is.
589 @param aInterface UID of the interface to return
590 @param aObject the container for another interface as specified by aInterface
592 IMPORT_C void MSEB_ExtensionInterfaceL(TUid aInterface, void*& aObject);
595 /** Types of attribute data elements. */
600 /** Unsigned integer. */
602 /** Signed integer. */
610 /** Data element sequence. */
612 /** Data element alternative. */
616 /** Outside SDP reserved range. */
617 ETypeEncoded = 32, // Outside SDP reserved range
620 class MSdpAttributeValueVisitor;
622 NONSHARABLE_CLASS(CSdpAttrValue) : public CBase
623 /** Base class for classes that encapsulate SDP attributes values.
625 Sub-classes of this wrap specific types of SDP service record attributes.
626 For example, CSdpBoolean derives from CSdpAttrValue to encapsulate boolean
627 attributes. The base class defines getters for all types: for example, it
628 declares a function Bool() that returns the attribute value as a TBool. Note
629 though that the function would panic unless called on actual CSdpBoolean.
631 A common base class allows attributes of all types to be used polymorphically.
632 You can use CSdpAttrValue's Type() function to find the actual type being
633 used, and upcast the pointer appropriately. */
637 virtual ~CSdpAttrValue();
640 /** Gets the attribute type.
642 @return Attribute type */
643 virtual TSdpElementType Type() const=0;
646 /** Gets the size of the attribute.
648 @return Size of the attribute in bytes */
649 virtual TUint DataSize() const=0;
653 virtual TUint Uint() const;
654 virtual TInt Int() const;
655 virtual TBool DoesIntFit() const;
656 virtual TInt Bool() const;
657 virtual const TUUID &UUID() const;
658 virtual const TPtrC8 Des() const;
660 virtual void AcceptVisitorL(MSdpAttributeValueVisitor& aVisitor);
662 IMPORT_C void Uint64(TUint64& aValue) const;
663 IMPORT_C void Uint128(TUint64& aLo, TUint64& aHi) const;
666 TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
669 /** Base class for classes that specify lists of attribute data elements.
671 It implements the MSdpElementBuilder interface to build data elements into
674 @see CSdpAttrValueDEA
675 @see CSdpAttrValueDES */
676 NONSHARABLE_CLASS(CSdpAttrValueList) : public CSdpAttrValue, public MSdpElementBuilder
679 virtual ~CSdpAttrValueList();
680 virtual void AcceptVisitorL(MSdpAttributeValueVisitor& aVisitor);
681 virtual TUint DataSize() const;
682 IMPORT_C void AppendValueL(CSdpAttrValue* aValue);
684 // MSdpElementBuilder interface
685 /** Adds an element of any type.
687 @param aType Type descriptor
688 @param aSizeDesc Size descriptor
689 @param aData Data field
690 @return Attribute value with added element */
691 virtual MSdpElementBuilder* BuildUnknownL(TUint8 aType, TUint8 aSizeDesc, const TDesC8& aData);
692 virtual MSdpElementBuilder* BuildNilL();
693 virtual MSdpElementBuilder* BuildUintL(const TDesC8& aUint);
694 virtual MSdpElementBuilder* BuildIntL(const TDesC8& aInt);
695 virtual MSdpElementBuilder* BuildUUIDL(const TUUID& aUUID);
696 virtual MSdpElementBuilder* BuildBooleanL(TBool aBool);
697 virtual MSdpElementBuilder* BuildStringL(const TDesC8& aString);
698 virtual MSdpElementBuilder* BuildDESL();
699 virtual MSdpElementBuilder* BuildDEAL();
700 virtual MSdpElementBuilder* StartListL();
701 virtual MSdpElementBuilder* EndListL();
702 virtual MSdpElementBuilder* BuildURLL(const TDesC8& aString);
703 virtual MSdpElementBuilder* BuildEncodedL(const TDesC8& aString);
706 CSdpAttrValueList(MSdpElementBuilder *aBuilder);
710 /** Array of attribute values contained in this CSdpAttrValueList class*/
711 CArrayPtr<CSdpAttrValue> *iList;
714 MSdpElementBuilder *iParent;
718 NONSHARABLE_CLASS(CSdpAttrValueNil) : public CSdpAttrValue
719 /** A null type data attribute. */
722 IMPORT_C static CSdpAttrValueNil *NewNilL();
723 virtual ~CSdpAttrValueNil();
724 virtual TSdpElementType Type() const;
725 virtual TUint DataSize() const;
731 /** Max size for an SDP Uint attribute value in bytes */
732 static const TInt KSdpMaxUintSize = 16;
734 NONSHARABLE_CLASS(CSdpAttrValueUint) : public CSdpAttrValue
735 /** A unsigned integer value of an attribute.
737 The value can be up to 128 bits in size. You need to choose to use either Uint() for up to 32 bit size,
738 Uint64() for up to 64 bit size or Uint128() for up to 128 bit size. The size can be found using DataSize().
739 If the incorrect function is used the code will panic.
743 IMPORT_C static CSdpAttrValueUint* NewUintL(const TDesC8 &aUint);
744 virtual ~CSdpAttrValueUint();
746 IMPORT_C void SetUintValue(const TDesC8& aValue);
747 virtual TSdpElementType Type() const;
748 virtual TUint DataSize() const;
750 virtual TBool DoesIntFit() const;
751 virtual const TPtrC8 Des() const;
754 TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
755 CSdpAttrValueUint(const TDesC8 & aUint);
758 TBuf8<KSdpMaxUintSize> iUint;
762 Max size for an SDP Int attribute value in bytes
763 The new value is KSdpMaxIntSize
766 static const TInt KMaxIntSize = 16;
769 Max size for an SDP Int attribute value in bytes
771 static const TInt KSdpMaxIntSize = 16;
773 NONSHARABLE_CLASS(CSdpAttrValueInt) : public CSdpAttrValue
774 /** A signed integer value of an attribute.
776 The value can be up to 128 bits in size. */
779 IMPORT_C static CSdpAttrValueInt* NewIntL(const TDesC8 &aInt);
780 virtual ~CSdpAttrValueInt();
781 virtual TSdpElementType Type() const;
782 virtual TUint DataSize() const;
783 virtual TInt Int() const;
784 virtual TBool DoesIntFit() const;
785 virtual const TPtrC8 Des() const;
788 CSdpAttrValueInt(const TDesC8 & aInt);
791 TBuf8<KSdpMaxIntSize> iInt;
795 NONSHARABLE_CLASS(CSdpAttrValueUUID) : public CSdpAttrValue
796 /** A UUID value of an attribute.
798 The value can be up to 128 bits in size. */
801 IMPORT_C static CSdpAttrValueUUID* NewUUIDL(const TUUID& aUUID);
802 virtual ~CSdpAttrValueUUID();
803 virtual TSdpElementType Type() const;
804 virtual TUint DataSize() const;
806 virtual const TUUID &UUID() const;
807 virtual const TPtrC8 Des() const;
810 CSdpAttrValueUUID(const TUUID& aUUID);
816 NONSHARABLE_CLASS(CSdpAttrValueString) : public CSdpAttrValue
817 /** A Text String value of an attribute.
819 The encoding of the string is up to the user. The interpretation of the encoding
820 is enabled using facilities in SDP. */
823 IMPORT_C static CSdpAttrValueString* NewStringL(const TDesC8& aString);
824 virtual ~CSdpAttrValueString();
825 virtual TSdpElementType Type() const;
826 virtual TUint DataSize() const;
827 virtual const TPtrC8 Des() const;
830 CSdpAttrValueString();
831 void ConstructL(const TDesC8& aString);
837 NONSHARABLE_CLASS(CSdpAttrValueBoolean) : public CSdpAttrValue
838 /** A Boolean value of an attribute. */
841 IMPORT_C static CSdpAttrValueBoolean *NewBoolL(TBool aBool);
842 virtual ~CSdpAttrValueBoolean();
843 virtual TSdpElementType Type() const;
844 virtual TUint DataSize() const;
845 virtual TBool Bool() const;
848 CSdpAttrValueBoolean(TBool aBool);
854 NONSHARABLE_CLASS(CSdpAttrValueDES) : public CSdpAttrValueList
855 /** A Data element sequence (DES) value of an attribute.
857 A DES can contain other values within it, including other sequences. This
858 enables arbitrary tree structures to be created.
860 Most of the functionality is supplied by the base class CSdpAttrValueList. */
863 IMPORT_C static CSdpAttrValueDES* NewDESL(MSdpElementBuilder* aBuilder);
864 virtual TSdpElementType Type() const;
867 CSdpAttrValueDES(MSdpElementBuilder *aBuilder);
870 NONSHARABLE_CLASS(CSdpAttrValueDEA) : public CSdpAttrValueList
871 /** A Data element alternative (DEA) value of an attribute: this is an attribute
872 whose value is a sequence of data elements from which one data element is
875 Most of the functionality is supplied by the base class CSdpAttrValueList. */
878 IMPORT_C static CSdpAttrValueDEA* NewDEAL(MSdpElementBuilder* aBuilder);
879 virtual TSdpElementType Type() const;
882 CSdpAttrValueDEA(MSdpElementBuilder *aBuilder);
885 NONSHARABLE_CLASS(CSdpAttrValueURL) : public CSdpAttrValue
886 /** A URL value of an attribute. */
889 IMPORT_C static CSdpAttrValueURL* NewURLL(const TDesC8& aString);
890 virtual ~CSdpAttrValueURL();
891 virtual TSdpElementType Type() const;
892 virtual const TPtrC8 Des() const;
893 virtual TUint DataSize() const;
897 void ConstructL(const TDesC8& aString);
903 class MSdpAttributeValueVisitor
904 /** Abstract interface that can be implemented to receive an enumeration of the
905 values in an attribute list.
907 The class member functions are called by an CSdpAttrValue (or one of its sub-classes)
908 object when CSdpAttrValue::AcceptVisitorL() is called.
912 When AcceptVisitorL() is called on attributes that are not lists (not DEA
913 or DES), only VisitAttributeValueL() is called, passing the attribute value
914 object itself (i.e. *this), and the value attribute type.
916 When AcceptVisitorL() is called on attributes that are lists (DEA or DES),
917 VisitAttributeValueL() is called for each member of the list
919 This implements the standard Visitor pattern.
921 @see CSdpAttrValue::AcceptVisitorL() */
924 /** Called to pass an attribute value.
926 @param aValue Attribute value
927 @param aType Value type */
928 virtual void VisitAttributeValueL(CSdpAttrValue &aValue, TSdpElementType aType)=0;
931 /** Called to indicate the start of a list of attribute values.
933 This call is followed by a call to VisitAttributeValueL() for each attribute
934 value in the list, and concluded by a call to EndList().
936 @param aList Attribute value list */
937 virtual void StartListL(CSdpAttrValueList &aList)=0;
940 /** Called to indicate the end of a list of attribute values. */
941 virtual void EndListL()=0;
944 Returns a null aObject if the extension is not implemented, or a pointer to another interface if it is.
945 @param aInterface UID of the interface to return
946 @param aObject the container for another interface as specified by aInterface
948 IMPORT_C virtual void MSAVV_ExtensionInterfaceL(TUid aInterface, void*& aObject);
952 /**Integer Putter/Getter Utility Class
954 Utility class for putting integer values into/getting integer values out of descriptors */
957 IMPORT_C static TUint GetUint(const TDesC8& aData);
958 IMPORT_C static void PutUint(TUint8* aPtr, TInt64 aInt, TInt aNumberOfBytes);
959 IMPORT_C static void PutUint64(TUint8* aPtr, const TUint64& aNumber);
960 IMPORT_C static void GetUint64(const TDesC8& aData, TUint64& aNumber);
961 IMPORT_C static void PutUint128(TUint8* aPtr, const TUint64& aLo, const TUint64& aHi);
962 IMPORT_C static void GetUint128(const TDesC8& aData, TUint64& aLo, TUint64& aHi);
965 /**Integer to Descriptor Convertor
967 Utility class to convert EPOC integers into TDesC8's, in the correct
968 format for passing to the BuildIntL and BuildUintL members in SDP.
969 This is effectively a Big-endian variant of TPckgBuf.
974 class TSdpIntBuf : public TBufC8<sizeof(T)>
977 inline TSdpIntBuf(const T& aRef);
980 /**Speciality of Integer to Descriptor Convertor for TUint64s*/
981 TEMPLATE_SPECIALIZATION class TSdpIntBuf<TUint64> :public TBufC8<sizeof(TUint64)>
984 IMPORT_C TSdpIntBuf(const TUint64& aRef);
987 /**Speciality of Integer to Descriptor Convertor for TUint32s*/
988 TEMPLATE_SPECIALIZATION class TSdpIntBuf<TUint32> : public TSdpIntBuf<TUint>
991 IMPORT_C TSdpIntBuf(const TUint32& aRef);
994 /**Speciality of Integer to Descriptor Convertor for TUint16s*/
995 TEMPLATE_SPECIALIZATION class TSdpIntBuf<TUint16> : public TSdpIntBuf<TUint>
998 IMPORT_C TSdpIntBuf(const TUint16& aRef);
1001 /**Speciality of Integer to Descriptor Convertor for TUint8s*/
1002 TEMPLATE_SPECIALIZATION class TSdpIntBuf<TUint8> : public TSdpIntBuf<TUint>
1005 IMPORT_C TSdpIntBuf(const TUint8& aRef);
1010 // This function has to be inline and not exported since otherwise
1011 // the replacement of T for the class provided doesn't work.
1013 inline TSdpIntBuf<T>::TSdpIntBuf(const T &aRef)
1015 TBufC8<sizeof(T)>::DoSetLength(sizeof(T));
1016 SdpUtil::PutUint(TBufC8<sizeof(T)>::iBuf, TInt64(aRef), sizeof(T));
1019 //*************************************************************
1021 // SDP Agent client API
1023 //*************************************************************
1025 class MSdpAgentNotifier
1026 /** Handles responses to Bluetooth Service Discovery Protocol queries.
1028 Clients that make queries through CSdpAgent must implement this interface
1029 to handle the responses.
1031 @see CSdpAgent::AttributeRequestL() */
1034 /** Called when an service record request (CSdpAgent::NextRecordRequestComplete())
1035 operation completes.
1037 @param aError KErrNone if successful;
1038 KErrEof if there are no more SDP records left to be read; or an SDP error.
1039 @param aHandle Service record for which the query was made
1040 @param aTotalRecordsCount Total number of matching records
1041 @see CSdpAgent::NextRecordRequestL() */
1042 virtual void NextRecordRequestComplete(TInt aError, TSdpServRecordHandle aHandle, TInt aTotalRecordsCount)=0;
1044 /** Called when an attribute request (CSdpAgent::AttributeRequestL()) wants to
1047 @param aHandle Service record for which the query was made
1048 @param aAttrID ID of the attribute obtained
1049 @param aAttrValue Attribute value obtained
1050 @see CSdpAgent::AttributeRequestL() */
1051 virtual void AttributeRequestResult(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID, CSdpAttrValue* aAttrValue)=0;
1053 /** Called when an attribute request (CSdpAgent::AttributeRequestL()) wants to
1054 signal the completion of a attribute request.
1056 @param aHandle Service record for which the query was made
1057 @param aError an error
1058 @see CSdpAgent::AttributeRequestL() */
1059 virtual void AttributeRequestComplete(TSdpServRecordHandle, TInt aError)=0;
1062 Returns a null aObject if the extension is not implemented, or a pointer to another interface if it is.
1063 @param aInterface UID of the interface to return
1064 @param aObject the container for another interface as specified by aInterface
1066 IMPORT_C virtual void MSAN_ExtensionInterfaceL(TUid aInterface, void*& aObject);
1070 class CSdpSearchPattern;
1071 class CSdpAttrIdMatchList;
1073 NONSHARABLE_CLASS(CSdpAgent) : public CBase
1074 /** Makes Bluetooth service discovery protocol (SDP) requests to a remote device.
1076 To make SDP requests,
1078 Construct a CSdpAgent object with the Bluetooth address of the remote device
1081 Set the classes of service that you want to query for. The classes have predefined
1082 UUIDs, which you specify with SetRecordFilterL().
1084 Get results through NextRecordRequestL(). Information on services is stored
1085 as records, which can be queried in turn for attribute values for the service
1086 through AttributeRequestL().
1088 A user of this class must implement MSdpAgentNotifier to receive the responses
1091 Note that queries are asynchronous, although this is hidden in the API. The
1092 implication is that the interface functions that receive responses are only
1093 called when the thread's active scheduler can schedule handling of the completion
1096 @see MSdpAgentNotifier */
1099 IMPORT_C static CSdpAgent* NewL(MSdpAgentNotifier& aNotifier, const TBTDevAddr& aDevAddr);
1100 IMPORT_C static CSdpAgent* NewLC(MSdpAgentNotifier& aNotifier, const TBTDevAddr& aDevAddr);
1101 IMPORT_C ~CSdpAgent();
1102 IMPORT_C void SetRecordFilterL(const CSdpSearchPattern& aUUIDFilter);
1103 IMPORT_C void SetAttributePredictorListL(const CSdpAttrIdMatchList& aMatchList);
1104 IMPORT_C void NextRecordRequestL();
1106 IMPORT_C void AttributeRequestL(TSdpServRecordHandle aHandle,
1107 TSdpAttributeID aAttrID);
1108 IMPORT_C void AttributeRequestL(TSdpServRecordHandle aHandle,
1109 const CSdpAttrIdMatchList& aMatchList);
1110 IMPORT_C void AttributeRequestL(MSdpElementBuilder* aBuilder,
1111 TSdpServRecordHandle aHandle,
1112 TSdpAttributeID aAttrID);
1113 IMPORT_C void AttributeRequestL(MSdpElementBuilder* aBuilder,
1114 TSdpServRecordHandle aHandle,
1115 const CSdpAttrIdMatchList& aMatchList);
1116 IMPORT_C void Cancel();
1120 void ConstructL(MSdpAgentNotifier& aNotifier, TBTDevAddr aDevAddr);
1124 CSdpAgentEng* iAgentEngine;
1127 NONSHARABLE_CLASS(CSdpSearchPattern) : public CBase, public MSdpElementBuilder
1128 /** A list of Bluetooth service classes, represented as Universal Unique Identifiers
1129 (UUIDs), to be matched in SDP Service Search Requests.
1131 @see CSdpAgent::SetRecordFilterL()
1135 IMPORT_C static CSdpSearchPattern* NewL();
1136 IMPORT_C void ConstructL();
1137 IMPORT_C ~CSdpSearchPattern();
1138 IMPORT_C TInt AddL(const TUUID& aUUID);
1139 IMPORT_C TInt Remove(const TUUID& aUUID);
1140 IMPORT_C TInt Find(const TUUID& aUUID, TInt &aPos) const;
1141 IMPORT_C TInt Count() const;
1142 IMPORT_C const TUUID At(TInt anIndex) const;
1143 IMPORT_C void Reset();
1144 /** Tests if the list is empty.
1146 @return True if the list is empty */
1147 IMPORT_C TBool IsEmpty();
1150 CSdpSearchPattern();
1153 // Implementation of Mbuilder interface
1154 MSdpElementBuilder* BuildUUIDL(const TUUID& aUUID);
1155 MSdpElementBuilder* BuildDESL();
1156 MSdpElementBuilder* StartListL();
1157 MSdpElementBuilder* EndListL();
1160 CArrayFixFlat<TUUID>* iUUIDArray;
1164 /** A range of attribute ID values.
1166 This class is used in an attribute list, CSdpAttrIdMatchList, so that all
1167 attributes with IDs in the specified range are considered.
1169 @see CSdpAttrIdMatchList */
1172 /** Default constructor. */
1173 IMPORT_C TAttrRange();
1176 /** Constructor with single ID.
1178 @param aAttrId The start and the end of the range are both set to aAttrId */
1179 IMPORT_C TAttrRange(TSdpAttributeID aAttrId);
1182 /** Constructor with start and end IDs.
1184 @param aStart ID for the start of the range
1185 @param aEnd ID for the end of the range */
1186 IMPORT_C TAttrRange(TSdpAttributeID aStart, TSdpAttributeID aEnd);
1189 /** Tests if the specified ID is either within the range.
1191 @param aAttrId ID to test
1192 @return True if in range, else false */
1193 IMPORT_C TBool IsInRange(TSdpAttributeID aAttrId) const;
1196 /** Tests if the specified ID is either within the range, is one less than the
1197 lower bound, or one more than the upper bound.
1199 @param aAttrId ID to test
1200 @return True if contiguous, else false */
1201 IMPORT_C TBool IsContiguousWith(TSdpAttributeID aAttrId) const;
1204 /** Tests if the specified range is contiguous with the range.
1206 @param aRange Range to test
1207 @return True if contiguous, else false */
1208 IMPORT_C TBool IsContiguousWith(TAttrRange aRange) const;
1211 /** ID of the start of the range */
1212 TSdpAttributeID iStart;
1213 /** ID of the end of the range */
1214 TSdpAttributeID iEnd;
1217 // This data padding has been added to help prevent future binary compatibility breaks
1218 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
1224 /** Greatest range possible for attribute IDs.
1226 Useful for including all attributes in a CSdpAttrIdMatchList
1227 @see CSdpAttrIdMatchList*/
1228 #define KAttrRangeAll TAttrRange(0, KMaxTUint16)
1231 class CSdpServRecord;
1232 class TElementEncoder;
1233 class MAttributeMatchHandler;
1235 NONSHARABLE_CLASS(CSdpAttrIdMatchList) : public CBase, public MSdpElementBuilder
1236 /** SDP Attribute ID Match list.
1238 Holds a list of Attribute IDs to be retrieved from a remote device in an Service
1239 Attribute Request. Set in terms of ranges of attributes, each one specified
1240 through a TAttrRange. */
1243 IMPORT_C static CSdpAttrIdMatchList* NewL();
1244 IMPORT_C static CSdpAttrIdMatchList* NewL(const CSdpAttrIdMatchList& aAttrMatchList);
1245 IMPORT_C ~CSdpAttrIdMatchList();
1246 IMPORT_C void AddL(TAttrRange aRange);
1247 IMPORT_C void RemoveL(TAttrRange aRange);
1248 TInt Find(TSdpAttributeID aAttrId, TInt &aPos) const;
1250 // Do not use this - it gives an off-by-one error for aPos
1251 // unless the attribute is the first one in a contiguous range.
1252 // Use InMatchListRange() instead
1253 IMPORT_C TBool InMatchList(TSdpAttributeID aAttrId, TInt &aPos) const;
1257 /** Tests if the specified attribute ID is in the list.
1259 @param aAttrId Attribute ID to test
1260 @return ETrue if the attribute is in the list, else EFalse */
1261 IMPORT_C TBool InMatchList(TSdpAttributeID aAttrId) const;
1264 /** Gets the number of separate ranges of attribute IDs in the list.
1266 @return Number of ranges of attribute IDs in the list */
1267 IMPORT_C TInt Count() const;
1269 void FindAttributesL(CSdpServRecord &aRec, MAttributeMatchHandler &aHandler) const;
1272 This method is for internal sub-system use only, it is not to be used otherwise.
1276 IMPORT_C TUint EncodeL(TElementEncoder aEncoder) const;
1279 /** Tests if the specified attribute ID is in the list.
1281 @param aAttrId Attribute ID to test
1282 @param aRange Position of the range of IDs in the list which contains aAttrId, or 0 if not found
1283 @return ETrue if the attribute is in the list, else EFalse */
1284 IMPORT_C TBool InMatchListRange(TSdpAttributeID aAttrId, TInt &aRange) const;
1288 // Implementation of MSdpElementBuilder interface
1289 MSdpElementBuilder* BuildUintL(const TDesC8& aUint);
1290 MSdpElementBuilder* BuildDESL();
1291 MSdpElementBuilder* StartListL();
1292 MSdpElementBuilder* EndListL();
1293 TInt FindInOrContiguousWith(TSdpAttributeID aAttrId, TInt &aPos) const;
1296 CSdpAttrIdMatchList();
1297 CArrayFix<TAttrRange>* iList;
1303 // interface via NetDB
1304 // includes parser and builder to use it
1307 /** Cannot bind to specifed sockets protocol, as already bound. */
1308 const static TInt KErrSdpAlreadyBound = -6400;
1309 /** Remote device gave unknown error. */
1310 const static TInt KErrSdpPeerError = -6401;
1311 /** Local device is not connected. */
1312 const static TInt KErrSdpClientNotConnected = -6402;
1313 /** Invalid/unsupported SDP version. */
1314 const static TInt KErrSdpUnsupportedVersion = -6403;
1315 /** Invalid Service Record Handle. */
1316 const static TInt KErrSdpBadRecordHandle = -6404;
1317 /** Invalid Continuation State. */
1318 const static TInt KErrSdpBadContinuationState = -6405;
1319 /** SDP server rejected the request. */
1320 const static TInt KErrSdpServerRejectedRequest = -6406;
1321 /** Request buffer was ill-formed. */
1322 const static TInt KErrSdpBadRequestBufferLength = -6407;
1323 /** Result buffer was ill-formed. */
1324 const static TInt KErrSdpBadResultBufferLength = -6408;
1325 /** UUID entry was ill-formed. */
1326 const static TInt KErrSdpBadUUIDLength = -6409;
1327 /** Response was ill-formed. */
1328 const static TInt KErrSdpBadResultData = -6410;
1329 /** SDP database is full. */
1330 const static TInt KErrSdpDatabaseFull = -6411;
1333 template <class T> class CSdpStackFix;
1335 NONSHARABLE_CLASS(CElementParser) : public CBase
1336 /** Parser for SDP attribute values.
1338 The class parses an input buffer containing an attribute value into its constituent
1339 data elements. It calls an MSdpElementBuilder object each time a data element
1342 This parser can parse incrementally, and be fed new data as it arrives.
1344 @see MSdpElementBuilder */
1347 NONSHARABLE_CLASS(CLinearBuf) : public CBase
1348 /*Buffer used for a buffered parse.*/
1351 static CLinearBuf* NewLC(TInt aExpandSize);
1353 void AppendL(const TDesC8& aData);
1354 const TPtrC8 Ptr() const;
1355 void Consume(TInt aLength);
1360 void ConstructL(TInt aExpandSize);
1367 IMPORT_C static CElementParser* NewL(MSdpElementBuilder* aBuilder);
1368 IMPORT_C ~CElementParser();
1369 IMPORT_C TInt ParseElementsL(const TDesC8& aData);
1370 IMPORT_C TBool BufferedParseL(const TDesC8& aData);
1371 IMPORT_C void Reset();
1372 IMPORT_C void Reset(MSdpElementBuilder* aBuilder);
1373 IMPORT_C void SetBuilder(MSdpElementBuilder* aBuilder);
1374 IMPORT_C MSdpElementBuilder* Builder();
1378 CElementParser(MSdpElementBuilder* aBuilder);
1379 static TBool IsComposite(TUint8 aType);
1382 MSdpElementBuilder* iBuilder;
1383 CSdpStackFix<TInt>* iListStack;
1384 CLinearBuf* iRemainderBuf;
1387 _LIT(KSdpClientPanic,"SDPServer");
1388 enum TSdpClientPanic
1391 ESdpBadDescriptor = 1,
1392 ESdpBadSubSessionHandle = 6,
1393 ESdpBadSubSessionRemove = 7,
1394 ESdpNonExistantRecordHandle = 12,