|
Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
|
The example demonstrates a client connecting to Avalun's LabPad device.
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 | MyAdapterStatusListener |
| class | MyGATTEventListener |
Variables | |
| static const uuid16_t | _TEMPERATURE_MEASUREMENT (GattCharacteristicType::TEMPERATURE_MEASUREMENT) |
| static BTMode | btMode = BTMode::DUAL |
| static std::shared_ptr< BTAdapter > | chosenAdapter = nullptr |
| static const POctets | cmd_data1 ({ 0x00, 0x14, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x5E, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x9B, 0x23, 0x84 }, lb_endian::little) |
| static const POctets | cmd_data2 ({ 0x01, 0xB8 }, lb_endian::little) |
| static std::unique_ptr< uuid_t > | cmd_req_uuid = jau::uuid_t::create(std::string("2c1b2472-4a5f-11e5-9595-0002a5d5c51b")) |
| static std::unique_ptr< uuid_t > | cmd_rsp_uuid = jau::uuid_t::create(std::string("2c1b2473-4a5f-11e5-9595-0002a5d5c51b")) |
| static std::atomic< int > | deviceReadyCount = 0 |
| static DiscoveryPolicy | discoveryPolicy = DiscoveryPolicy::PAUSE_CONNECTED_UNTIL_READY |
| static const bool | filter_dup = true |
| static const uint8_t | filter_policy = 0 |
| static bool | GATT_PING_ENABLED = false |
| static bool | KEEP_CONNECTED = true |
| static bool | le_scan_active = true |
| static const uint16_t | le_scan_interval = 24 |
| static const uint16_t | le_scan_window = 24 |
| static std::atomic< int > | MULTI_MEASUREMENTS = 8 |
| static bool | QUIET = false |
| static bool | REMOVE_DEVICE = true |
| static int | RESET_ADAPTER_EACH_CONN = 0 |
| static const POctets | resp_exp ({ 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x64, 0x17, 0x01, 0xed }, lb_endian::little) |
| static bool | SHOW_UPDATE_EVENTS = false |
| static uint64_t | timestamp_t0 |
| static bool | use_privacy = false |
| static EUI48 | useAdapter = EUI48::ALL_DEVICE |
The example demonstrates a client connecting to Avalun's LabPad device.
It differs from dbt_scanner10 as follows:
Generic Access service-dev LabPad device name and SMPIOCapability::KEYBOARD_ONLY + BTSecurityLevel::ENC_AUTH-passkey <int> uses LabPad implicitly, i.e. user only needs to pass the integer w/o device name.Other than that, please refer to dbt_scanner10 as a general example.
Definition in file dbt_labpadclient01.cpp.
|
static |
Definition at line 376 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 421 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 645 of file dbt_labpadclient01.cpp.
|
static |
|
static |
| DBGattServerRef dbGattServer | ( | new | DBGattServerjau::make_darray(std::make_shared< DBGattService >(true, std::make_unique< const jau::uuid16_t >(GattServiceType::GENERIC_ACCESS), jau::make_darray(std::make_shared< DBGattChar >(std::make_unique< const jau::uuid16_t >(GattCharacteristicType::DEVICE_NAME), BTGattChar::PropertyBitVal::Read, jau::darray< DBGattDescRef >(), make_gvalue("Jausoft_Dev", 128), true), std::make_shared< DBGattChar >(std::make_unique< const jau::uuid16_t >(GattCharacteristicType::APPEARANCE), BTGattChar::PropertyBitVal::Read, jau::darray< DBGattDescRef >(), make_gvalue((uint16_t) 0)))), std::make_shared< DBGattService >(true, std::make_unique< const jau::uuid16_t >(GattServiceType::DEVICE_INFORMATION), jau::make_darray(std::make_shared< DBGattChar >(std::make_unique< const jau::uuid16_t >(GattCharacteristicType::MANUFACTURER_NAME_STRING), BTGattChar::PropertyBitVal::Read, jau::darray< DBGattDescRef >(), make_gvalue("Gothel Software")), std::make_shared< DBGattChar >(std::make_unique< const jau::uuid16_t >(GattCharacteristicType::MODEL_NUMBER_STRING), BTGattChar::PropertyBitVal::Read, jau::darray< DBGattDescRef >(), make_gvalue("2.4.0-pre")), std::make_shared< DBGattChar >(std::make_unique< const jau::uuid16_t >(GattCharacteristicType::SERIAL_NUMBER_STRING), BTGattChar::PropertyBitVal::Read, jau::darray< DBGattDescRef >(), make_gvalue("sn:0123456789")), std::make_shared< DBGattChar >(std::make_unique< const jau::uuid16_t >(GattCharacteristicType::HARDWARE_REVISION_STRING), BTGattChar::PropertyBitVal::Read, jau::darray< DBGattDescRef >(), make_gvalue("hw:0123456789")), std::make_shared< DBGattChar >(std::make_unique< const jau::uuid16_t >(GattCharacteristicType::FIRMWARE_REVISION_STRING), BTGattChar::PropertyBitVal::Read, jau::darray< DBGattDescRef >(), make_gvalue("fw:0123456789")), std::make_shared< DBGattChar >(std::make_unique< const jau::uuid16_t >(GattCharacteristicType::SOFTWARE_REVISION_STRING), BTGattChar::PropertyBitVal::Read, jau::darray< DBGattDescRef >(), make_gvalue("sw:0123456789"))))) | ) |
|
static |
|
static |
| void test | ( | ) |
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 788 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 71 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 73 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 74 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 75 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 77 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 78 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 79 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 80 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 81 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 82 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 84 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 86 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 87 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 89 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 91 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 92 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 93 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 96 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 97 of file dbt_labpadclient01.cpp.
|
static |
|
static |
|
static |
|
static |
Definition at line 113 of file dbt_labpadclient01.cpp.
|
static |
Definition at line 114 of file dbt_labpadclient01.cpp.
|
static |