Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
#include <cstring>
#include <string>
#include <memory>
#include <cstdint>
#include <fstream>
#include <iostream>
#include <cinttypes>
#include <pthread.h>
#include <csignal>
#include <jau/cpp_lang_util.hpp>
#include <jau/dfa_utf8_decode.hpp>
#include <jau/basic_algos.hpp>
#include <jau/darray.hpp>
#include <direct_bt/DirectBT.hpp>
#include <unistd.h>
#include <cstdio>
Go to the source code of this file.
Classes | |
class | MyAdapterStatusListener |
class | MyGATTEventListener |
Functions | |
static void | connectDiscoveredDevice (std::shared_ptr< BTDevice > device) |
static void | processReadyDevice (std::shared_ptr< BTDevice > device) |
static void | removeDevice (std::shared_ptr< BTDevice > device) |
static void | resetAdapter (BTAdapter *a, int mode) |
static bool | startDiscovery (BTAdapter *a, std::string msg) |
static bool | initAdapter (std::shared_ptr< BTAdapter > &adapter) |
static bool | myChangedAdapterSetFunc (const bool added, std::shared_ptr< BTAdapter > &adapter) |
void | test () |
int | main (int argc, char *argv[]) |
Variables | |
static const std::string | KEY_PATH = "keys" |
static uint64_t | timestamp_t0 |
static int | RESET_ADAPTER_EACH_CONN = 0 |
static std::atomic< int > | deviceReadyCount = 0 |
static std::atomic< int > | MULTI_MEASUREMENTS = 8 |
static bool | KEEP_CONNECTED = true |
static bool | GATT_PING_ENABLED = false |
static bool | REMOVE_DEVICE = true |
static bool | USE_WHITELIST = false |
static jau::darray< BDAddressAndType > | WHITELIST |
static std::string | charIdentifier = "" |
static int | charValue = 0 |
static bool | SHOW_UPDATE_EVENTS = false |
static bool | QUIET = false |
static const uuid16_t | _TEMPERATURE_MEASUREMENT (GattCharacteristicType::TEMPERATURE_MEASUREMENT) |
static bool | le_scan_active = true |
static const uint16_t | le_scan_interval = 24 |
static const uint16_t | le_scan_window = 24 |
static const uint8_t | filter_policy = 0 |
This dbt_scanner10 C++ scanner example uses the Direct-BT fully event driven workflow and adds multithreading, i.e. one thread processes each found device found as notified via the event listener.
dbt_scanner10 represents the recommended utilization of Direct-BT.
Using scripts/run-dbt_scanner10.sh
from dist
directory:
TAIDOC
(enforcing no security) Definition in file dbt_scanner10.cpp.
|
static |
Definition at line 354 of file dbt_scanner10.cpp.
|
static |
Definition at line 643 of file dbt_scanner10.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 730 of file dbt_scanner10.cpp.
|
static |
Definition at line 668 of file dbt_scanner10.cpp.
|
static |
Definition at line 425 of file dbt_scanner10.cpp.
|
static |
Definition at line 613 of file dbt_scanner10.cpp.
|
static |
Definition at line 626 of file dbt_scanner10.cpp.
|
static |
Definition at line 637 of file dbt_scanner10.cpp.
void test | ( | ) |
Definition at line 682 of file dbt_scanner10.cpp.
|
static |
|
static |
Definition at line 120 of file dbt_scanner10.cpp.
|
static |
Definition at line 121 of file dbt_scanner10.cpp.
|
static |
Definition at line 109 of file dbt_scanner10.cpp.
|
static |
Definition at line 635 of file dbt_scanner10.cpp.
|
static |
Definition at line 114 of file dbt_scanner10.cpp.
|
static |
Definition at line 113 of file dbt_scanner10.cpp.
|
static |
Definition at line 104 of file dbt_scanner10.cpp.
|
static |
Definition at line 632 of file dbt_scanner10.cpp.
|
static |
Definition at line 633 of file dbt_scanner10.cpp.
|
static |
Definition at line 634 of file dbt_scanner10.cpp.
|
static |
Definition at line 111 of file dbt_scanner10.cpp.
|
static |
Definition at line 124 of file dbt_scanner10.cpp.
|
static |
Definition at line 115 of file dbt_scanner10.cpp.
|
static |
Definition at line 108 of file dbt_scanner10.cpp.
|
static |
Definition at line 123 of file dbt_scanner10.cpp.
|
static |
Definition at line 106 of file dbt_scanner10.cpp.
|
static |
Definition at line 117 of file dbt_scanner10.cpp.
|
static |
Definition at line 118 of file dbt_scanner10.cpp.