This replaces the uses of g_memdup with util_memdup since the former has
been deprecated:
warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead
[-Wdeprecated-declarations]
g_memdup2 requires bumping glib version which would likely have its
own problems thus why util_memdup was introduced.
If the id != 0 that means that a proceedure that needs multiple PDUs is
in progress so use bt_att_resend with its id that way the bt_att id and
gattrib shall always be the same.
Due to the issues with CSRK tests ext_signed flag has been added to
allow android/gatt handle signed write operations.
This patch fixes following tests:
GAP__TC_SEC_CSIGN_BV_02_C
GAP__TC_SEC_CSIGN_BI_01_C
GAP__TC_SEC_CSIGN_BI_02_C
GAP__TC_SEC_CSIGN_BI_03_C
GAP__TC_SEC_CSIGN_BI_04_C
SM__TC_SIGN_BV_03_C
Without this patch it is possible to enter infinite loop when
searching included services on remote device. This patch fixes that.
Issue happens when remote device replies with ending handle which is
lower than start handle we use for search
Without this patch it is possible to enter infinite loop when
searching descriptors on remote device. This patch fixes that.
Issue happens when remote device replies with ending handle which is
lower than start handle we use for search.
Without this patch it is possible to enter infinite loop when searching
characteristics on remote device.
This patch fixes that.
Issue happens when remote device replies with ending handle which is
lower than start handle we use for search.
Found on robustness session on UPF50
Without this it is possible to put BlueZ into infinite loop when
doing primary service search on remote device.
Issue happens when remote device replies with ending handle which is
lower than start handle we use for search.
This patch fixes that
Found on robustness session on UPF50
The default behavior of GAttrib is to disconnect on unref but patch
0ea75ab4bb had changed that in order to
fix a warning, this return the old behavior but leaves to bt_att to do
the actual closing.
Since bt_att is used internally GAttrib should no longer close the
connection otherwise it cause the following warning:
bluetoothd[31756]: attrib/gattrib.c:g_attrib_unref() 0x610c130: g_attrib_unref=1
bluetoothd[31756]: attrib/gattrib.c:g_attrib_unref() 0x610c130: g_attrib_unref=0
(bluetoothd:31756): GLib-WARNING **: Invalid file descriptor.
This patch adds means to reuse ATT request id for GATT operations
which might need more then one ATT request for complete GATT operation.
E.g discover primary\included services and discover
characteristics/descriptors
This is needed for the user of gattib, to make sure that ATT request id he
holds is valid during whole GATT operation.
So far, it could happen that gattrib did additional ATT request without
user knowledge which leads to situation that user had outdated ATT
request id.
Note that request id is used by the user for canceling request.
If user provides req_id to the g_attrib_send, he assume that req_id
should be used for transaction.
With this patch, gattrib keeps track on user requested req_id and
actual pending req_id which allow to e.g. cancel correct transaction
when user request it.
Note that for now specific request id is used in attrib/gatt.c for long
write. Next patch will make bigger usage of this but also only in this
helper. We do not expect other attrib clients to use that feature.
Using larger buffer than mtu resulted in not sending the message at all
as encode_pdu() in shared/att.c fails when provided data buffer is
larger than current mtu.
We were setting only the buffer in gattrib but att was left with the
default value of 23 (LE transport layer defaults). For BREDR transport
layer this may result in using smaller MTU than the minimum allowed
(48).
This was affecting cases when MTU Exchange was not supported by the
remote device and defaults were used.
This patch implements a version of GAttrib which is backed by
bt_att, which enables the simultaneous use of GAttrib and bt_att.
This should enable smooth transition of profiles from the GAttrib
API to the src/shared bt_att API.
As per spec (BT spec 4.1 Vol[3], Part F, chapter 3.4.5.4) we need to
take opcode, handle and parameters to generate signature.
In order to support it signing is moved to att.c, place where pdu is
encoded
This patch adds gatt_discover_desc() function which performs descriptor
discovery in a manner similar to gatt_discover_char(), i.e. it does
complete discovery procedure and returns list of descriptors found when
finished. For 16-bit UUIDs in addition to string UUID, short UUID is
provided.
It's also possible to specify single descriptor UUID to look for and
discovery procedure is interrupted as soon as UUID is found. This way
no more than one descriptor is returned which is useful when searching
for common descriptors like CCC.