aboutsummaryrefslogtreecommitdiffstats
path: root/examples/tinyb/uuid.cpp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-08-31 04:41:54 +0200
committerSven Gothel <[email protected]>2021-08-31 04:41:54 +0200
commitaef10f3cdec0fd698cfa7d913725b40d1513ce30 (patch)
treee36d6b2796e40c5d4f40e66d9cbb6b7259bd42f6 /examples/tinyb/uuid.cpp
parent99ddbcee148144b3593adf4440d3fa3d06f229ab (diff)
Direct-BT: Remove TinyB and Cleanup Java API (1)
Starting with version 2.3, the previously refactored *TinyB* has been removed completely. Motivation was lack of detailed Bluetooth support, inclusive increasing diversion with *Direct-BT*. Furthermore, work is underway for `BLE slave periphal and GATT server` support and its mapping to *BlueZ D-Bus* is questionable and would be resource intensive. Java API changed as follows: - Objects no more Clonable - Removed dead unsupported code - Removed deprecated code - Added 'GattCharPropertySet', representing property bit mask for BTGattChar, replacing the string array.
Diffstat (limited to 'examples/tinyb/uuid.cpp')
-rw-r--r--examples/tinyb/uuid.cpp69
1 files changed, 0 insertions, 69 deletions
diff --git a/examples/tinyb/uuid.cpp b/examples/tinyb/uuid.cpp
deleted file mode 100644
index db5452bb..00000000
--- a/examples/tinyb/uuid.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-#include<string>
-#include<string.h>
-#include<cstdlib>
-#include<iostream>
-#include<stdio.h>
-#include<iomanip>
-#include<stdint.h>
-#include <tinyb.hpp>
-
-using namespace tinyb;
-
-int main(int argc, char **argv) {
-
- if( argc <= 2 ) {
- exit(1);
- }
- std::string uuid_string(argv[1]);
-
- std::cout << uuid_string << std::endl;
-/*
- uint64_t uuid[2];
- if (uuid_string.size() == 4 || uuid_string.size() == 8) {
- // 16bit UUID
- uuid[0] = strtoul(uuid_string.c_str(), NULL, 16) << 32 | 0x00001000UL;
- uuid[1] = (0x80000080ULL << 32) | 0x5f9b34fbUL;
- } else if (uuid_string.size() == 36) {
- // 128bit UUID
- char u[37];
- strcpy(u, uuid_string.c_str());
-
- if (u[9] == '-') {
- u[9] = ' ';
- uuid[0] = strtoul(u + 0, NULL, 16) << 32;
- } else
- return 1;
- if (u[13] == '-') {
- u[13] = ' ';
- uuid[0] = uuid[0] | strtoul(u + 10, NULL, 16) << 16;
- } else
- return 1;
- if (u[17] == '-') {
- u[17] = ' ';
- uuid[0] = uuid[0] | strtoul(u + 14, NULL, 16);
- } else
- return 1;
-
- if (u[21] == '-') {
- u[21] = ' ';
- uuid[1] = strtoul(u + 18, NULL, 16) << 48;
- } else
- return 1;
- uuid[1] = uuid[1] | strtoul(u + 22, NULL, 16);
- } else
- return 1;
-
- printf("%08lx-%04lx-%04lx-%04lx-%012lx\n",
- (uuid[0] >> 32),
- ((uuid[0] >> 16) & 0xFFFFULL),
- (uuid[0] & 0xFFFFULL),
- (uuid[1] >> 48),
- (uuid[1] & ~(0xFFFFULL << 48)));
-*/
- BluetoothUUID uuid1(uuid_string);
- BluetoothUUID uuid2(argv[1]);
-
- std::cout << uuid1.get_string() << " " << uuid2.get_string() << std::endl;
-
- return 0;
-}