Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
|
Representing a complete list of Gatt Service objects from the GATTRole::Server perspective, i.e. More...
#include <DBGattServer.hpp>
Classes | |
class | Listener |
Listener to remote master device's operations on the local GATT-Server. More... | |
Public Types | |
typedef jau::darray< DBGattServiceRef, size_type > | GattServiceList_t |
typedef jau::cow_darray< ListenerRef, size_type > | ListenerList_t |
typedef std::shared_ptr< Listener > | ListenerRef |
enum class | Mode : uint8_t { NOP = 0 , DB = 1 , FWD = 2 } |
Operating mode of a DBGattServer instance. More... | |
typedef jau::nsize_t | size_type |
Public Member Functions | |
DBGattServer () | |
DBGattServer in Mode::NOP mode. More... | |
DBGattServer (BTDeviceRef fwdServer_) | |
DBGattServer in Mode::FWD to the given forward BTDevice. More... | |
DBGattServer (jau::darray< DBGattServiceRef > &&services_) | |
DBGattServer in Mode::DB mode if given services_ are not empty, otherwise in Mode::NOP mode. More... | |
DBGattServer (uint16_t max_att_mtu_, jau::darray< DBGattServiceRef > &&services_) | |
DBGattServer in Mode::DB mode if given services_ are not empty, otherwise in Mode::NOP mode. More... | |
~DBGattServer () noexcept override | |
bool | addListener (const ListenerRef &l) |
DBGattCharRef | findGattChar (const jau::uuid_t &service_uuid, const jau::uuid_t &char_uuid) noexcept |
DBGattCharRef | findGattCharByValueHandle (const uint16_t char_value_handle) noexcept |
DBGattDescRef | findGattClientCharConfig (const jau::uuid_t &service_uuid, const jau::uuid_t &char_uuid) noexcept |
DBGattServiceRef | findGattService (const jau::uuid_t &type) noexcept |
std::string | get_java_class () const noexcept override |
BTDeviceRef | getFwdServer () noexcept |
uint16_t | getMaxAttMTU () const noexcept |
Used maximum server Rx ATT_MTU, defaults to 512+1. More... | |
Mode | getMode () const noexcept |
jau::darray< DBGattServiceRef > & | getServices () noexcept |
List of Services. More... | |
ListenerList_t & | listener () |
bool | removeListener (const ListenerRef &l) |
bool | resetGattClientCharConfig (const jau::uuid_t &service_uuid, const jau::uuid_t &char_uuid) noexcept |
void | setMaxAttMTU (const uint16_t v) noexcept |
Set maximum server Rx ATT_MTU, defaults to 512+1 limit. More... | |
size_type | setServicesHandles () |
Sets all handles of all service instances and all its owned childs, i.e. More... | |
std::string | toFullString () |
std::string | toString () const noexcept override |
Public Member Functions inherited from jau::jni::JavaUplink | |
JavaUplink () noexcept=default | |
JavaUplink (const JavaUplink &o) noexcept=default | |
JavaUplink (JavaUplink &&o) noexcept=default | |
virtual | ~JavaUplink () noexcept |
virtual void | checkValidInstance () const |
Throws an IllegalStateException if instance is not valid. More... | |
virtual std::string | get_java_class () const noexcept=0 |
const JavaAnonRef & | getJavaObject () noexcept |
std::string | javaObjectToString () const noexcept |
JavaUplink & | operator= (const JavaUplink &o) noexcept=default |
JavaUplink & | operator= (JavaUplink &&o) noexcept=default |
void | setJavaObject () noexcept |
Resets the shared JavaAnon reference, the replaced item might be deleted via JNI from dtor. More... | |
void | setJavaObject (const JavaAnonRef &objRef) noexcept |
Assigns a new shared JavaAnon reference, replaced item might be deleted via JNI from dtor. More... | |
virtual std::string | toString () const noexcept |
Static Public Member Functions | |
static std::string | java_class () noexcept |
static std::string | toModeString (const Mode m) noexcept |
Representing a complete list of Gatt Service objects from the GATTRole::Server perspective, i.e.
the Gatt Server database.
One instance shall be attached to BTAdapter when advertising via BTAdapter::startAdvertising(), changing its operating mode to Gatt Server mode, i.e. GATTRole::Server.
The instance can also be retrieved via BTAdapter::getGATTServerData().
See Direct-BT Overview.
This class is not thread safe and only intended to be prepared by the user at startup and processed by the Gatt Server facility.
Definition at line 705 of file DBGattServer.hpp.
typedef std::shared_ptr<Listener> direct_bt::DBGattServer::ListenerRef |
Definition at line 862 of file DBGattServer.hpp.
Definition at line 864 of file DBGattServer.hpp.
Definition at line 865 of file DBGattServer.hpp.
Definition at line 866 of file DBGattServer.hpp.
|
strong |
Operating mode of a DBGattServer instance.
Enumerator | |
---|---|
NOP | No operation mode, i.e. w/o any DBGattService. |
DB | Database mode, the default operating on given list of DBGattService. |
FWD | Forward mode, acting as a proxy forwarding all requests to a 3rd remote GATT server BTDevice. |
Definition at line 710 of file DBGattServer.hpp.
|
inlineoverridenoexcept |
Definition at line 906 of file DBGattServer.hpp.
|
inline |
DBGattServer in Mode::NOP mode.
Definition at line 916 of file DBGattServer.hpp.
|
inline |
DBGattServer in Mode::DB mode if given services_ are not empty, otherwise in Mode::NOP mode.
max_att_mtu_ | |
services_ |
Definition at line 928 of file DBGattServer.hpp.
|
inline |
DBGattServer in Mode::DB mode if given services_ are not empty, otherwise in Mode::NOP mode.
Ctor using default maximum ATT_MTU of 512+1
services_ |
Definition at line 941 of file DBGattServer.hpp.
|
inline |
DBGattServer in Mode::FWD to the given forward BTDevice.
fwdServer_ |
Definition at line 953 of file DBGattServer.hpp.
|
staticnoexcept |
|
inlinenoexcept |
Used maximum server Rx ATT_MTU, defaults to 512+1.
Definition at line 881 of file DBGattServer.hpp.
|
inlinenoexcept |
Set maximum server Rx ATT_MTU, defaults to 512+1 limit.
Method can only be issued before passing instance to BTAdapter::startAdvertising()
Definition at line 889 of file DBGattServer.hpp.
|
inlinenoexcept |
List of Services.
Definition at line 892 of file DBGattServer.hpp.
|
inlinenoexcept |
Definition at line 894 of file DBGattServer.hpp.
|
inlinenoexcept |
Definition at line 896 of file DBGattServer.hpp.
|
inlinestaticnoexcept |
|
inlineoverridevirtualnoexcept |
Implements jau::jni::JavaUplink.
Definition at line 902 of file DBGattServer.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 982 of file DBGattServer.hpp.
|
inlinenoexcept |
Definition at line 991 of file DBGattServer.hpp.
|
inline |
Sets all handles of all service instances and all its owned childs, i.e.
DBGattChars elements and its DBGattDesc elements.
Start handle is 1
.
Method is being called by BTAdapter when advertising is enabled via BTAdapter::startAdvertising().
( end_handle - handle ) + 1
Definition at line 1013 of file DBGattServer.hpp.
bool DBGattServer::addListener | ( | const ListenerRef & | l | ) |
Definition at line 87 of file DBGattServer.cpp.
bool DBGattServer::removeListener | ( | const ListenerRef & | l | ) |
Definition at line 94 of file DBGattServer.cpp.
|
inline |
Definition at line 1026 of file DBGattServer.hpp.
|
inline |
Definition at line 1028 of file DBGattServer.hpp.
|
overridevirtualnoexcept |
Reimplemented from jau::jni::JavaUplink.
Definition at line 103 of file DBGattServer.cpp.