aboutsummaryrefslogtreecommitdiffstats
path: root/api/direct_bt
Commit message (Collapse)AuthorAgeFilesLines
* HCI|L2CAP Ioctl Header require paused pedantic and zero-length-array warning ↵v3.3.2Sven Göthel2024-05-262-0/+16
| | | | (due to new strict pedantic setting)
* jau::bytesHexString(): Adjust to API changeSven Göthel2024-05-253-42/+42
|
* Fix or silent clang-tidy issuesSven Göthel2024-05-255-16/+15
|
* Adopt to jaulib: clangd/cland-tidy integration; Use VersionNumberSven Göthel2024-05-252-2/+4
|
* ATTPDUTypes: Enhance AttPDUMsg by using either AttPDUFixedMsg (fixed array) ↵Sven Göthel2024-05-201-130/+219
| | | | or AttPDUHeapMsg (heap dynamic); AttPDUMsg* now use deleted copy and move ctor
* Adding missed fixes: Use string::starts_with(); Use jau::zero_bytes_sec() ↵Sven Göthel2024-05-205-17/+14
| | | | instead of bzero() directly
* AttException: Move string type, pass {pr, x}valueSven Göthel2024-05-201-1/+1
|
* Adopt to jaulib's Exception rename and restructuringSven Göthel2024-05-203-27/+17
|
* BTDevice::getGattGenericAccess(): Add noexceptSven Göthel2024-05-201-1/+1
|
* jaulib: Bump and adopt to enum type name changes, added '_t'Sven Göthel2024-05-1210-35/+35
|
* Cleanup/Fix: C++20, clang-16 + clang-tidy-16, gcc 12.2, latest jaulib, ↵Sven Göthel2024-05-042-2/+2
| | | | passing all tests w/ gcc + clang + java17 build
* Bump jaulib and adopt to jaulib byte_util API change (commit ↵Sven Göthel2024-03-0210-57/+57
| | | | 147e17b0b41a123b2f4040cbd6df5b73b7e97164)
* Adopt to jaulib commit d658b6059d7e7513b60c5c67019b76c9cd3f809bSven Göthel2024-02-256-41/+41
|
* BTDevice: Properly expose isPrePaired() to Javav3.2.3Sven Gothel2023-11-241-1/+8
|
* BTDevice: API Doc: Detail RSSI and Tx Power LevelSven Gothel2023-11-241-2/+33
|
* BTDevice::pairing_data.is_pre_paired: Set on uploadKeys() post setup, ↵Sven Gothel2023-11-241-1/+5
| | | | aligned for all cases (C++ and Java, via setSMPKey() or manual)
* BTAdapter: Remove redundant startDiscovery overload w/o DBGattServerRef and ↵Sven Gothel2023-10-291-58/+2
| | | | have full startDiscovery variant use DBGattServerRef default nullptr arg
* DBGattServer/Value: Add convenience make[_gatt]() for initializer list (byte ↵v3.2.2Sven Gothel2023-10-281-0/+11
| | | | array) with extra capacity and size
* DBGattServer/Value: Add convenience make[_gatt]() for initializer list (byte ↵Sven Gothel2023-10-281-0/+6
| | | | array)
* BTGattCmd: Response: Add DataCallback, add setting minimum response size, ↵Sven Gothel2023-10-281-0/+34
| | | | add sendOnly(..) to skip waiting for response
* BTGattHandler::BTGattHandler: Pick BTAdapter::getGATTServerData() also in ↵Sven Gothel2023-10-271-1/+60
| | | | | | | | | | | | | GATTRole::Client; BTAdapter::startDiscovery() add DBGattServerRef ref A GattServerHandler(DBGattServer) is also possible for LL master (GATT client) connections where the server inquires certain data points within the client's GATT. User can pass DBGattServer to BTAdapter::startDiscovery() to enable the GattServerHandler for such cause. Test case: Avalun's LabPad device - DBTLabPadClient01.java - dbt_labpadclient01.cpp
* Convenience: Add DBGattValue.make(..) for java and 'POctets make_gvalue(..)' ↵Sven Gothel2023-10-271-0/+28
| | | | for C++ for general use (commonly used to ctor a DBGattServer)
* GATT Server Auth: Cleanup sec_levl + io_cap validation and transition, ↵Sven Gothel2023-10-261-22/+54
| | | | | | | | | | | | | | | | | | | | | utilizing sec_level_server, io_cap_server in server mode In server mode, pre-set and validated sec_level_server, io_cap_server are handled as follows: (1) io_cap_server gets set in the manager before start advertising and actual when connected at mgmtEvDeviceConnectedHCI() the manager setting is propagated to the device via notifyConnected() (2) sec_level_server is also propagated to the device when connected at mgmtEvDeviceConnectedHCI() via notifyConnected(). It subsequently is set on the L2CAP at BTDevice::processL2CAPSetup() on the server l2cap connection. +++ Renamed 'ioCap'* -> 'io_cap'* for readability as we don't regularly use camel-case for fields here.
* LE Resolvable Address: Handle identity- and resolvale-private-address (RPA), ↵Sven Gothel2023-10-255-26/+102
| | | | | | | | | | | | | | | | | | | using RPA/IRK crypto matcher for HCI events (passing RPA) HCIConnectionRef and BTDevice store both address pairs, naming the potential RPA as 'visibleAddressAndType'. BTAdapter's findDevice*() method seeks through all device's address first and if the potential RPA is not found queries each device whether it matches with its IRK (if existing). In case the latter is positive, the identity address has been found. Naturally, to have this work, the adapter (in server mode) needs to upload all keys to the host adapter to allow resolving as well as instantiating all devices per key-set. This concept has already been implemented, hence the IRK resolution change-set is not too dramatic. Trial unit tests passed.
* HCIHandler: Remove reset{->HCI}() from publicSven Gothel2023-10-251-18/+11
|
* HCI resolvable functions: HCIHandler: Only issue resolvable function if ↵Sven Gothel2023-10-251-0/+46
| | | | supported, fix DBG_PRINT, add missing declarations
* LE Resolvable Address: Support IRK: SMPIdentityResolvingKey (IRK w/ added ↵Sven Gothel2023-10-254-55/+140
| | | | id_address), SMPKeyBin storage and host upload, w/ clearing all IRKs on startup
* LE Resolvable Address: Add tinycrypt, supporting AES to match IRK w/ LE ↵Sven Gothel2023-10-253-1/+59
| | | | Random Address, made available in SMPIdentityResolvingKey and BTDevice
* GATT Server Auth: Expose PASSKEY_NOTIFY from BTManager -> BTDevice; App ↵Sven Gothel2023-10-233-10/+41
| | | | using AdapterStatusListener::devicePairingState() + SMPPairingState::PASSKEY_NOTIFY to display generated PassKey
* GATT Server Auth: MgmtEvent: Add PASSKEY_NOTIFY -> MgmtEvtPasskeyNotify mappingSven Gothel2023-10-231-1/+36
|
* HCIHandler: Add support for HCI resolvable functions: add, del, clear, ↵Sven Gothel2023-10-232-3/+60
| | | | | | | | | | | | | | | read.., set.. NOTE that the following seem not to be supported in Linux/BlueZ: - LE_READ_PEER_RESOLV_ADDR - LE_READ_LOCAL_RESOLV_ADDR The others are coded within BlueZ, but I received 0x01 UNKNOWN_COMMAND as a HCIStatusCode Used kernel for analysis: - bluetooth-next 2022-04-01 - 38a1944deda4d96ca04b9aaa51ee5ae879b61aa0
* Sync Java with C++ and tag API changes; All trial unit tests passedSven Gothel2023-10-222-3/+10
| | | | | | | | API Changes for v3.2.0: - BTAdapter: - setPrivacy(bool) added - initialize() w/o args or default args removed - initialize(final BTMode btMode, boolean powerOn) added
* Adapter Random Address (WIP): Add BTAdapter::setPrivacy() and intercepting ↵Sven Gothel2023-10-223-0/+34
| | | | | | | | | new-IRK FIXME: Passing a HCILEOwnAddressType other than PUBLIC for "LE set scan Param" after setPrivacy(true) via BTManager results in failure. TBD: Seems like the mngr API and HCI is not aligned or my adapter revolts.
* BTManager::handleCurrentSettingsReply(): Added to unify setMode() and ↵Sven Gothel2023-10-221-0/+2
| | | | setDiscoverable() mode change replies
* BTAdapter/BTManager: Initialize BTAdapter w/ optional power-on, allowing ↵Sven Gothel2023-10-222-5/+6
| | | | subsequent power-off settings w/o toggling power again
* Adapter Random Address: Add visibleMACType = HCILEOwnAddressType::PUBLIC and ↵Sven Gothel2023-10-222-2/+3
| | | | use it for BTAdapter::startDiscovery() and BTDevice::connectLE()
* MgmtPinCodeReplyCmd: Use given pin_code size and add std::string variant, ↵Sven Gothel2023-10-203-2/+20
| | | | zero pin-code array first; Support PinCode throughout BTManager/BTDevice.
* C++20: MgmtTypes: Have name length enums as jau::nsize_t, aligning to same ↵Sven Gothel2022-12-311-16/+16
| | | | param types and enum types in algebraic expressions
* C++20: Use C++17/20 compatible std::memory_order* valuesSven Gothel2022-12-311-4/+4
|
* C++20: Drop constexpr for std::string return valuesSven Gothel2022-12-312-32/+32
|
* Replace remaining std::function with jau::functionSven Gothel2022-11-281-2/+2
|
* clang-tidy fixes part-4 / 4: Use 'const T&' for arguments on listener typesSven Gothel2022-11-283-36/+36
| | | | | | - AdapterStatusListener - BTGattHandler::NativeGattCharListener - DBGattServer::Listener
* clang-tidy fixes part-3 / 4, adding Check `performance-*`Sven Gothel2022-11-2818-75/+80
| | | | | | | | | | | | | | See also jaulib commit 9160f9a4b74f5e5ae07f715025ea4d3aafdf6ab3 Details: - Using 'const T&' as method argument type where applicable, i.e. not when required to pass value off-thread. - Notable: Can also hold a default value! - Using `const T&` in range-loop where applicable - Drop std::move for trivial types - ...
* clang-tidy: cover modernize-pass-by-value, handle modernize-use-equals-deleteSven Gothel2022-11-2711-41/+41
|
* BTDeviceRegistry.hpp: Resolve recursive include via DirectBT.hppSven Gothel2022-11-271-1/+1
|
* clang-tidy fixes part-1Sven Gothel2022-11-2717-120/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Details - Use 'size_type' instead of 'int', propagate same 'size_type' into 'darray' etc. - Use 'std::make_shared', 'std::make_unique' - Use range-based for loops - Remove redundant 'virtual', use 'override' in derived classes - Use 'nullptr' - Use default impl for dtor, ctor (incomplete) - Use copy and std::move (incomplete) - Explcitly catch std::bad_alloc in 'new' in 'noexcept' -> 'abort' - 'abort' was issued implicitly in noexcept methods - L2CAPServer, L2CAPClient, NopGattServerHandler, DBGattServerHandler, FwdGattServerHandler - Use local close_impl(), usable in virtual destructor - L2CAPClient::read, HCIComm::read - preset 'poll' result 'n', avoid garbage comparison - BTAdapter::enableListening - loop through addMgmtEventCallback() result - JNI code - explicit size_type is cast to jsize or jint w/o check - unchanged semantics
* AttPDUMsg*, SMPPDUMsg*: Place check_range() to final type, avoid ↵Sven Gothel2022-11-272-108/+209
| | | | vtable-mess; Have all msg creation ctor check range.
* Change all callback return type: dummy 'bool' -> 'void', now enabled by ↵Sven Gothel2022-09-165-38/+36
| | | | jau::function<void(A...)>
* Adopt to jau::function<R(A...)> from jau::FunctionDef<>Sven Gothel2022-09-166-14/+14
|
* HCIHandler::resetAdapter(): Add optional HCIHandler::PostShutdownFunc ↵Sven Gothel2022-09-151-9/+30
| | | | | | | argument, allowing BTAdapter::reset() to wait until all devices are disconnected before powering-up again Waiting for all disconnections within reset after shutdown phase determines the state of all devices before powering up.