Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
|
This dbt_repeater00 C++ repeater example implementing a GATT repeater, i.e. More...
#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 "dbt_constants.hpp"
#include <cstdio>
Go to the source code of this file.
Classes | |
class | AdapterToClientStatusListener |
class | AdapterToServerStatusListener |
class | NativeGattToServerCharListener |
Functions | |
static void | connectToDiscoveredServer (BTDeviceRef device) |
static bool | initAdapterToClient (std::shared_ptr< BTAdapter > &adapter) |
static bool | initAdapterToServer (std::shared_ptr< BTAdapter > &adapter) |
int | main (int argc, char *argv[]) |
static void | myChangedAdapterSetFunc (const bool added, std::shared_ptr< BTAdapter > &adapter) |
static void | processDisconnectedDeviceToClient (BTDeviceRef device) |
static void | processReadyToServer (const BTDeviceRef &device) |
static void | removeDeviceToServer (BTDeviceRef device) |
static void | resetConnectionToServer (BTDeviceRef device) |
static bool | startAdvertisingToClient (const BTAdapterRef &a, const std::string &msg) |
static bool | startDiscoveryToServer (BTAdapter *a, std::string msg) |
static bool | stopAdvertisingToClient (const BTAdapterRef &a, const std::string &msg) |
void | test () |
Variables | |
static BTAdapterRef | adapterToClient = nullptr |
static EUI48 | adapterToClientAddr = EUI48::ALL_DEVICE |
static std::string | adapterToClientName = "repeater0" |
static BTSecurityLevel | adapterToClientSecLevel = BTSecurityLevel::UNSET |
static std::string | adapterToClientShortName = "repeater0" |
static bool | adapterToClientUseSC = true |
static BTAdapterRef | adapterToServer = nullptr |
static EUI48 | adapterToServerAddr = EUI48::ALL_DEVICE |
static const uint8_t | adv_chan_map =0x07 |
static const uint16_t | adv_interval_max =640 |
static const uint16_t | adv_interval_min =640 |
static const AD_PDU_Type | adv_type =AD_PDU_Type::ADV_IND |
static BTMode | btMode = BTMode::DUAL |
static BTDeviceRef | connectedDeviceToClient = nullptr |
static BTDeviceRef | connectedDeviceToServer = nullptr |
static DiscoveryPolicy | discoveryPolicy = DiscoveryPolicy::PAUSE_CONNECTED_UNTIL_DISCONNECTED |
static const uint8_t | filter_policy = 0 |
static const bool | le_scan_active = true |
static const uint16_t | le_scan_interval = 24 |
static const uint16_t | le_scan_window = 24 |
static uint16_t | max_att_mtu_to_client = 512+1 |
static jau::nsize_t | MAX_SERVED_CONNECTIONS = 0 |
static bool | QUIET = false |
static jau::relaxed_atomic_nsize_t | servedClientConnections = 0 |
static std::atomic< int > | serverDeviceReadyCount = 0 |
static jau::sc_atomic_bool | sync_data |
static uint64_t | timestamp_t0 |
This dbt_repeater00 C++ repeater example implementing a GATT repeater, i.e.
forwarding client requests to a GATT server and passing the results back.
The repeater can be used in between an existing Bluetooth LE client and server, acting as a forwarder and to analyze the GATT client/server protocol.
Using scripts/run-dbt_repeater00.sh
from dist
directory:
TAIDOC TD1107
using adapter DC:FB:48:00:90:19
; Serving client as TAIDOC TD1108
using adapter 00:1A:7D:DA:71:03
; Using ENC_ONLY (JUST_WORKS) encryption. Definition in file dbt_repeater00.cpp.
|
static |
Definition at line 401 of file dbt_repeater00.cpp.
|
static |
Definition at line 446 of file dbt_repeater00.cpp.
|
static |
Definition at line 495 of file dbt_repeater00.cpp.
|
static |
Definition at line 522 of file dbt_repeater00.cpp.
|
static |
Definition at line 722 of file dbt_repeater00.cpp.
|
static |
Definition at line 758 of file dbt_repeater00.cpp.
|
static |
Definition at line 698 of file dbt_repeater00.cpp.
|
static |
Definition at line 508 of file dbt_repeater00.cpp.
|
static |
Definition at line 532 of file dbt_repeater00.cpp.
|
static |
Definition at line 764 of file dbt_repeater00.cpp.
|
static |
Definition at line 846 of file dbt_repeater00.cpp.
void test | ( | ) |
Definition at line 878 of file dbt_repeater00.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 913 of file dbt_repeater00.cpp.
|
static |
Definition at line 69 of file dbt_repeater00.cpp.
|
static |
Definition at line 71 of file dbt_repeater00.cpp.
|
static |
Definition at line 72 of file dbt_repeater00.cpp.
|
static |
Definition at line 77 of file dbt_repeater00.cpp.
|
static |
Definition at line 78 of file dbt_repeater00.cpp.
|
static |
Definition at line 79 of file dbt_repeater00.cpp.
|
static |
Definition at line 80 of file dbt_repeater00.cpp.
|
static |
Definition at line 87 of file dbt_repeater00.cpp.
|
static |
Definition at line 88 of file dbt_repeater00.cpp.
|
static |
Definition at line 89 of file dbt_repeater00.cpp.
|
static |
Definition at line 90 of file dbt_repeater00.cpp.
|
static |
Definition at line 91 of file dbt_repeater00.cpp.
|
static |
Definition at line 92 of file dbt_repeater00.cpp.
|
static |
Definition at line 93 of file dbt_repeater00.cpp.
|
static |
Definition at line 94 of file dbt_repeater00.cpp.
|
static |
Definition at line 95 of file dbt_repeater00.cpp.
|
static |
Definition at line 100 of file dbt_repeater00.cpp.
|
static |
Definition at line 101 of file dbt_repeater00.cpp.
|
static |
Definition at line 102 of file dbt_repeater00.cpp.
|
static |
Definition at line 103 of file dbt_repeater00.cpp.
|
static |
Definition at line 104 of file dbt_repeater00.cpp.
|
static |
Definition at line 105 of file dbt_repeater00.cpp.
|
static |
Definition at line 106 of file dbt_repeater00.cpp.
|
static |
Definition at line 107 of file dbt_repeater00.cpp.
|
static |
Definition at line 108 of file dbt_repeater00.cpp.
|
static |
Definition at line 109 of file dbt_repeater00.cpp.
|
static |
Definition at line 115 of file dbt_repeater00.cpp.