| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
This is needed to cover Android API
|
|
|
|
|
| |
Android expose to application api for reliable write. Therefore we need
to add this support to gattrib
|
|
|
|
|
| |
According to Core SPEC, attribute data list must be grouped in elements
of the same size.
|
| |
|
|
|
|
| |
Source buffer for write operations should be immutable.
|
| |
|
|
|
|
|
|
| |
Properties are defined by GATT specification. This patch moves and
renames the defines related to Characteristic properties bits from
attrib/att.h to attrib/gatt.h
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This patch moves GATT UUIDs definitions to a common header. uuid.h contains
helper functions to manipulate Bluetooth UUIDs and some common BR/EDR services
UUIDs.
|
| |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
Use standard C types instead of GLib ones (which are unnecessary here)
and move the "status" parameter to the first position, so it is
consistent with other callbacks.
|
|
|
|
|
|
|
|
|
|
| |
The __func__ macro is part of the C99 standard whereas __FUNCTION__ is a
legacy gcc specific alias for it:
http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html
Additionally, checkpatch.pl that's commonly used to verify coding style
also recommends to use __func__ instead of __FUNCTION__.
|
|
|
|
|
|
|
|
| |
Custom GATT services typically use 128-bits UUIDs; this patch allows for
using gatt_service_add to define such services by adding a new option
GATT_OPT_CHR_UUID, which allows for passing bt_uuid_t* values. Note, a
previous patch renamed the old GATT_OPT_CHR_UUID into
GATT_OPT_CHR_UUID16.
|
|
|
|
|
| |
Rename the option for all in-tree users. This frees up GATT_OPT_CHR_UUID to be used
for UUIDs of type bt_uuid_t* (in a next patch).
|
|
|
|
|
|
|
|
|
| |
To paraphrase Anderson Lizardo: "h" was overflowing for 128-bit services
because the handle is incremented after each attribute is added so at
the end we had: 0xffff + 1 == 0 (h is uint16_t).
As it seems more complex to try to remove the overflow without affecting
the logic too much, we update the assertion.
|
|
|
|
| |
This makes it easy to identify where variables are being used.
|
|
|
|
|
| |
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().
|
|
|
|
|
| |
All parameters can be retrieved from struct write_long_data fields,
therefore there is no need to pass them separately.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, if no callback was given to gatt_write_char(), it was
assumed that a "Write Without Response" (which uses Write Command)
should be used instead of Write Request.
This "shortcut" is unnecessary (there is gatt_write_cmd() for the
situations where Write Without Response is required) and just duplicates
code.
This commit also fixes the few places where gatt_write_cmd() should be
used.
|
|
|
|
|
|
| |
The old name referred to the underlying ATT PDU (Find Information
Request and Find Information Response) and not to the actual GATT
procedure (Discover All Characteristic Descriptors).
|
|
|
|
|
| |
Since commit 6a3a89774c6738df4d5b77636c4ce747b7497ae9 the code
removed here has no sense.
|
|
|
|
|
|
|
|
|
|
|
| |
Passing the special character single quote:
$gatttool -I
[ ][ ][LE]> '
Segmentation fault (core dumped)
Checking g_shell_parse_argv fail status (return FALSE on failure), works
fine.
|