Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
dbt_constants.hpp
Go to the documentation of this file.
1/**
2 * Author: Sven Gothel <sgothel@jausoft.com>
3 * Copyright (c) 2022 Gothel Software e.K.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef DBT_CONSTANTS_HPP
26#define DBT_CONSTANTS_HPP
27
28#include <cinttypes>
29#include <cstring>
30#include <memory>
31
33
35 public:
36 static constexpr const int max_connections_per_session = 5;
37
38 /**
39 * C++20 we could use `constexpr std::string`
40 *
41 * C++17 we have to use `const char *`, `std::string_view` or `extern const std::string`.
42 */
43 static constexpr const char CLIENT_KEY_PATH[] = "client_keys";
44
45 static constexpr const char SERVER_KEY_PATH[] = "server_keys";
46
52
53
54 /**
55 * Success handshake command data, where client is signaling successful completion of test to server.
56 */
57 static const std::vector<uint8_t> SuccessHandshakeCommandData;
58
59 /**
60 * Fail handshake command data, where client is signaling unsuccessful completion of test to server.
61 */
62 static const std::vector<uint8_t> FailHandshakeCommandData;
63};
64
65enum class ExpectedPairing {
69};
70
71const jau::uuid128_t DBTConstants::DataServiceUUID = jau::uuid128_t("d0ca6bf3-3d50-4760-98e5-fc5883e93712");
72const jau::uuid128_t DBTConstants::StaticDataUUID = jau::uuid128_t("d0ca6bf3-3d51-4760-98e5-fc5883e93712");
73const jau::uuid128_t DBTConstants::CommandUUID = jau::uuid128_t("d0ca6bf3-3d52-4760-98e5-fc5883e93712");
74const jau::uuid128_t DBTConstants::ResponseUUID = jau::uuid128_t("d0ca6bf3-3d53-4760-98e5-fc5883e93712");
75const jau::uuid128_t DBTConstants::PulseDataUUID = jau::uuid128_t("d0ca6bf3-3d54-4760-98e5-fc5883e93712");
76
77const std::vector<uint8_t> DBTConstants::SuccessHandshakeCommandData = { 0xaa, 0xff, 0xff, 0xee };
78const std::vector<uint8_t> DBTConstants::FailHandshakeCommandData = { 0x00, 0xea, 0xea, 0xff };
79
80#endif /* DBT_CONSTANTS_HPP */
Author: Sven Gothel sgothel@jausoft.com Copyright (c) 2022 Gothel Software e.K.
static constexpr const char SERVER_KEY_PATH[]
static const jau::uuid128_t ResponseUUID
static constexpr const int max_connections_per_session
static const jau::uuid128_t StaticDataUUID
static const jau::uuid128_t CommandUUID
static constexpr const char CLIENT_KEY_PATH[]
C++20 we could use constexpr std::string
static const std::vector< uint8_t > FailHandshakeCommandData
Fail handshake command data, where client is signaling unsuccessful completion of test to server.
static const std::vector< uint8_t > SuccessHandshakeCommandData
Success handshake command data, where client is signaling successful completion of test to server.
static const jau::uuid128_t DataServiceUUID
static const jau::uuid128_t PulseDataUUID
ExpectedPairing