| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
att_get_u16() already does a cast of the void* parameter to uint16_t*.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
When using the minimum MTU, in some cases, mostly when using 128-bit UUIDs,
the PDU is exactly the size of the minimum MTU. In those case there were
off-by-one errors. Errors are returned if can't put anything useful inside
the requested PDU.
|
|
|
|
|
|
| |
When encoding long responses, there could be situations where the
attribute value length could be larger than the buffer size and the
encoder would try to put more data than the space available.
|
|
|
|
|
| |
We should always make sure that the buffer has room to hold at
least one element.
|
|
|
|
|
|
| |
The encoding functions should return only the bytes which can be
inserted in buffer (maximum size is defined by ATT_MTU). The other ones
should be requested by client again.
|
|
|
|
|
|
| |
Initial changes in attribute server to send notifications to all
connected clients when an attribute has changed. Characteristic
Configuration descriptor is not being addressed yet.
|
|
|
|
|
|
|
|
| |
When encoding/decoding PDU fields, we have to be careful and use
alignment safe functions to load/store the values.
These functions will be exported so other parts of the code can reuse
them.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
We must take into account that the opcode and the length of each element is
included in each PDU.
|
|
|
|
|
| |
This adds the functions necessary to implement a GATT server. The encoder
for the Read by Type Response and the decoder for the Request.
|
| |
|
|
|
|
|
|
| |
Returns an attribute data list containing found services. Each
element of the list contains the start, end group handle and the
UUID16 of the given service. UUID128 is not being addressed yet.
|
|
|
|
|
| |
To mantain consistency, the size (in bytes) written to the PDU should
be returned.
|
|
|
|
|
|
| |
This adds encoders and decoders for Requests and Responses of this type. The
value extracted/inserted is just copied, the user shall ensure that it is in
the right byte order.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
If we want to support both client and server roles, we must be clear that we
are encoding/decoding requests or responses.
|
|
|
|
|
| |
This adds att_read_by_type_{encode,decode}, so we can create Read by Type
Requests and parse Read by Type Responses.
|
|
|
|
| |
att_read_by_grp_type_decode() returns a attribute data list structure.
|
| |
|