| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
general use.
Notable, the java classes EUI48, EUI48Sub and BasicTypes are included in direct_bt's jar file
to avoid any inconvenience.
Hence BTUtils's byte[s]HexString(..) simply uses jaulib's BasicTypes s' implementation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
advertising
- EInfoReport: Add write_data(..), producing an AD EIR memory blob compatible with read_data(..).
- Tested via test_adeir01.cpp
Misc
- GAP_T: Add NONE and number(..)
- GAPFlags: Shorten names, add `ALL`
- ManufactureSpecificData: Make it fully functional
- EInfoReport: Expose mutable operations to public
- EInfoReport: Add operator==(..) operation to test results
|
|
|
|
|
|
|
|
|
|
| |
as pure virtual; Add clone() and put(..) member; ..
.. and use immutable `const uuid_t` on client side.
EInfoReport::addService(..): Add missing set(EIRDataType::SERVICE_UUID);
EInfoReport::read_data(..): Add `[[fallthrough]]` and add missing break in switch block.
|
|
|
|
| |
uuid_t::create(const string&) for convenience
|
|
|
|
|
|
| |
Well, the overloaded '<<' operator uses HCIStatusCodeCategory::name() + ':' + (int)value.
Nonetheless, have message() show the actual string value.
|
| |
|
| |
|
|
|
|
| |
each two digits
|
|
|
|
| |
':', hinting its type.
|
|
|
|
|
|
| |
whether jaulib is used or not; BTFactory: Shorten names (API)
direct_bt.jar: Don't use jaulib.jar in its Class-Path (manifest)
|
|
|
|
|
|
|
| |
extras) ..; direct-bt-fat* includes jaulib-fat (standalone)
direct-bt-fat.jar is with Tinyb
direct-bt-fat2.jar is ex Tinyb (merely testing size and encapsulation)
|
|
|
|
| |
EUI48Sub& other) (C++ and Java, both w/ unit tests)
|
|
|
|
| |
native lib loading. Added junit test facility (Java).
|
|
|
|
| |
Char] etc (align naming with direct_bt == java; reduce java code footprint and too long code lines)
|
| |
|
| |
|
| |
|
|
|
|
| |
catch2 dependency (not done yet)
|
|
|
|
|
|
|
| |
Catch2 for own unit tests)
Also: cmake: Add "null-dereference" to NO_ERROR, as it causes trouble with jau::get_uint8(..) with "-O3"
See jaulib commit db34007f905dab9feeba16e95c16d84bfb0ff11a
|
|
|
|
| |
settings for all, avoiding confusion.
|
| |
|
| |
|
|
|
|
| |
jaucpp, namespace jau
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test_mm_sc_drf_01 (mutex lock + condition-wait)
Turns out SC-DRF does work very well on modified non-atomic memory within
an atomic or locked-mutex acquire/release critical block.
Issues were within the test code itself.
Both tests follow the same 'waiting for their turn' semantics.
- test_mm_sc_drf_00 using atomic + spin-lock
- test_mm_sc_drf_01 using mutex lock + condition-wait
+++
On raspi4b-aarch64 (4 cores, 1.5GHz, loops=100, DEBUG=OFF, -O3)
'test_mm_sc_drf_00' is extremely slow using ~18s,
while 'test_mm_sc_drf_01' uses ~0.6s only.
On raspi3b-arm32 (4 cores, 1.4GHz, loops=100, DEBUG=OFF, -O3)
'test_mm_sc_drf_00' is extremely slow using ~36s,
while 'test_mm_sc_drf_01' uses ~0.9s only.
"./build-*/test/direct_bt/test_mm_sc_drf_00 -loop 100"
|
|
|
|
|
|
| |
spinlock to test SC-DRF
Renamed atomic SC-DRF test_mm_sc_drf -> test_mm_sc_drf00
|
|
|
|
|
|
|
|
|
|
|
| |
written within an atomic acquire/release
Seemingly the non-atomic read and write operation encapsuled in critical section of atomic acquire/release
is not consistent with the atomic value (using multiple write threads?)
Compare to Herb Sutter's 2013-12-23 slides p19, first box "It must be impossible for the assertion to fail – wouldn’t be SC.".
Hence we probably need to lock a mutex for this synchronization
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
C++ Libs -> none (2x)
Java Jar -> none
Java JNI Libs -> C++ Lib + Java Jar (2x)
C++ Examples -> C++ Libs
Java Examples -> Java Jar
Test -> C++ Lib
+++
scripts/[re]build.sh uses `getconf _NPROCESSORS_ONLN`
for the make -j <number of parallel processes>.
|
|
|
|
|
|
| |
'enum class' type
In case of an internal error, simply ERR_PRINT and abort, usually the toString() implementations.
|
|
|
|
|
|
|
|
|
| |
i.e. Debian 10 Buster with GCC 8.3)
GCC 10.1 mostly covers C++20 and is default on Debian 11 Bullseye, we will move there when established.
For now let's use C++17 at least, especially since GCC C++ ABI fixes a few code generation issues
and we intend to further simplify our C++ codebase.
|
|
|
|
| |
declaration where needed; Fix source accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FunctionDef<..>::cloneFunction() ...
Enhance efficiency
- Equality: Check pointer first
- CaptureInvocationFunc function spec uses 'I& data', by reference
- CaptureInvocationFunc ctor supports 'I&& data' move-ctor
and 'const I& data' copy-ctor w/ later copy (instead relying of in place)
- Added FunctionDef ctor for naked InvocationFunc<..> for convenience
- Added FunctionDef getFunction(), allowing user to 'see' the
InvocationFunc<..> shared instance.
+++
FunctionDef: Create InvocationFunc<..>::clone() and FunctionDef<..>::cloneFunction() ...
- This allows user to reproduce an identical InvocationFunc<..> polymorph instance (copy-ctor)
- Such instance can be used to reproduce an identical FunctionDef later on,
here intended for a listener vector equality test for removal.
Allowing not to use any intermediate data types.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
capture instance
Commit efa490bc3f55b1af072b5159d075afece018991f introduced StdInvocationFunc,
which utilized std:function for capturing lambdas.
Since it requires to pass a unique key for equality operation,
it is rather a poor workaround for capturing lambdas.
CaptureInvocationFunc allows one explicit capture data type to be stored,
which will be implicitly passed to the custom function @ invoke.
The bindCaptureFunc(..) allows to set dataIsIdentity=false (defaults to true),
i.e. ignore the capturing data to be compared in the equality operation.
CaptureInvocationFunc allows producing FunctionDef using lambdas on-the-fly,
w/o specifying an explicit unique key and dropping the usage of
a more complex std::function instance.
|
|
|
|
|
|
|
|
|
|
|
|
| |
lambdas
StdInvocationFunc wraps std::function, while using a given unique uint64_t identifier
used for equality operations, as std::function doesn't support the very same.
std::function support allows using capturing lambdas in C++11,
which we require for on the fly callbacks.
Since we haven't figured out yet how to properly wrap capturing lambdas
otherwise via PlainInvocationFunc, StdInvocationFunc must do it until.
|
|
|
|
|
|
|
|
|
|
|
| |
(non-class-member) support
To support on-the-fly lambda non-member functions for callbacks,
we need to bind to same non-member plain functions.
Hence rename ClassFunction -> FunctionDef and add PlainInvocationFunc for this purpose.
Tested via C++ unit test test_basictypes01.cpp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
part probably broken)
We have experienced the following using the official HCI communication channel:
- Lower connect performance with discovery enabled
- Instability with enabled discovery and breaking general BT adapter state
requiring a 'hciconfig hci0 reset'
- Lack of notifications: start/stop discovery/connect/...
- Lack of certain settings in general: pin, ..
This commit implements discovery including listening to all BlueZ kernel events
from the BlueZ Manager channel using DBTManager.
TODO: Figure out how to enforce quick connect!
- EInfoReport (EIR) added: FLAGS, DEVICE_CLASS, APPEARANCE, HASH, RANDOMIZER and DEVICE_ID
- including parsing new segments in read_data(..) and dataSetToString(..) exposure
- DBTManager adds:
- manager-reader thread, putting all command status/completes to its ringbuffer
and sending out all other events to its listener.
- Respecting the chosen BTMode (side-effect to discovery etc)
- add: start/stop discovery
- add: connect/disconnect (incomplete)
- DBTAdapter:
- discoverDevices -> discoverDevicesMgmt is becoming redundant,
now simply waiting for the DeviceFound event.
Will be deleted - TODO!
- mgmtEvDeviceFoundCB shall perform remaining EIR parsing
and enqueing the devices plus issuing respective discovery callbacks!
TODO.
- DBTDevice adds:
- BDAddressType
- HCISession's HCIComm is now no more used (to be deleted!)
- HCIComm adds generic read/write methods, mutex free.
- Remaining HCI 'managment' methods are also subject to deletion!
- GATTHandler / DBTManager: only use a mtx_write for communication,
as reading is performed on their respective threads using a ringbuffer.
Here only concurrent write access needs to be managed.
(DBTManager uses its own HCIComm's mutex.)
- MgmtTypes adds:
- BTMode for dual, BREDR or LE only.
- MgmtRequest -> MgmtCommand
- Unifies the command opcodes to global 'MgmtOpcode',
removing duplicate MgmtCommand::Opcode (which was also incomplete)
- Adding MgmtDisconnectCmd, MgmtEvtDiscovering, MgmtEvtDeviceFound
MgmtEvtDeviceConnected, MgmtEvtDeviceDisconnected
- TOctets adding get_int8(..) and get_eui48(..)
- TOctets adding put_eui48(..)
++++++++++++++
New ClassFunction: Introducing versatile C++ function-method type
used for our DBTManager callbacks.
In contrast to std::function and std::bind, ClassFunction allows
using its specific type (return- and argument types)
and offering the equality operation to test its identity.
The latter is essential to remove a callback ClassFunction
from a list of callbacks.
+++++++++++++++++
Further code cleanup is also included
- Address_T -> BDAddressType(incl string presentation) + HCIAddressType
- ManufactureSpecificData using POctets
- Convenient default param: uint*HexString(.., const bool leading0X=true);
- MgmtTypes's get/put for events and commands use MGMT_HEADER_SIZE offset
- MgmtTypes: Remove doubled 'btohs', as the pdu.get* commands
already perform endian conversion.
- EInfoReport::read_data(..) validate segment size before type conversion
|
|
|
|
|
| |
- Fix BluetoothFactory: Group implementation identification (class-name and lib-names)
- Renaming using 'DBT' prefix, easing identification (java and HCITypes -> DBTTypes)
|
| |
|
|
protocol stack w/o D-Bus bluetoothd.
By dropping BlueZ userspace D-Bus bluetoothd, we target high-performance reliable bluetooth support
with least dependencies for embedded device configurations.
See COPYING, describing which Linux Kernel BlueZ IOCTL information has been included in the source tree.
We claim Linus Torvalds's Linux Kernel license exception regarding kernel syscalls (ioctl):
<https://github.com/torvalds/linux/blob/master/LICENSES/exceptions/Linux-syscall-note>
and hence maintain this project's license.
The new direct_bt feature set is organized as follows
- include/cppunit
- api/direct_bt
- api/ieee11073
- src/direct_bt
- examples/direct_bt
Note that the C++ direct_bt layer is not backward compatible to tinyb.
Since the Java layer still needs to be completed,
it has to be seen whether we will achieve compatibility
or drop the original D-Bus tinyb module altogether
in favor of a more streamlined API and implementation.
Current state allows scanning for LE devices, connecting
and parsing GATT plus receiving notifications and indications.
See examples/direct_bt_scanner/dbt_scanner.cpp.
The Linux Kernel BlueZ is configured via module MgmtComm.[hpp/cpp]
|