author | zecke <zecke> | 2002-06-19 20:17:39 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-19 20:17:39 (UTC) |
commit | 5c56a4cb4bd0aaf3fb2145feb018f8d074a58da2 (patch) (unidiff) | |
tree | 39df033332c4d8f35f8542a731697cf564a04535 | |
parent | 4c943ea6682e53c2039881aab72f6e003b78880d (diff) | |
download | opie-5c56a4cb4bd0aaf3fb2145feb018f8d074a58da2.zip opie-5c56a4cb4bd0aaf3fb2145feb018f8d074a58da2.tar.gz opie-5c56a4cb4bd0aaf3fb2145feb018f8d074a58da2.tar.bz2 |
sdptool parser
-rw-r--r-- | noncore/net/opietooth/lib/lib.pro | 6 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/services.cc | 28 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/services.h | 30 |
3 files changed, 32 insertions, 32 deletions
diff --git a/noncore/net/opietooth/lib/lib.pro b/noncore/net/opietooth/lib/lib.pro index ce36d66..72cb456 100644 --- a/noncore/net/opietooth/lib/lib.pro +++ b/noncore/net/opietooth/lib/lib.pro | |||
@@ -1,9 +1,9 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qte warn_on release | 2 | CONFIG += qte warn_on release |
3 | HEADERS = device.h manager.h remotedevice.h services.h | 3 | HEADERS = parser.h device.h manager.h remotedevice.h services.h |
4 | SOURCES = device.cc manager.cc remotedevice.cc services.cc | 4 | SOURCES = parser.cc device.cc manager.cc remotedevice.cc services.cc |
5 | TARGET = opietooth | 5 | TARGET = opietooth |
6 | INCLUDEPATH += $(OPIEDIR)/include | 6 | INCLUDEPATH += $(OPIEDIR)/include . |
7 | DESTDIR = $(QTDIR)/lib$(PROJMAK) | 7 | DESTDIR = $(QTDIR)/lib$(PROJMAK) |
8 | LIBS += -lopie | 8 | LIBS += -lopie |
9 | #VERSION = 0.0.0 | 9 | #VERSION = 0.0.0 |
diff --git a/noncore/net/opietooth/lib/services.cc b/noncore/net/opietooth/lib/services.cc index 75c1bd6..d91e4a1 100644 --- a/noncore/net/opietooth/lib/services.cc +++ b/noncore/net/opietooth/lib/services.cc | |||
@@ -1,144 +1,144 @@ | |||
1 | 1 | ||
2 | #include "services.h" | 2 | #include "services.h" |
3 | 3 | ||
4 | using namespace OpieTooth; | 4 | using namespace OpieTooth; |
5 | 5 | ||
6 | 6 | ||
7 | Services::ProfileDescriptor::ProfileDescriptor(){ | 7 | Services::ProfileDescriptor::ProfileDescriptor(){ |
8 | 8 | ||
9 | } | 9 | } |
10 | Services::ProfileDescriptor::ProfileDescriptor(const QString &id, uint idInt, uint version ){ | 10 | Services::ProfileDescriptor::ProfileDescriptor(const QString &id, int idInt, int version ){ |
11 | m_id = id; | 11 | m_id = id; |
12 | m_idInt = idInt; | 12 | m_idInt = idInt; |
13 | m_version = version; | 13 | m_version = version; |
14 | } | 14 | } |
15 | Services::ProfileDescriptor::ProfileDescriptor( const ProfileDescriptor& rem){ | 15 | Services::ProfileDescriptor::ProfileDescriptor( const ProfileDescriptor& rem){ |
16 | (*this) = rem; | 16 | (*this) = rem; |
17 | } | 17 | } |
18 | QString Services::ProfileDescriptor::id() const { | 18 | QString Services::ProfileDescriptor::id() const { |
19 | return m_id; | 19 | return m_id; |
20 | } | 20 | } |
21 | void Services::ProfileDescriptor::setId( const QString& id ){ | 21 | void Services::ProfileDescriptor::setId( const QString& id ){ |
22 | m_id = id; | 22 | m_id = id; |
23 | } | 23 | } |
24 | void Services::ProfileDescriptor::setId(uint id ){ | 24 | void Services::ProfileDescriptor::setId(int id ){ |
25 | m_idInt = id; | 25 | m_idInt = id; |
26 | } | 26 | } |
27 | uint Services::ProfileDescriptor::idInt()const{ | 27 | int Services::ProfileDescriptor::idInt()const{ |
28 | return m_idInt; | 28 | return m_idInt; |
29 | } | 29 | } |
30 | uint Services::ProfileDescriptor::version() const{ | 30 | int Services::ProfileDescriptor::version() const{ |
31 | return m_version; | 31 | return m_version; |
32 | } | 32 | } |
33 | void Services::ProfileDescriptor::setVersion(uint version){ | 33 | void Services::ProfileDescriptor::setVersion(int version){ |
34 | m_version = version; | 34 | m_version = version; |
35 | } | 35 | } |
36 | Services::ProfileDescriptor& Services::ProfileDescriptor::operator=( const Services::ProfileDescriptor& prof){ | 36 | Services::ProfileDescriptor& Services::ProfileDescriptor::operator=( const Services::ProfileDescriptor& prof){ |
37 | m_id = prof.m_id; | 37 | m_id = prof.m_id; |
38 | m_idInt = prof.m_idInt; | 38 | m_idInt = prof.m_idInt; |
39 | m_version = prof.m_version; | 39 | m_version = prof.m_version; |
40 | return *this; | 40 | return *this; |
41 | } | 41 | } |
42 | bool operator==(const Services::ProfileDescriptor& first, | 42 | bool operator==(const Services::ProfileDescriptor& first, |
43 | const Services::ProfileDescriptor& second ){ | 43 | const Services::ProfileDescriptor& second ){ |
44 | 44 | ||
45 | if( (first.id() == second.id() ) && | 45 | if( (first.id() == second.id() ) && |
46 | (first.version() == second.version() ) && | 46 | (first.version() == second.version() ) && |
47 | (first.idInt() == second.idInt() ) ) | 47 | (first.idInt() == second.idInt() ) ) |
48 | return true; | 48 | return true; |
49 | return false; | 49 | return false; |
50 | } | 50 | } |
51 | 51 | ||
52 | Services::ProtocolDescriptor::ProtocolDescriptor(){ | 52 | Services::ProtocolDescriptor::ProtocolDescriptor(){ |
53 | m_number = 0; | 53 | m_number = 0; |
54 | m_channel = 0; | 54 | m_channel = 0; |
55 | } | 55 | } |
56 | Services::ProtocolDescriptor::ProtocolDescriptor(const QString& name, | 56 | Services::ProtocolDescriptor::ProtocolDescriptor(const QString& name, |
57 | uint number, | 57 | int number, |
58 | uint channel){ | 58 | int channel){ |
59 | m_name = name; | 59 | m_name = name; |
60 | m_number = number; | 60 | m_number = number; |
61 | m_channel = channel; | 61 | m_channel = channel; |
62 | } | 62 | } |
63 | Services::ProtocolDescriptor::ProtocolDescriptor( const ProtocolDescriptor& ole ){ | 63 | Services::ProtocolDescriptor::ProtocolDescriptor( const ProtocolDescriptor& ole ){ |
64 | (*this) = ole; | 64 | (*this) = ole; |
65 | } | 65 | } |
66 | Services::ProtocolDescriptor::~ProtocolDescriptor(){ | 66 | Services::ProtocolDescriptor::~ProtocolDescriptor(){ |
67 | 67 | ||
68 | } | 68 | } |
69 | QString Services::ProtocolDescriptor::name() const{ | 69 | QString Services::ProtocolDescriptor::name() const{ |
70 | return m_name; | 70 | return m_name; |
71 | } | 71 | } |
72 | void Services::ProtocolDescriptor::setName(const QString& name ){ | 72 | void Services::ProtocolDescriptor::setName(const QString& name ){ |
73 | m_name = name; | 73 | m_name = name; |
74 | } | 74 | } |
75 | uint Services::ProtocolDescriptor::id()const { | 75 | int Services::ProtocolDescriptor::id()const { |
76 | return m_number; | 76 | return m_number; |
77 | } | 77 | } |
78 | void Services::ProtocolDescriptor::setId( uint id ){ | 78 | void Services::ProtocolDescriptor::setId( int id ){ |
79 | m_number = id; | 79 | m_number = id; |
80 | } | 80 | } |
81 | uint Services::ProtocolDescriptor::port()const { | 81 | int Services::ProtocolDescriptor::port()const { |
82 | return m_channel; | 82 | return m_channel; |
83 | } | 83 | } |
84 | void Services::ProtocolDescriptor::setPort( uint port ){ | 84 | void Services::ProtocolDescriptor::setPort( int port ){ |
85 | m_channel = port; | 85 | m_channel = port; |
86 | } | 86 | } |
87 | Services::ProtocolDescriptor &Services::ProtocolDescriptor::operator=( const Services::ProtocolDescriptor& desc ){ | 87 | Services::ProtocolDescriptor &Services::ProtocolDescriptor::operator=( const Services::ProtocolDescriptor& desc ){ |
88 | m_name = desc.m_name; | 88 | m_name = desc.m_name; |
89 | m_channel = desc.m_channel; | 89 | m_channel = desc.m_channel; |
90 | m_number = desc.m_number; | 90 | m_number = desc.m_number; |
91 | return *this; | 91 | return *this; |
92 | } | 92 | } |
93 | bool operator==( const Services::ProtocolDescriptor &first, | 93 | bool operator==( const Services::ProtocolDescriptor &first, |
94 | const Services::ProtocolDescriptor &second ){ | 94 | const Services::ProtocolDescriptor &second ){ |
95 | if( ( first.name() == second.name() ) && | 95 | if( ( first.name() == second.name() ) && |
96 | ( first.id() == second.id() ) && | 96 | ( first.id() == second.id() ) && |
97 | ( first.port() == second.port() ) ) | 97 | ( first.port() == second.port() ) ) |
98 | return true; | 98 | return true; |
99 | 99 | ||
100 | return false; | 100 | return false; |
101 | 101 | ||
102 | } | 102 | } |
103 | 103 | ||
104 | Services::Services(){ | 104 | Services::Services(){ |
105 | 105 | ||
106 | } | 106 | } |
107 | Services::Services(const Services& service ){ | 107 | Services::Services(const Services& service ){ |
108 | 108 | ||
109 | } | 109 | } |
110 | Services::~Services(){ | 110 | Services::~Services(){ |
111 | 111 | ||
112 | } | 112 | } |
113 | Services &Services::operator=( const Services& ){ | 113 | Services &Services::operator=( const Services& ){ |
114 | return *this; | 114 | return *this; |
115 | } | 115 | } |
116 | bool operator==( const Services&, | 116 | bool operator==( const Services&, |
117 | const Services& ){ | 117 | const Services& ){ |
118 | return false; | 118 | return false; |
119 | } | 119 | } |
120 | QString Services::serviceName() const{ | 120 | QString Services::serviceName() const{ |
121 | 121 | ||
122 | } | 122 | } |
123 | void Services::setServiceName( const QString& service ){ | 123 | void Services::setServiceName( const QString& service ){ |
124 | 124 | ||
125 | } | 125 | } |
126 | int Services::recHandle() const{ | 126 | int Services::recHandle() const{ |
127 | 127 | ||
128 | } | 128 | } |
129 | void Services::setRecHandle( int ){ | 129 | void Services::setRecHandle( int ){ |
130 | 130 | ||
131 | } | 131 | } |
132 | QString Services::classIdList() const{ | 132 | QString Services::classIdList() const{ |
133 | 133 | ||
134 | } | 134 | } |
135 | void Services::setClassIdList( const QString& ){ | 135 | void Services::setClassIdList( const QString& ){ |
136 | 136 | ||
137 | } | 137 | } |
138 | int Services::classIdListInt() const{ | 138 | int Services::classIdListInt() const{ |
139 | 139 | ||
140 | } | 140 | } |
141 | void Services::setClassIdList(int ){ | 141 | void Services::setClassIdList(int ){ |
142 | 142 | ||
143 | } | 143 | } |
144 | void Services::insertProtocolDescriptor( const ProtocolDescriptor& ){ | 144 | void Services::insertProtocolDescriptor( const ProtocolDescriptor& ){ |
diff --git a/noncore/net/opietooth/lib/services.h b/noncore/net/opietooth/lib/services.h index 8e9378a..65de049 100644 --- a/noncore/net/opietooth/lib/services.h +++ b/noncore/net/opietooth/lib/services.h | |||
@@ -1,138 +1,138 @@ | |||
1 | 1 | ||
2 | #ifndef OpieToothServices_H | 2 | #ifndef OpieToothServices_H |
3 | #define OpieToothServices_H | 3 | #define OpieToothServices_H |
4 | 4 | ||
5 | #include <qvaluelist.h> | 5 | #include <qvaluelist.h> |
6 | 6 | ||
7 | namespace OpieTooth { | 7 | namespace OpieTooth { |
8 | /** | 8 | /** |
9 | * Services lets shows you all available services | 9 | * Services lets shows you all available services |
10 | * on a remote device | 10 | * on a remote device |
11 | */ | 11 | */ |
12 | class Services { | 12 | class Services { |
13 | 13 | ||
14 | /** The profile descriptor | 14 | /** The profile descriptor |
15 | * | 15 | * |
16 | */ | 16 | */ |
17 | class ProfileDescriptor{ | 17 | class ProfileDescriptor{ |
18 | public: | 18 | public: |
19 | /** typedef */ | 19 | /** typedef */ |
20 | typedef QValueList<ProfileDescriptor> ValueList; | 20 | typedef QValueList<ProfileDescriptor> ValueList; |
21 | /** c'tor for QValueList */ | 21 | /** c'tor for QValueList */ |
22 | ProfileDescriptor(); | 22 | ProfileDescriptor(); |
23 | /** | 23 | /** |
24 | * c'tor | 24 | * c'tor |
25 | * @param id The id or name ("Lan Access Using PPP") | 25 | * @param id The id or name ("Lan Access Using PPP") |
26 | * @param idInt The id as uint ( 0x1102 ) | 26 | * @param idInt The id as uint ( 0x1102 ) |
27 | * @param version Version of the Profile ( 1 ) | 27 | * @param version Version of the Profile ( 1 ) |
28 | */ | 28 | */ |
29 | ProfileDescriptor(const QString &id, uint idInt, uint version ); | 29 | ProfileDescriptor(const QString &id, int idInt, int version ); |
30 | /** | 30 | /** |
31 | * copy c'tor | 31 | * copy c'tor |
32 | */ | 32 | */ |
33 | ProfileDescriptor(const ProfileDescriptor& ); | 33 | ProfileDescriptor(const ProfileDescriptor& ); |
34 | /** | 34 | /** |
35 | * returns the id | 35 | * returns the id |
36 | */ | 36 | */ |
37 | QString id()const; | 37 | QString id()const; |
38 | /** | 38 | /** |
39 | * sets the id | 39 | * sets the id |
40 | */ | 40 | */ |
41 | void setId(const QString& id); | 41 | void setId(const QString& id); |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * sets the uint id | 44 | * sets the int id |
45 | */ | 45 | */ |
46 | void setId(uint ); | 46 | void setId(int ); |
47 | /** | 47 | /** |
48 | * reutns the id as int | 48 | * reutns the id as int |
49 | */ | 49 | */ |
50 | uint idInt()const; | 50 | int idInt()const; |
51 | /** | 51 | /** |
52 | * returns the version | 52 | * returns the version |
53 | */ | 53 | */ |
54 | uint version()const; | 54 | int version()const; |
55 | /** | 55 | /** |
56 | * sets the Version | 56 | * sets the Version |
57 | */ | 57 | */ |
58 | void setVersion(uint version ); | 58 | void setVersion(int version ); |
59 | /** | 59 | /** |
60 | * copy operator | 60 | * copy operator |
61 | */ | 61 | */ |
62 | ProfileDescriptor &operator=( const ProfileDescriptor& ); | 62 | ProfileDescriptor &operator=( const ProfileDescriptor& ); |
63 | /** | 63 | /** |
64 | * operator== | 64 | * operator== |
65 | */ | 65 | */ |
66 | friend bool operator==(const ProfileDescriptor&, const ProfileDescriptor& ); | 66 | friend bool operator==(const ProfileDescriptor&, const ProfileDescriptor& ); |
67 | private: | 67 | private: |
68 | QString m_id; | 68 | QString m_id; |
69 | uint m_idInt; | 69 | int m_idInt; |
70 | uint m_version; | 70 | int m_version; |
71 | }; | 71 | }; |
72 | /** | 72 | /** |
73 | * Protocol Descriptor | 73 | * Protocol Descriptor |
74 | */ | 74 | */ |
75 | class ProtocolDescriptor { | 75 | class ProtocolDescriptor { |
76 | public: | 76 | public: |
77 | typedef QValueList<ProtocolDescriptor> ValueList; | 77 | typedef QValueList<ProtocolDescriptor> ValueList; |
78 | /** | 78 | /** |
79 | * c'tor | 79 | * c'tor |
80 | */ | 80 | */ |
81 | ProtocolDescriptor(); | 81 | ProtocolDescriptor(); |
82 | /** | 82 | /** |
83 | * name | 83 | * name |
84 | * number | 84 | * number |
85 | * channel/port | 85 | * channel/port |
86 | */ | 86 | */ |
87 | ProtocolDescriptor(const QString&, uint, uint channel ); // Q_UINT8 ? | 87 | ProtocolDescriptor(const QString&, int, int port = -1 ); // Q_UINT8 ? |
88 | ProtocolDescriptor(const ProtocolDescriptor& ); | 88 | ProtocolDescriptor(const ProtocolDescriptor& ); |
89 | ~ProtocolDescriptor(); | 89 | ~ProtocolDescriptor(); |
90 | QString name()const; | 90 | QString name()const; |
91 | void setName(const QString& ); | 91 | void setName(const QString& ); |
92 | uint id()const; | 92 | int id()const; |
93 | void setId(uint ); | 93 | void setId(int ); |
94 | uint port()const; | 94 | int port()const; |
95 | void setPort(uint ); | 95 | void setPort(int ); |
96 | ProtocolDescriptor &operator=( const ProtocolDescriptor& ); | 96 | ProtocolDescriptor &operator=( const ProtocolDescriptor& ); |
97 | friend bool operator==( const ProtocolDescriptor&, | 97 | friend bool operator==( const ProtocolDescriptor&, |
98 | const ProtocolDescriptor& ); | 98 | const ProtocolDescriptor& ); |
99 | private: | 99 | private: |
100 | QString m_name; | 100 | QString m_name; |
101 | uint m_number; | 101 | int m_number; |
102 | uint m_channel; | 102 | int m_channel; |
103 | }; | 103 | }; |
104 | 104 | ||
105 | public: | 105 | public: |
106 | typedef QValueList<Services> ValueList; | 106 | typedef QValueList<Services> ValueList; |
107 | Services(); | 107 | Services(); |
108 | Services(const Services& service ); | 108 | Services(const Services& service ); |
109 | ~Services(); | 109 | ~Services(); |
110 | 110 | ||
111 | Services &operator=( const Services& ); | 111 | Services &operator=( const Services& ); |
112 | friend bool operator==(const Services&, const Services& ); | 112 | friend bool operator==(const Services&, const Services& ); |
113 | QString serviceName()const; | 113 | QString serviceName()const; |
114 | void setServiceName( const QString& service ); | 114 | void setServiceName( const QString& service ); |
115 | 115 | ||
116 | int recHandle()const; | 116 | int recHandle()const; |
117 | void setRecHandle( int ); | 117 | void setRecHandle( int ); |
118 | 118 | ||
119 | QString classIdList()const; | 119 | QString classIdList()const; |
120 | void setClassIdList( const QString& ); | 120 | void setClassIdList( const QString& ); |
121 | int classIdListInt()const; | 121 | int classIdListInt()const; |
122 | void setClassIdList(int ); | 122 | void setClassIdList(int ); |
123 | 123 | ||
124 | void insertProtocolDescriptor(const ProtocolDescriptor& ); | 124 | void insertProtocolDescriptor(const ProtocolDescriptor& ); |
125 | void clearProtocolDescriptorList(); | 125 | void clearProtocolDescriptorList(); |
126 | void removeProtocolDescriptor( const ProtocolDescriptor& ); | 126 | void removeProtocolDescriptor( const ProtocolDescriptor& ); |
127 | ProtocolDescriptor::ValueList protocolDescriptorList()const; | 127 | ProtocolDescriptor::ValueList protocolDescriptorList()const; |
128 | 128 | ||
129 | void insertProfileDescriptor( const ProfileDescriptor& ); | 129 | void insertProfileDescriptor( const ProfileDescriptor& ); |
130 | void clearProfileDescriptorList(); | 130 | void clearProfileDescriptorList(); |
131 | void removeProfileDescriptor(const ProfileDescriptor& ); | 131 | void removeProfileDescriptor(const ProfileDescriptor& ); |
132 | ProfileDescriptor::ValueList profileDescriptor()const; | 132 | ProfileDescriptor::ValueList profileDescriptor()const; |
133 | 133 | ||
134 | 134 | ||
135 | 135 | ||
136 | }; | 136 | }; |
137 | }; | 137 | }; |
138 | #endif | 138 | #endif |