Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/OTSDPService.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/OTSDPService.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/OTSDPService.h b/noncore/settings/networksettings2/opietooth2/OTSDPService.h new file mode 100644 index 0000000..4831df0 --- a/dev/null +++ b/noncore/settings/networksettings2/opietooth2/OTSDPService.h | |||
@@ -0,0 +1,75 @@ | |||
1 | //-*-c++-*- | ||
2 | /*************************************************************************** | ||
3 | * Copyright (C) 2003 by Fred Schaettgen * | ||
4 | * kdebluetooth@schaettgen.de * | ||
5 | * * | ||
6 | * This program is free software; you can redistribute it and/or modify * | ||
7 | * it under the terms of the GNU General Public License as published by * | ||
8 | * the Free Software Foundation; either version 2 of the License, or * | ||
9 | * (at your option) any later version. * | ||
10 | ***************************************************************************/ | ||
11 | |||
12 | #ifndef SDPSERVICE_H | ||
13 | #define SDPSERVICE_H | ||
14 | |||
15 | #include <qvector.h> | ||
16 | #include <qarray.h> | ||
17 | #include <OTSDPAttribute.h> | ||
18 | |||
19 | namespace Opietooth2 { | ||
20 | |||
21 | /** | ||
22 | @author Fred Schaettgen | ||
23 | */ | ||
24 | class OTSDPService { | ||
25 | |||
26 | public: | ||
27 | |||
28 | OTSDPService(); | ||
29 | virtual ~OTSDPService(); | ||
30 | |||
31 | void addAttribute(int id, OTSDPAttribute * attr); | ||
32 | |||
33 | const OTSDPAttribute & attribute( int index ); | ||
34 | int attributeID( int index ); | ||
35 | |||
36 | AttributeVector subAttributes( OTSDPAttribute * attr); | ||
37 | OTSDPAttribute * attributeByID( int id ); | ||
38 | |||
39 | // See Bluetooth Core Spec Sec. 5.1 | ||
40 | bool recordHandle(uint32_t *handle); // 0x00 | ||
41 | |||
42 | //bool getServiceClassIDList(vector<uuid_t> *classIDList); // 0x01 | ||
43 | //bool getServiceRecordState(uint32_t *state); // 0x02 | ||
44 | //bool getServiceID(uuid_t *id); // 0x03; | ||
45 | //bool getProtocolDescriptorList(SDP::Attribute *attribute); // 0x04 | ||
46 | //bool getBrowseGroupList(vector<uuid_t> *browseGroupList); // 0x05 | ||
47 | QString name(void); // langBase + 0x00 | ||
48 | QString description(void); // langBase + 0x01 | ||
49 | |||
50 | UUIDVector allUUIDs(); | ||
51 | |||
52 | // return list of classes this service belongs to | ||
53 | UUIDVector classIDList(); | ||
54 | |||
55 | /** Retrieves the Rfcomm channel. | ||
56 | This function is provided just for conveniance. | ||
57 | @param n The Rfcomm channel. | ||
58 | @ret true if an rfcomm channel was found, false otherwise. */ | ||
59 | bool rfcommChannel(unsigned int &n); | ||
60 | |||
61 | bool hasClassID(const OTUUID & uuid); | ||
62 | |||
63 | private: | ||
64 | |||
65 | struct AttributeEntry { | ||
66 | int id; | ||
67 | OTSDPAttribute * attr; | ||
68 | }; | ||
69 | |||
70 | QArray<AttributeEntry> attributeList; | ||
71 | }; | ||
72 | |||
73 | } | ||
74 | |||
75 | #endif | ||