Response to BTP_L2CAP_SEND_DATA command is already sent in command
handler (`send_data()`). Sending further responses to already answered
command is confusing - we cannot fail successful procedure
retroactively. Data sending is already confirmed to be started
successfully and no further responses are expected - more so, it appears
to break `available_queue` management and further commands cannot be
processed correctly.
Similar callback may be proposed in the future if confirmation of
sending data is needed, but not in form of BTP response, but BTP event.
This commit refactors BTP handling to new model, where API is provided for
registration of handlers for BTP commands as callbacks. New API provides also
size check and common buffer for response.
Removes Controlle Index validation from BTP handlers, as these are always 0.
Corrected some formatting for variable declarations.
This refactors only core and GAP service into new API, rest of services will
not work but are compiled. They will be refactored in following commits.
This application provides shell interface for Bluetooth DTM. It also
provides few extra commands useful for testing (TX power configuration,
antenna selection, unmodulated carrier).
PSM on which Lower Tester requests connection fully defines
what are requirements for request to be accepted. That means
that `response` parameter should not be used to return errors
from `tester_l2cap_event`, and is not needed.
Sometimes it's simpler to call pair() even when procedure is already
active. Do not fail command in this case, as it doesn't influence
already ongoing procedure.
Local Included Service(s) values are retrieved using
`ble_att_svr_read_handle`, which will lead to calling `entry->ha_cb`
for Included Service. This will be `ble_gatts_inc_access`, which will
not add UUID if it's not of 16 bit type. Use 16 bit UUID for included
service.
`out_att_err` is now set to 0 by default - it may be not overwritten if
no error occured. This will lead to undefined behavior and incorrect
data in BTP response.
There is no need to call `gatt_buf_add` when `gatt_buf` if filled using
pointer `chr` from `gatt_buf_reserve`. This caused sending malformed
data to BTP reposnse event.
While re-pairing ble_store_config_find_sec function was checking peer address,
ediv and random number. Even if peer address was the same, the bond could be
recognized as not the one we was looking for, because ediv and random number
could be different. This was causting issues when the BLE_STORE_MAX_BONDS syscfg val
was used. Re-pairing to the same device was treated as pairing to the
new device and if current number of bonds was the same as BLE_STORE_MAX_BONDS,
the re-pairing was failing.
Packages console, log and stats allow to choose stub or full
implementation. All apps had either stub or full implementation
hardwired in pkg.yml file. Now it can be easily overriden in target.
This also changes defunct setting
of CONSOLE_MODE to CONSOLE_IMPLEMENTATION in all apps.
On default the application has taken "public" as own address type. Now the application checks if public addres is available on the device and if not, on default it uses "random" as own addres type.
It prevents advertising, scanning and connecting errors if the user won't change own address type in console, while working with a device, which has no public address available.
There are small typos in:
- apps/blehr/src/main.c
- apps/ext_advertiser/src/main.c
- nimble/controller/src/ble_ll.c
- nimble/host/src/ble_att_svr.c
- nimble/host/src/ble_hs_mbuf.c
- nimble/host/src/ble_sm.c
Fixes:
- Should read `response` rather than `respose`.
- Should read `measurement` rather than `measurment`.
- Should read `largest` rather than `larget`.
- Should read `instance` rather than `nstance`.
- Should read `application` rather than `applicaiton`.
- Should read `always` rather than `alwyas`.
When we receive GAP event BLE_GAP_EVENT_REPEAT_PAIRING it means
that we sent security request, but bond is lost - peer sent pair
request in return, which means it doesn't have keys anymore. Bond is
also lost when we sent encryption request and peer responded with
Ecnryption Change event with error 'PIN or Key Missing'. Inform
Upper tester about it.
L2CAP/ECFC/BI-02-C requires IUT to hold credits and give them back when
asked to do so. Let's use option defined in BTP to set manual credit
give-back procedure when L2CAP connection is created.
BTP specification was extended and we can decide weather or not
connect ECFC channel by specifying it in 'option' command argument.
This allows to connect single ECFC channel.