summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/opietooth2/OTUUID.h
authorwimpie <wimpie>2005-01-04 01:44:52 (UTC)
committer wimpie <wimpie>2005-01-04 01:44:52 (UTC)
commit9a134ab03890d942d53b4121e31e2d37859fa42c (patch) (unidiff)
treee9db8bfc0734d96409c90e12712dd6d8204aeb21 /noncore/settings/networksettings2/opietooth2/OTUUID.h
parentb65cbb7c8b45d57f849722d22f8f165cc202ceb5 (diff)
downloadopie-9a134ab03890d942d53b4121e31e2d37859fa42c.zip
opie-9a134ab03890d942d53b4121e31e2d37859fa42c.tar.gz
opie-9a134ab03890d942d53b4121e31e2d37859fa42c.tar.bz2
New bluetooth library OT2 (loosely based on kbluetooth)
Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/OTUUID.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTUUID.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/OTUUID.h b/noncore/settings/networksettings2/opietooth2/OTUUID.h
new file mode 100644
index 0000000..aebd9b9
--- a/dev/null
+++ b/noncore/settings/networksettings2/opietooth2/OTUUID.h
@@ -0,0 +1,58 @@
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 OTUUID_H
13#define OTUUID_H
14
15#include <qstring.h>
16#include <qarray.h>
17#include <bluezlib.h>
18
19namespace Opietooth2 {
20
21class OTUUID;
22
23typedef QArray<OTUUID> UUIDVector;
24
25class OTUUID {
26
27public :
28
29 OTUUID( QString s );
30 OTUUID( uint64_t l=0, uint64_t h=0);
31 OTUUID( const OTUUID & O );
32
33 bool fromString(QString s);
34
35 void setUUID128(uint64_t hi, uint64_t lo);
36
37 void setUUID32(uint32_t v);
38
39 uint16_t toShort()
40 { return ((hi>>32) & 0xffff); }
41 uint32_t toLong()
42 { return ((hi>>32) & 0xffffffff); }
43 uint64_t toLongLong()
44 { return hi; }
45
46 QString toString() const ;
47 operator QString() const;
48 operator ::uuid_t() const;
49
50 OTUUID & operator=( const OTUUID & other ) ;
51 bool operator<( const OTUUID & other ) const;
52 bool operator==(const OTUUID & uuid) const;
53
54 uint64_t hi;
55 uint64_t lo;
56};
57}
58#endif