diff options
author | Sven Gothel <[email protected]> | 2021-10-10 04:58:44 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-10-10 04:58:44 +0200 |
commit | 9a816f9747ea178f1db7dff56a92fe5d42676017 (patch) | |
tree | 66216d7e1da5fed9647da2ae42bbb6432af11570 /api/direct_bt/BTAdapter.hpp | |
parent | 5dbcb526dc47723b584317e60cf0343beb84d626 (diff) |
DBGattServer.hpp: Add and use DBGattServer, a complete list of Gatt Service objects for the Gatt Server database
Diffstat (limited to 'api/direct_bt/BTAdapter.hpp')
-rw-r--r-- | api/direct_bt/BTAdapter.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/api/direct_bt/BTAdapter.hpp b/api/direct_bt/BTAdapter.hpp index a96a5871..a87d3158 100644 --- a/api/direct_bt/BTAdapter.hpp +++ b/api/direct_bt/BTAdapter.hpp @@ -43,6 +43,8 @@ #include "HCIHandler.hpp" +#include "DBGattServer.hpp" + namespace direct_bt { class BTAdapter; // forward @@ -317,6 +319,9 @@ namespace direct_bt { device_list_t sharedDevices; // All active shared devices. Final holder of BTDevice lifecycle! typedef jau::cow_darray<impl::StatusListenerPair> statusListenerList_t; statusListenerList_t statusListenerList; + + DBGattServerRef gattServerData = nullptr; + mutable std::mutex mtx_discoveredDevices; mutable std::mutex mtx_connectedDevices; mutable std::mutex mtx_discovery; @@ -920,7 +925,8 @@ namespace direct_bt { * Method fails if isDiscovering() or has any open or pending connected remote {@link BTDevice}s. * * - * If successful, method also changes [this adapter's role](@ref BTAdapterRoles) to ::BTRole::Slave. + * If successful, method also changes [this adapter's role](@ref BTAdapterRoles) to ::BTRole::Slave + * and treat connected BTDevice as ::BTRole::Master while service ::GATTRole::Server. * * * This adapter's HCIHandler instance is used to initiate scanning, @@ -931,6 +937,7 @@ namespace direct_bt { * - Random address for privacy if desired! * - Consider SMP (security) * + * @param gattServerData_ the DBGattServer data to be advertised and offered via GattHandler as ::GATTRole::Server. * @param adv_interval_min in units of 0.625ms, default value 0x0800 for 1.28s; Value range [0x0020 .. 0x4000] for [20ms .. 10.24s] * @param adv_interval_max in units of 0.625ms, default value 0x0800 for 1.28s; Value range [0x0020 .. 0x4000] for [20ms .. 10.24s] * @param adv_type see AD_PDU_Type, default ::AD_PDU_Type::ADV_IND @@ -943,7 +950,8 @@ namespace direct_bt { * @see @ref BTAdapterRoles * @since 2.4.0 */ - HCIStatusCode startAdvertising(const uint16_t adv_interval_min=0x0800, const uint16_t adv_interval_max=0x0800, + HCIStatusCode startAdvertising(DBGattServerRef gattServerData_, + const uint16_t adv_interval_min=0x0800, const uint16_t adv_interval_max=0x0800, const AD_PDU_Type adv_type=AD_PDU_Type::ADV_IND, const uint8_t adv_chan_map=0x07, const uint8_t filter_policy=0x00) noexcept; |