author | wimpie <wimpie> | 2005-01-04 01:44:52 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-04 01:44:52 (UTC) |
commit | 9a134ab03890d942d53b4121e31e2d37859fa42c (patch) (side-by-side diff) | |
tree | e9db8bfc0734d96409c90e12712dd6d8204aeb21 /noncore/settings/networksettings2/opietooth2/OTUUID.h | |
parent | b65cbb7c8b45d57f849722d22f8f165cc202ceb5 (diff) | |
download | opie-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) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/OTUUID.h | 58 |
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 @@ +//-*-c++-*- +/*************************************************************************** + * Copyright (C) 2003 by Fred Schaettgen * + * kdebluetooth@schaettgen.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#ifndef OTUUID_H +#define OTUUID_H + +#include <qstring.h> +#include <qarray.h> +#include <bluezlib.h> + +namespace Opietooth2 { + +class OTUUID; + +typedef QArray<OTUUID> UUIDVector; + +class OTUUID { + +public : + + OTUUID( QString s ); + OTUUID( uint64_t l=0, uint64_t h=0); + OTUUID( const OTUUID & O ); + + bool fromString(QString s); + + void setUUID128(uint64_t hi, uint64_t lo); + + void setUUID32(uint32_t v); + + uint16_t toShort() + { return ((hi>>32) & 0xffff); } + uint32_t toLong() + { return ((hi>>32) & 0xffffffff); } + uint64_t toLongLong() + { return hi; } + + QString toString() const ; + operator QString() const; + operator ::uuid_t() const; + + OTUUID & operator=( const OTUUID & other ) ; + bool operator<( const OTUUID & other ) const; + bool operator==(const OTUUID & uuid) const; + + uint64_t hi; + uint64_t lo; +}; +} +#endif |