| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds SPDX License Identifier and removes the license text.
-------------------------------------
License COUNT
-------------------------------------
GPL-2.0-or-later : 13
License: GPL-2.0-or-later
attrib/att-database.h
attrib/gattrib.h
attrib/gatttool.h
attrib/gatt-service.c
attrib/interactive.c
attrib/utils.c
attrib/gatt.c
attrib/gattrib.c
attrib/gatt-service.h
attrib/att.c
attrib/gatt.h
attrib/att.h
attrib/gatttool.c
|
| |
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
GATT/ATT use little-endian byte order format for 128-bit UUID. No matter
the system byte order representation, internally the core will handle
128-bit UUID on big-endian format.
|
| |
|
| |
|
| |
|
|
|
|
| |
These checks are needed to avoid invalid memory access on bogus PDUs.
|
|
|
|
| |
PDU length must be either 7 or 21 octets.
|
|
|
|
|
| |
Otherwise, an incomplete PDU may be silently accepted (with any
remaining data discarded).
|
|
|
|
|
|
|
| |
Use number instead of "min_len", which is easier to review (with help of
the documented parameter sizes).
valuelen is redundant as *vlen can be used directly.
|
|
|
|
|
| |
Just assume that the caller will pass non-NULL pointers as arguments
(which is true for the only current caller of this function).
|
|
|
|
| |
These checks are needed to avoid invalid memory access on bogus PDUs.
|
|
|
|
| |
PDU length must be either 7 or 21 octets.
|
|
|
|
|
|
|
|
|
|
| |
Both userspace and kernel enforce a minimum ATT MTU of 23 octets, which
is also used as minimum size for buffers passed to ATT encoding
functions. Therefore, it is unnecessary to perform these checks on ATT
requests that are guaranteed to fit into 23 octets.
Also document ATT parameter lengths where a constant is being used for
calculating the PDU length.
|
| |
|
|
|
|
|
| |
If a NULL "value" parameter is given, only check whether PDU is valid,
without copying attribute value to a buffer.
|
|
|
|
| |
Add functions for encoding/decoding Execute Write Request PDUs.
|
|
|
|
| |
Add functions for encoding/decoding Prepare Write Request PDUs.
|
| |
|
|
|
|
|
|
| |
Fix coding style for enc_read_blob(), enc_read_blob_resp(),
dec_read_resp(), enc_error_resp(), enc_find_info_req(),
enc_find_info_resp() and enc_prep_write().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix these build errors:
attrib/att.c: In function ‘dec_read_by_grp_req’:
attrib/att.c:165:10: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
attrib/att.c:170:10: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
attrib/att.c: In function ‘dec_read_by_type_req’:
attrib/att.c:393:10: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
attrib/att.c:402:10: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
|
|
|
|
| |
These headers are not public anymore, so need to use "lib/uuid.h".
|
| |
|
|
|
|
|
| |
Now that this function may fail in more usual situations (invalid
input), we have to check its return value.
|
|
|
|
|
|
| |
When encoding an att_data_list we need to make sure that each element
lenght of the data list will not exceed 255, because that information
will be encoded as a octet later.
|
|
|
|
|
|
|
|
|
| |
size_t/ssize_t/off_t/etc are more appropriate for variables denoting
some kind of size than simply using int.
This patch includes a couple of other related changes to avoid gcc
signedness errors resulting from it treating (for whatever reason) const
variables and integer literals as signed.
|
|
|
|
|
| |
Add functions for encoding/decoding Execute Write Request and
Response PDUs.
|
|
|
|
|
| |
Add functions for encoding/decoding Prepare Write Request and
Response PDUs.
|
|
|
|
|
|
| |
This patch avoids invalid memory access when decoding ATT read response
PDUs. The ATT_MTU value is a per ATT Bearer value defined by the higher
layer specification.
|
|
|
|
|
|
|
|
| |
This patch fixes command timeout handling. Previously attrib_destroy was
explicitly called which ignored any reference holders. This patch fixes
the issue by first passing errors to command callbacks and after that
marking the GAttrib object as stale so no further operations can be
done.
|
|
|
|
|
|
|
|
|
|
| |
The enconding and decoding of ATT pdus should be kept as much
free of dependences from other parts of the code as possible, so
it can be used in many contexts.
In this case, for encoding and decoding notifications and indications
we did have to pass an instance of an attribute instead of direct
values.
|
|
|
|
|
|
|
| |
On commit 6a6da5de107e192f62ce2ecdde96eae985181df0 the struct
attribute "data[0]" member was replaced with a dynamically allocated
"data" pointer. This commit fixes remaining places where the old
allocation scheme was still assumed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Accounting of misspelled words, as detected by codespell:
acording 2
ancilliary 1
appropiate 1
atribute 1
cant 1
comming 2
gracefull 1
lenght 1
mispelled 1
occured 1
occurences 1
ocurred 3
prefered 1
presense 1
reponse 1
seperate 1
succesful 1
successully 1
sucessfull 1
sucessfully 1
|
| |
|
|
|
|
|
|
| |
This patch puts the new UUID functions into use for GATT-related
code, and adds some convenience functions to ATT API (att.h).
Example GATT server is also changed.
|
|
|
|
|
| |
Use glib memory allocation functions instead of malloc for attribute
data list in ATT protocol utility functions.
|
|
|
|
|
| |
The encode/decode functions for Write Response operations were created
to keep consistency with the rest of GATT API.
|
| |
|
| |
|
|
|
|
|
| |
When the size of attribute value is greater than pdu size, it should be
truncated to the pdu length - 2
|
|
|
|
|
| |
Find by type operation is used by Discover Primary Service by Service
UUID. Find By Type Value Response shall contain one or more group handles.
|
| |
|
|
|
|
|
|
|
| |
Implement encoders/decoders for Write Request/Response and the handling
on attribute server. The attribute client still uses the Write Command
because currently SetProperty() has no means to wait for the server
response.
|
|
|
|
| |
This is consistent with other att.h functions, and allows length checks.
|