aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* SMPKeyBin: Make key base filename compatible to FAT32 Long filename (LFN)v2.2.6Sven Gothel2021-06-113-8/+51
| | | | | | | | Previous scheme : `bd_C0:26:DA:01:DA:B1:1.smpkey.bin' FAT32 LFN scheme: `bd_C0_26_DA_01_DA_B1_1-smpkey.bin' Tested interoperability with native and java test application.
* Fix direct_bt.pc.cmake package descriptionSven Gothel2021-06-111-3/+3
|
* eclipse cdt changesSven Gothel2021-06-112-5/+7
|
* Bump to jaulin v0.3.3 and adapte to jau:ringbuffer changesSven Gothel2021-06-119-8/+8
|
* Bump READMEv2.2.5Sven Gothel2021-02-221-1/+8
|
* BTDevice::connectLE(..): Add (commented out) enforced BTSecurityLevel::NONE ↵Sven Gothel2021-02-211-0/+8
| | | | | | use case Was used to test SMPKeyBin w/o encryption.
* SMPKeyBin: Allow BTSecurityLevel::NONE case; Add more convenient ↵Sven Gothel2021-02-215-186/+517
| | | | | | | | | createAndWrite(..) and readAndApply(..) one-liner Further: - Bump to version 2 - Add creation timestamp (seconds since epoch) - Convenient createAndWrite(..) and readAndApply(..) one-liner handle overwrite and remove-invalid use-case
* BTDevice::connectLE(..): Set smp_auto_done=true on connect command failureSven Gothel2021-02-211-0/+2
|
* Bump jaulibSven Gothel2021-02-211-0/+0
|
* BTUtils.java: Add 'long wallClockSeconds()'Sven Gothel2021-02-212-4/+20
|
* SMPKeyBin: Use fprintf_td(..) to have elapsedTime prependendSven Gothel2021-02-142-21/+21
|
* BTAdapter/BTDevice: Debug output: Rename [DBT -> BT][Adapter|Device]; ↵Sven Gothel2021-02-143-245/+245
| | | | Default toString() is w/o additional data
* AdapterStatusListener (C++): Have a NOP default implementation for all ↵Sven Gothel2021-02-141-8/+46
| | | | methods but toString() for convenience
* Completing BTDevice/AdapterStatusListener lifecycle handling: Fix leaked ↵Sven Gothel2021-02-1417-452/+940
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AdapterStatusListener Completing BTDevice lifecycle handling comming 30b4e5f0c1f62c92c40a6ccceda8878f88a9521a "AdapterStatusListener::deviceFound: Resolve sharedDevices persistence of found device via return value" Fix leaked AdapterStatusListener: Turns out the introduced mechanism of not adding BTDevice's to sharedDevices list, but keeping them in discoveredDevices (to avoid duplicate scan results), did not consider removing its BTDevice bound AsapterStatusListener (here: DBTDevice.java). Example: - BTDevice found and instance C++/Java is created - Java's BTDevice creates and adds its AdapterStatusListener - All AdapterStatusListener::deviceFound(..) called - User is not interested, all 'AdapterStatusListener::deviceFound(..)' return 'false' - BTDevice remains in discoveredDevices, but not in sharedDevices. * Subsequent clearance of discoveredDevices leaks the AdapterStatusListener: Not removed * AdapterStatusListener::deviceUpdated(..) of the removed BTDevice eventually gets called, but the BTDevice is already deleted * The Java -> JNI call causes our exception: Null reference to native instance! Hence all BTDevice lifecycle bound AdapterStatusListener shall be marked as such, using a StatusListenerPair{AdapterStatusListener, weak_ptr<BTDevice>}. This way, every removed discoveredDevice's BTDevice will remove its associated AdapterStatusListener. Further, every explicitly BTDevice::remove() will remove its associated AdapterStatusListener. New 'BTDevice::addAdapterStatusListener(l)' (C++/Java) performs the required association. +++ On the Java side the discoveredDevices are now only using a WeakReference<BTDevice> to avoid leaking/holding BTDevice instances. +++ This added complexity of 'StatusListenerPair' only exists, b/c discoveredDevices holds complete BTDevice instances. We could have soothed this by just listing BDAddressAndType, but the current API required to query 'List<BTDevice> discoveredDevices' ... +++ BTDevice/BTAdapter: - Use lock-free 'jau::sc_atomic_critical sync(sync_data)' whenever possible, instead of mutex-lock, i.e. merely reading/copy data at an undeterministic point in time --- DBTDevice Misc - Added BTUtil.fprintf_td(..), prepending elapsedTime() - DBTDevice.java: sort method in proper groups: Unsupported, internal, ..
* Bump jaulib 1ad0d850655c13943436f725732bbe7c289957d8Sven Gothel2021-02-141-0/+0
|
* JNI: Fix missed package and class name renaming in jni code.Sven Gothel2021-02-123-7/+7
|
* Bump jaulib v0.3.1Sven Gothel2021-02-111-0/+0
|
* SMPKeyBin::remove: Don't use C++17 stdlib's std::filesystem::remove() per ↵Sven Gothel2021-02-111-2/+10
| | | | | | | | default .. .. it requires linking of a specific C++ lib for certain compiler setup. Use plain stdio remove.
* Bump README; Drop TinyB from title, as it no more covers the new Direct-BT ↵Sven Gothel2021-02-113-9/+17
| | | | API (completely)
* Scanner10: Apply: Key deletion on (bad key) failure (i.e. regenerate key); ↵Sven Gothel2021-02-112-99/+21
| | | | | | | Send 'passkey 0' or 'boolean-confirm false' if no SecDetail has been registered Also always unpair the device before connecting and after processing, ensuring a clean adapter state and no 'left behind' artifacts.
* BTDevice::updatePairingState(..): Accept SMPPairingState::FAILED, to have ↵Sven Gothel2021-02-111-3/+2
| | | | | | | | | | | | | | | | | | | SMP negotiation aborted (Bad Key) HCI informs us with a HCIEventType::ENCRYPT_CHANGE message: HCIStatusCode PIN_OR_KEY_MISSING in case we use a bad key file. (HCIHandler transform the native HCIEventType::ENCRYPT_CHANGE event into a HCI_ENC_CHANGED MgmtEvent, reusing Mgmt's event listener) This can happen if device has been paired with a new and hence different key elsewhere. Then later the device is used on a different machine with an older LTK, which fails. Solution is to delete a potential existing key on pairing failure. [ 9,047] Debug: DBTDevice::updatePairingState.3: state NONE -> FAILED, mode NONE -> NONE, ready 0, MgmtEvt[opcode HCI_ENC_CHANGED, devID 0x0001, address=C0:26:DA:01:DA:B1, addressType BDADDR_LE_PUBLIC, status PIN_OR_KEY_MISSING, enabled 0x00, data[size 0, data ], tsz 15]
* SMPKeyBin: Add static remove(..) method, supporting deletion of key file.Sven Gothel2021-02-113-10/+45
|
* BTDevice::setPairingPasskeyNegative(): Added API doc and missing Java ↵Sven Gothel2021-02-115-1/+70
| | | | | | binding. Hint: Better use setPairingPasskey(passkey = 0) .. .. since current experience exposed a roughly 3s immediate disconnect handshake with certain devices and/or Kernel BlueZ code.
* DBTScanner10: Remove wrong commentSven Gothel2021-02-101-1/+0
|
* Bump jaulib v0.3.0Sven Gothel2021-02-101-1/+0
|
* HCITypes Fix l2cap_frame::isGATT(): Compare with ATT (copy & paste); ↵Sven Gothel2021-02-102-4/+2
| | | | HCIHandler: Don't show well handled ATT packets in DEBUG output
* API String Conversion Simplification: get.*String() -> ↵Sven Gothel2021-02-1033-595/+607
| | | | | | | | | | | | | | direct_bt::to_string() Patch [2/2] This goes along with jaulib's 'hex and decimal string conversion'. API schema for to string conversion: 1 - free function: to_string(type) 2 - main member function: toString() 3 - sub-type member function: getTypeString(Type) 3 avoid overload collision w/ potential virtual toString() method. Additional, 1 is provided for 3 as well
* Bump jaulibSven Gothel2021-02-101-0/+1
|
* API String Conversion Simplification: get.*String() -> ↵Sven Gothel2021-02-106-36/+14
| | | | direct_bt::to_string() Patch [1/2]
* Bump README.mdv2.2.4Sven Gothel2021-02-091-0/+7
|
* Bump jaulib v0.2.24Sven Gothel2021-02-091-0/+0
|
* BTDevice: Fix ERR_PRINT(..) argumentSven Gothel2021-02-091-1/+1
|
* Eclipse cdt setting: Added '-Wno-float-equal' for check2Sven Gothel2021-02-091-2/+2
|
* SC changes of Scanner10 example (C++/Java)Sven Gothel2021-02-092-28/+105
| | | | | | | | | | | | | | | | | | | | | | | | | After having the SMPKeyBin setup/upload exported to SMPKeyBin, further changes to handling security setup was desired: - Upload known passkey if requested and available via 'Preset-SecurityDetail' - Optionally (disabled) upload via runtime input: This should be done pre-connect attempt! Same for NUMERIC_COMPARISON (binary yes/no) .. BTDevice is also no more leaking any PASSKEY or NUMERIC_COMPARISON request if SMPIOCapability is not supporting requested input! If any input is request, not satisfied by 'Preset-SecurityDetail', the device is being removed. This portion is within the 'passkeyInputAndSend()' and 'binaryInputAndSend()', where the runtime input has been disabled. +++ Further: SEC AUTO is enabled (per default using SMPIOCapability::KEYBOARD_ONLY) if - No pre-existing key exists or could not be applied - 'Preset-SecurityDetail' has requested SEC AUTO - 'Preset-SecurityDetail' has no SecLevel or IOCap requested
* BTDevice/BTManager: Decorate all SC code with '#if USE_LINUX_BT_SECURITY' ↵Sven Gothel2021-02-092-0/+63
| | | | | | | | | and if appropriate '#if SMP_SUPPORTED_BY_OS'. Currently we only support the Linux-Kernel Bluez HCI host implementation, which does not fully expose SMP. Hence have all portions tagged properly to add support for other OS later on..
* SMPKeyBin (C++/Java): Add 'apply(BTDevice&)' method, setting Security params ↵Sven Gothel2021-02-095-30/+190
| | | | | | | | | | | | | | | | | | | | | | and uploading available LTKs Moving the SMPKeyBin setup and key-upload for the BTDevice to public SMPKeyBin, providing the proper setup and upload method. One change compared to removed coding in Scanner10 example occured: "BTSecurityLevel::ENC_ONLY is set to avoid a new SMP PairingMode negotiation, which is undesired as this instances' stored LTK shall be used for PairingMode::PRE_PAIRED." i.e.: 'device.setConnSecurity(BTSecurityLevel.ENC_ONLY, SMPIOCapability.NO_INPUT_NO_OUTPUT);' This has been evaluate with a Secure Connections capable LE device using BTSecurityLevel::ENC_AUTH_FIPS and SMPIOCapability::KEYBOARD_ONLY. After initial pairing using a dynamic generated passkey, we connected successfully and stored the LTKs and CSRKs with this connection parameter. Thereafter reconnect after setting (BTSecurityLevel.ENC_ONLY, SMPIOCapability.NO_INPUT_NO_OUTPUT) and uploading stored keys succeeded with Linux Kernel-BlueZ host implementation.
* BTDevice.java: Add isValid() query, i.e. device reference valid and device ↵Sven Gothel2021-02-093-0/+16
| | | | not removed
* Bump jaulib 24858af589132ca063a99980defeb00c3437475cSven Gothel2021-02-091-0/+0
|
* Adapt to reverted constexpr_cxx20 name; Refine constexpr for OctetTypes (thx ↵Sven Gothel2021-02-094-182/+145
| | | | | | | | to jaulib byte get/set/swap) and hence ATTPDUTypes and SMPTypes - Adapt to reverted constexpr_cxx20 name - Refine constexpr for OctetTypes (thx to jaulib byte get/set/swap) and hence ATTPDUTypes and SMPTypes
* Bump jaulib 66452fe7b4c60c5582a45f1cfee5287f3d9b3fdeSven Gothel2021-02-091-0/+0
|
* HCIHandler::hciReaderThreadImpl(): Explicit debug handling of GATT ACL packetSven Gothel2021-02-081-1/+3
|
* Eclipse: Add '-Wno-multichar' for jaulib's "enum class endian" on gcc (not ↵Sven Gothel2021-02-081-0/+2
| | | | having __builtin_bit_cast())
* Fix changed jaulib header namesSven Gothel2021-02-082-2/+2
|
* linux_kernel_types.hpp: Allow !__linux__ compilationSven Gothel2021-02-081-9/+10
|
* OctetTypes: Adopt jau::[get|put]_<type>() constexpr: Mark ↵Sven Gothel2021-02-081-30/+30
| | | | [get|put]_<type>_nc() as constexpr
* Bump jaulib b218b12a155a2f07eabbd02e3fbada3feed3aab7Sven Gothel2021-02-081-0/+0
|
* C++: Promote L2CAP_PSM, L2CAP_CID, .. to 'enum class'; Minor constexpr ↵Sven Gothel2021-02-0812-108/+190
| | | | | | | | | | | | | | | | | | | | | enhancements 'enum' -> 'enum class' w/ all bells and whistles: L2CAP_PSM, L2CAP_CID, AD_Type_Const BTAddress.hpp: Add 'constexpr uint8_t number(..)' constexpr: - equality- and bit-operations on different types: EIRDataType, ManufactureSpecificData - isEIRDataTypeSet(), setEIRDataTypeSet(), setAdapterSettingMaskBit() HCIACLData Cleanup - Use L2CAP_PSM and L2CAP_CID types - Convenient queries if SMP or GATT type - Add toString(..) w/ l2cap_data ptr L2CAPComm: Use L2CAP_PSM and L2CAP_CID types
* Adapt to jau::bytesHexString(..)/<type>HexString(..): Removed leading0X ↵Sven Gothel2021-02-067-44/+44
| | | | argument: Unifying output.
* HCIHandler::hciReaderThreadImpl(): Reuse acldata toString's data outputSven Gothel2021-02-061-3/+1
|
* Bump jaulib; Adapt to jau::bytesHexString(..) removed leading0X argument: ↵Sven Gothel2021-02-0613-64/+66
| | | | | | | Unifying output. Having a leading `0x` always for MSB-First only, unifies the output and hence clarifies semantics of shown results. This is compatible with 'btmon' output.