aboutsummaryrefslogtreecommitdiffstats
path: root/api/direct_bt/DBGattServer.hpp
Commit message (Collapse)AuthorAgeFilesLines
* Introduce BTGattHandler::GattServerHandler and DBGattServer::Mode for ↵Sven Gothel2022-02-021-7/+60
| | | | | | | | | | | | | | alternate GATT Server operational mode New DBGattServer::Mode are - NOP - no-op, - DB - user database GATT server as before using a list of DBGattService, - FWD - proxy: forwarding all GATT requests to another remote GATT server and returning the results Each DBGattServer::Mode has a corresponding BTGattHandler::GattServerHandler implementation to act upon the different GATT requests from a connected client. All three modes are fully implemented.
* DBGatt[Char|Desc] (Server): Add setValue(..), allowing user to safely ↵Sven Gothel2022-01-281-6/+32
| | | | | | | | | | | overwrite (initial) value server side. Also refine getValue() API doc. Implemented on C++ and Java side. Peripheral00 example uses this facility to set the DEVICE_NAME GATT value using the current adapter name.
* Add DBGattServer::Listener::write[Char|Desc]ValueDone() (C++/Java), ↵Sven Gothel2022-01-241-0/+23
| | | | | | | | | | | | | | | notifyies completion of single or bulk writeCharValue() .. BTGattHandler maintains a handle list 'writeDataQueueHandles', grouping all queued writes (PREPARE_WRITE_REQ). Final EXECUTE_WRITE_REQ will issue one applyWrite(..) per queued write-req. If all were successful (accepted and performed), one signalWriteDone() will be issued per handle. This allows the user to react on a completed write-queue having the full data set available. +++
* Enhance API doc: DBGattServer::Listener (C++) and DBGattServer.Listener (java)Sven Gothel2022-01-241-0/+13
|
* Fix DBGattServer::max_att_mtu setup: Constrain over minimum of 512+1, value ↵Sven Gothel2022-01-011-2/+2
| | | | - not maximum (duh!)
* Java JNI: Implement DBGattServer.Listener incl ↵Sven Gothel2021-11-151-1/+0
| | | | DBGattServer.[add|remove]Listener(..)
* DBGattServer.hpp: DBGatt[Desc|Char|Service|Server]: Use jau::JavaUplink for ↵Sven Gothel2021-11-151-12/+29
| | | | | | | | | | | | | | org.direct.bt.DBGattServer.Listener callbacks Finally bringing JavaUplink back, sorry for the earlier confusion of removing them. However, this commit better shows the C++/Java connection used here. The JavaUplink is used at manually ctor of the native counterpart from the Java object, as they will also dtor the native instance. This w/o DBTNativeDownlink, since we pass arguments directly for the native ctor. On the java side, close() properly synchronizes the atomic volatile nativeInstance swap, avoiding data races.
* Complete DBGattServer Lifecycle: Add DBGatt* dtor on Java side; Remove ↵Sven Gothel2021-11-141-0/+7
| | | | BTAdapter held reference on disconnect, align ref holding in Java BTAdapter; Add explicit shutdown test
* DBGatt[Desc|Char|Service]: Use mutable and const field accessors; Remove ↵Sven Gothel2021-11-131-72/+134
| | | | | | | | | | JavaUplink Use mutable and const field accessors, similar to upcoming Java 'proxy' classes. This shall help defining mutable and const reference data access. Revert adding JavaUplink to DBGatt[Desc|Char|Service] of commit 414c81b7214d895aba694ff444feca9cdc491bc5, as we do not link from native instance to Java.
* DBGatt[Desc|Char|Service]: Use shared_ptr references to support Java binding ↵Sven Gothel2021-11-131-75/+114
| | | | and hence derive from JavaUplink
* DBGatt[Char|Desc]::variable_length defaults to false; Add DBGattValue.java ↵Sven Gothel2021-11-091-4/+16
| | | | | | | covering semantics of C++ POctets + bool variable_length DBGattValue covers C++ POctets + bool variable_length, where POctets contains bytes, its size and capacity.
* DBGatt[Char|Desc]::toString(): Show utf8 stringSven Gothel2021-11-091-2/+8
| | | | Java: Use fast BTUtils.decodeUTF8String(), instead of StandardCharsets.UTF_8
* DBGattServer.hpp: Reorder methods a little (readability)Sven Gothel2021-11-091-26/+26
|
* DBGattServer::Listener: Fix API docSven Gothel2021-11-081-11/+6
|
* DBGattServer::Listener: Add connected() and mtuChanged(): Supporting using ↵Sven Gothel2021-11-081-2/+24
| | | | | | | | | proper MTU and connection tracking. In case multiple connections will be supported, DBGattServer::Listener is able to match the connected BTDevice to the callback event. For now, dbt_peripheral00 only supports one connection while ignoring others ..
* BTGattHandler::send[Indi|Notifi]cation(): Constring handle to be of ↵Sven Gothel2021-11-031-0/+18
| | | | characteristic value handle - clarification; Add proper API doc.
* DBGattServer: Add convenience functions to zero values and reset ↵Sven Gothel2021-10-281-0/+25
| | | | ClientCharConfig
* Add DBGattServer::Listener::disconnect(..) for cleanup, example: Full ↵Sven Gothel2021-10-271-0/+23
| | | | cleanup incl. CCCD regs
* DBGattServer / dbt_peripheral00: Use jau::make_darray(..) for proper ↵Sven Gothel2021-10-241-32/+92
| | | | | | | | | | | | | move-semantics; 1st fully functional Gatt-Server! Gatt-Server functionality provided by dbt_peripheral: - Service GENERIC_ACCESS - Service DEVICE_INFORMATION - Service Proprietary `d0ca6bf3-3d50-4760-98e5-fc5883e93712` - Characterictic DATA_STATIC: Read static data - Characterictic COMMAND: Write a command - Characterictic RESPONSE: Command response notify or indicate - Characterictic DATA_PULSE: Periodical data sent via notify or indicate
* DBGattServer::Listener::clientCharConfigChanged() Use const qualifier; ↵Sven Gothel2021-10-191-1/+1
| | | | dbt_peripheral00: Add DBGattDesc::createClientCharConfig() to RESPONSE notify
* Add DBGattServer::Listener::clientCharConfigChanged(..)Sven Gothel2021-10-191-0/+12
|
* DBGattServer:: Add 'variable_length' Desc/Char attribute, add ↵Sven Gothel2021-10-191-10/+66
| | | | | | DBGattDesc::createClientCharConfig(), .. add Listener::write*Value(..) value_offset argument for long write requests
* BTGattHandler/AttPDU: Use safe MAX_ATT_MTU = 512 + 1 for opcode, not for ↵Sven Gothel2021-10-181-1/+3
| | | | other ATTPDU parameter; Better serverMTU max(min(..)) safety, API-doc clarity
* Add DBGattServer::att_mtu, enabling custom max ATT_MTU size (also used for ↵Sven Gothel2021-10-161-1/+4
| | | | testing)
* Adding DBGattServer::Listener allowing server application to react on remote ↵Sven Gothel2021-10-161-10/+73
| | | | GATT action
* DBGattService::setHandles(): Fix end_handle, i.e. it is inclusive, hence ↵Sven Gothel2021-10-141-2/+2
| | | | | | next_handle-1 Also add missing BTGattChar::getPropertiesString() -> to_string() conversion.
* [BT|DB]GattChar::toString(): Add UTF8 user-description if availableSven Gothel2021-10-131-2/+9
|
* [BT|DB]GattChar::getUserDescription() and userDescriptionIndex added (from ↵Sven Gothel2021-10-131-3/+18
| | | | | | descriptor) GattDesc.cpp: Convert TYPE* to std::shared_ptr<jau::uuid_t> (missed in prev commit)
* BTGattDesc: Have TYPE_* static const be of versatile ↵Sven Gothel2021-10-131-3/+3
| | | | std::shared_ptr<jau::uuid_t>; [BT|DB]GattChar::getClientCharConfig() is const
* DBGattServer.hpp: Add DBGattChar::end_handle to simplify processing; add ↵Sven Gothel2021-10-121-6/+39
| | | | DBGattServer::toFullString()
* Prelim add DBGatt[Server, Service, Char, Desc] Java classes (WIP)Sven Gothel2021-10-101-3/+3
|
* DBGattServer.hpp: Add and use DBGattServer, a complete list of Gatt Service ↵Sven Gothel2021-10-101-16/+79
| | | | objects for the Gatt Server database
* Refine API doc of BTGatt[Service|Char|Desc]; BTDevice: Use typedef'ed BTGatt*RefSven Gothel2021-10-101-10/+25
|
* Gatt-Server: Add DBGattServer.hpp, covering DBGattDesc, DBGattChar and ↵Sven Gothel2021-10-071-0/+304
DBGattService