aboutsummaryrefslogtreecommitdiffstats
path: root/src/direct_bt
Commit message (Collapse)AuthorAgeFilesLines
* Align to jaulib 1.3.3: Full cmake-presets usage w/ vscode support update; ↵v3.3.3Sven Göthel2024-08-091-2/+11
| | | | | | | | | | also use cmake target_{link|compile}_options instead of globals Example run scripts were also adopted. Unit and trial tests passed on amd64 machine. VSCode(ium) IDE integration manually tested.
* Adopt to jaulib: clangd/cland-tidy integration; Use VersionNumberSven Göthel2024-05-251-1/+1
|
* ATTPDUTypes: Enhance AttPDUMsg by using either AttPDUFixedMsg (fixed array) ↵Sven Göthel2024-05-202-9/+9
| | | | or AttPDUHeapMsg (heap dynamic); AttPDUMsg* now use deleted copy and move ctor
* Misc NOLINT() reviewsSven Göthel2024-05-202-3/+4
|
* Use jau::zero_bytes_sec() instead of ::bzero() directlySven Göthel2024-05-203-19/+11
|
* SMPKeyBin: Use string starts_with()Sven Göthel2024-05-201-2/+1
|
* jau::cow_darray<>::equal_comparator is noexceptSven Göthel2024-05-206-20/+11
|
* BTAdapter: Catch potential exceptions at debug print*() methodsSven Göthel2024-05-201-34/+37
|
* Fix BTAdapter ctor: Use local adapterInfo instance, not moved value adapterInfo_Sven Göthel2024-05-201-2/+2
|
* Adopt to jaulib's Exception rename and restructuringSven Göthel2024-05-208-26/+19
|
* BTDevice::getGattGenericAccess(): Add noexceptSven Göthel2024-05-201-1/+1
|
* Add jaulib jau::os::get_platform_info() (jau::os, jau::cpu) code and show ↵Sven Göthel2024-05-121-4/+7
| | | | info in test.
* jaulib: Bump and adopt to enum type name changes, added '_t'Sven Göthel2024-05-1210-53/+53
|
* Cleanup/Fix: C++20, clang-16 + clang-tidy-16, gcc 12.2, latest jaulib, ↵Sven Göthel2024-05-046-12/+13
| | | | passing all tests w/ gcc + clang + java17 build
* Bump jaulib and adopt to jaulib byte_util API change (commit ↵Sven Göthel2024-03-0210-69/+69
| | | | 147e17b0b41a123b2f4040cbd6df5b73b7e97164)
* Adopt to jaulib commit d658b6059d7e7513b60c5c67019b76c9cd3f809bSven Göthel2024-02-255-11/+11
|
* BTAdapter::mgmtEvDeviceFoundHCI: Only unpair() shared and non-discovered ↵Sven Gothel2023-11-241-1/+1
| | | | | | device if not pre-paired Avoid losing device pairing if performed via Direct-BT in case explicit startDiscovery() purged discovered devices.
* BTDevice::setSMPKeyBin: Align C++/Java code using setSMPKeyBin()Sven Gothel2023-11-241-3/+10
|
* BTDevice::pairing_data.is_pre_paired: Set on uploadKeys() post setup, ↵Sven Gothel2023-11-241-4/+8
| | | | aligned for all cases (C++ and Java, via setSMPKey() or manual)
* BTAdapter::startDiscovery: Use given DBGattServerRef in already discovering ↵Sven Gothel2023-11-231-0/+1
| | | | state
* BTAdapter: Add debug/verbose msg w/ printDeviceLists()Sven Gothel2023-11-231-6/+35
|
* LE Resolvable Address: BTDevice::hciSMPMsgCallback: Fix IRK responder ↵Sven Gothel2023-11-051-1/+1
| | | | properties: Use irk_resp (copy/paste bug) and SMPIdentityResolvingKey::Property::RESPONDER
* BTGattCmd: Response: Add DataCallback, add setting minimum response size, ↵Sven Gothel2023-10-281-10/+26
| | | | add sendOnly(..) to skip waiting for response
* BTGattHandler::BTGattHandler: Pick BTAdapter::getGATTServerData() also in ↵Sven Gothel2023-10-272-3/+18
| | | | | | | | | | | | | 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
* BTGattHandler::GattServerHandler::replyReadByTypeReq: Add BT Core Spec v5.2: ↵Sven Gothel2023-10-271-10/+45
| | | | Vol 3, Part G GATT: 4.8.2 Read Using Characteristic UUID
* GATT Server Auth: Validate encryption and authentication requirements in ↵Sven Gothel2023-10-261-0/+44
| | | | | | | | | | | server mode The actual used security level shall match the required (user-set) level as follows - Don't care if request is < ENC_ONLY - If request == ENC_ONLY, actual must be >= ENC_ONLY - If request >= ENC_AUTH, actual must be >= ENC_AUTH Here we do ignore ENC_AUTH_FIPS, as not all devices/adapter support it yet.
* GATT Server Auth: BTDevice::processL2CAPSetup don't set sec_level w/ ↵Sven Gothel2023-10-261-4/+7
| | | | | | authentication in server mode; Read-out l2cap's actual sec_level when paired This state works w/ pairing against an Android phone using Random Private Address and authentication.
* GATT Server Auth: BTAdapter::smp_timeoutfunc shall not timeout in ↵Sven Gothel2023-10-261-0/+5
| | | | authentication mode
* GATT Server Auth: Cleanup sec_levl + io_cap validation and transition, ↵Sven Gothel2023-10-262-125/+211
| | | | | | | | | | | | | | | | | | | | | 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.
* BTAdapter::disconnectAllDevices(): Ensure disconnected device is actually ↵Sven Gothel2023-10-251-1/+4
| | | | | | | | removed even if disconnect failed (power-off case) Notable was a failed pairing attempt causing the adapter to reset (power cycle). The disconnect command was unable to succeed, hence survived in the connected list and subsequent startAdvertising faild.
* LE Resolvable Address: Handle identity- and resolvale-private-address (RPA), ↵Sven Gothel2023-10-254-44/+153
| | | | | | | | | | | | | | | | | | | 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-24/+17
|
* HCI resolvable functions: HCIHandler: Only issue resolvable function if ↵Sven Gothel2023-10-251-14/+21
| | | | supported, fix DBG_PRINT, add missing declarations
* LE Resolvable Address: Support IRK: SMPIdentityResolvingKey (IRK w/ added ↵Sven Gothel2023-10-253-32/+149
| | | | 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-254-12/+160
| | | | Random Address, made available in SMPIdentityResolvingKey and BTDevice
* HCI resolvable functions: HCIHandler shall only report DBG messages; ↵Sven Gothel2023-10-233-7/+21
| | | | BTAdapter clear resolvable list at 1st init, BTDevice del from resolvable list at disconnect
* GATT Server Auth: Expose PASSKEY_NOTIFY from BTManager -> BTDevice; App ↵Sven Gothel2023-10-233-0/+39
| | | | using AdapterStatusListener::devicePairingState() + SMPPairingState::PASSKEY_NOTIFY to display generated PassKey
* GATT Server Auth: MgmtEvent: Add PASSKEY_NOTIFY -> MgmtEvtPasskeyNotify mappingSven Gothel2023-10-232-1/+3
|
* HCIHandler: Add support for HCI resolvable functions: add, del, clear, ↵Sven Gothel2023-10-232-0/+113
| | | | | | | | | | | | | | | 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
* HCIHandler: Reuse opcode from request and use to_string for error messagesSven Gothel2023-10-231-5/+5
|
* HCIHandler::receiveCommandComplete(..): Preserve returned CMD_STATUS error ↵Sven Gothel2023-10-231-0/+4
| | | | status
* Sync Java with C++ and tag API changes; All trial unit tests passedSven Gothel2023-10-221-4/+16
| | | | | | | | 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-222-0/+73
| | | | | | | | | 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::initializeAdapter(): Disable Privacy and reorder modes BREDR -> ↵Sven Gothel2023-10-221-4/+9
| | | | LE for clarity
* BTManager::handleCurrentSettingsReply(): Added to unify setMode() and ↵Sven Gothel2023-10-221-27/+13
| | | | setDiscoverable() mode change replies
* BTAdapter/BTManager: Initialize BTAdapter w/ optional power-on, allowing ↵Sven Gothel2023-10-222-18/+13
| | | | subsequent power-off settings w/o toggling power again
* Adapter Random Address: Add visibleMACType = HCILEOwnAddressType::PUBLIC and ↵Sven Gothel2023-10-223-7/+5
| | | | use it for BTAdapter::startDiscovery() and BTDevice::connectLE()
* BTAdapter::smp_timeoutfunc: Clear smp_events after warning/ignore msg (OK); ↵Sven Gothel2023-10-202-1/+6
| | | | BTDevice::updatePairingState/hciSMPMsgCallback: Clear smp_events after pairing completion
* MgmtPinCodeReplyCmd: Use given pin_code size and add std::string variant, ↵Sven Gothel2023-10-202-1/+73
| | | | zero pin-code array first; Support PinCode throughout BTManager/BTDevice.
* Adopt to jaulib ringbuffer changes v1.0.1-8-g854a714Sven Gothel2023-01-014-4/+20
|