| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
copy-ctor; Disable its compilation and preserve resources.
GATT_SERVICES .. etc were merely created as a proof of concept to compile a complex static structure
representing detailed GATT services with its characteristics etc.
Its usage has been fixed to avoid std::initialize_list and copy-ctor.
One can enable its compilation and linkage
by defining `DIRECTBT_BUILDIN_GATT_SERVICE_CHARACTERISTIC_SPEC`.
|
| |
|
|
|
|
| |
(redundant in all these cases though)
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
argument: Unifying output.
|
|
|
|
| |
Char] etc (align naming with direct_bt == java; reduce java code footprint and too long code lines)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(performance and CoW correctness)
Merging jaulib's darray and cow_darray into direct_bt.
As explained in jaulib, motivation behing darray + cow_darray
is to allow fine grained controll over the CoW's storage
to have certain guarantess on its operation.
Iterator and push_back() enhancments are a few of these.
Fixes performed while replacing:
- DBTDevice getGATTServices(): Take the copy as it will be returned.
- GATTHandler removeAllAssociatedCharacteristicListener(): Try to delete all matching!
Don't stop loop after found and erased first, continue.
Also return number of erased elements, not just true.
- DBTManager ctor: Don't work on CoW snapshot, work on CoW
- Simplified many loops / iterations
|
|
|
|
|
|
|
|
|
| |
allocations to one
smart_ptr change series, commit #5
This series started with commit cafd8d1f3689135eae36854a9cca4def690045fd,
see for details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Revises commit 1f6e924fe05ed45bfa4d0d901af2c4df6c1abab5
Use jau::nsize_t and jau::snsize_t where appropriate
- OctetTypes.hpp: TROOctets*
- ATTPDUTypes.hpp: AttPDUMsg*
- HCITypes.hpp: HCIPacket*
- HCIComm.hpp: HCIComm
- L2CAPComm.hpp: L2CAPComm
- MgmtTypes.hpp: MgmtCommand*, MgmtEvent*
- UUID.hpp: uuid_t
- DBTManager, GATTHandler, HCIHandler
- HCIComm.hpp: HCIComm
- BTTypes.hpp
- DBTTypes.hpp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
timestamp is uint64_t
- AttPDUMsg
Use size_t where appropriate
- OctetTypes.hpp: TROOctets*
- ATTPDUTypes.hpp: AttPDUMsg*
- HCITypes.hpp: HCIPacket*
- HCIComm.hpp: HCIComm
- L2CAPComm.hpp: L2CAPComm
- MgmtTypes.hpp: MgmtCommand*, MgmtEvent*
- UUID.hpp: uuid_t
- DBTManager, GATTHandler, HCIHandler
- HCIComm.hpp: HCIComm
- BTTypes.hpp
- DBTTypes.hpp
|
|
|
|
| |
jaucpp, namespace jau
|
|
|
|
| |
and erroneous missing data handle nicely (no crash)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(pre-checked)
- *Octets: Add put_*_nc(..) noexcept variants and use it where range has been pre-checked
- ATTPDU: Use noexcept variant for prechecked value range.
- DBTManager/HCIHandler: Use noexcept variant for prechecked value range.
+++
TODO: Bug 4 - *Octets get_[w]ptr(..) methods shall be given a value range for security (exception)
(https://jausoft.com/bugzilla/show_bug.cgi?id=4>
*Octets get_[w]ptr(..) methos with exception should check the intended used range!
Either the range has been pre-checked, then user shall use the noexcept '_nc' variant,
otherwise the intended range shall be checked within the call for safety!
Note: Both variants shall have the range given for compatible signature,
as well as to force the user to determine the range
and then decide whether noexcept applies.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Misc..
Introduce HCITypes + HCIHandler: Providing C++ basics for full HCI support
============================================================================
- HCITypes defines the HCI command and event data structures,
similar to MgmtTypes and ATTPDUTypes.
For more coding efficiency we use template command and event classes, allowing to reuse
the HCIIoctl struct types being wrapped in the C++ classes
for flow and lifecycle control.
HCITypes further includes all essential 'enum class' command opcodes, event types etc,
ensuring type safety.
- HCIHandler defines the command/event workflow similar to GATTHandler and DBTManager.
One HCIHandler per DBTAdapter is being used, each HCIHandler using its
event reader thread and ringbuffer.
Socket event filtering and manual le-meta filtering ensures reduced workload (DoS safety).
Similar to HCITypes, we use template function to utilize
the template command and event classes, reuising the HCIIoctl struct types...
HCIHandler can be extended for more functionality as well as used to implement
our own DBTManager, i.e. Reducing HCIEvents to MgmtEvents with callback support.
At least this is a viable option now, if so desired (non-linux, etc).
- HCIComm: Contains the core I/O functionality only, dropped all semantic HCI code.
The latter resides in HCIHandler now.
- DBTAdapter now uses HCIHander instead of HCIComm, renamed field to simply 'hci'
Misc..
=======
- reduced all ringbuffer capacity to 128 from 256
- Moved Mgmt*EventCallback from DBTManager to MgmtTypes,
as we might want to reuse the MgmtTypes incl callbacks
for alternative DBTManager implementations.
- Added 'enum class' to underlying number type conversion pattern:
<NumberType> number('enum class type')
Avoiding the many static_cast<NumberType>(..) directives.
- align all Type -> String method names: 'get<Type>String(Type)'
- BasicTypes: Add safe uint32_t bitfield mask helper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
duplicates)
Localizing enum scope avoiding duplicates also helps fixating type safety.
This is especially important for short enums w/o a type prefix.
+++
Fixes:
- MgmtEvent::getSpecialized(..): Reading actual uint16_t Opcode instead of just peeking uint8_t! (Duh!)
- MgmtEvent* *string* ops: Converting uint16_t Opcode instead of uint8_t to string.
|
|
|
|
| |
as well as using its string representation in respective toString() methods.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Example ScannerTinyB01 demonstrates efficient scanning devices using the new BluetoothDeviceDiscoveryListener interface.
The C++ HCIObject extends JavaUplink, which handles the java object references
via 'std::shared_ptr<JavaAnonObj>', where JavaAnonObj relies on later polymorph specialization.
JavaAnonObj gets derived in the java/jni of direct_bt, where the JNI header + libraries are available.
+++
The java inplementing NativeDownlink implementations
store the nativeInstance to the C++ instances
as well as handle their java references within the native instances.
The C++ JavaUplink and Java NativeDownlink interfaces are complete
the cross referencing java <-> native.
+++
Native libraries are now split into pairs:
- tinyb + javatinyb
- direct_bt + javadirect_bt
TODO: BluetoothFactory must chose the proper bundle!
+++
The Java Adapter received a BluetoothDeviceDiscoveryListener hook,
matching C++ Adapter's HCIDeviceDiscoveryListener.
Since the Java Adapter implements its own discovery thread,
using the BluetoothDeviceDiscoveryListener is more efficient then polling
over a list of Devices fetched.
++++
TODO: Align Java and C++ class names, foremost in the C++ direct_bt space.
TODO: Bind the whole C++ GATT functionality
More testing.
|
|
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]
|