Commit Graph

8203 Commits

Author SHA1 Message Date
Andre Guedes
cf81589842 hcitool: add discovery procedure to lescan command
This patch adds the option [--discovery=g|l] to lescan command. Use
this option to enable the general or limited discovery procedure.
If discovery option is not given scanning will display all results
ignoring the AD flags.
2011-02-24 17:39:12 -03:00
Daniel Orstadius
1b80034b89 Maemo6 MCE: skip first adapter_powered callback
The maemo6 MCE plugin should be used with the flag InitiallyPowered
in main.conf set to 'true' so that BlueZ powers on the adapter
and leaves it in that state when the daemon is started. The plugin
will read the radio state from the MCE and set the state
accordingly. The maemo6 plugin is a btd_adapter_driver and those
drivers are loaded after BlueZ has read the BD address etc from the
adapter.

This patch adds a boolean flag in the callback to ignore the initial
powering on of the adapter by BlueZ, since it shouldn't be
propagated to the MCE. With InitiallyPowered set to 'false' the
adapter_powered callback is not called when the adapter is turned
on at BlueZ startup, which is why this wasn't implemented before.
2011-02-24 16:17:38 -03:00
Andre Dieb Martins
ce2b40c892 Implement server-side ATT handle notification
Adds an initial version of ATT handle notification. Notifications are
sent to interested clients (based on the Client Characteristic
Configuration) always when the attribute is updated.

This enables services to call db_attrib_update() and send notifications
on their own terms.
2011-02-24 15:44:08 -03:00
Andre Dieb Martins
4ae6cfca55 Check properties before setting client configs
Only enable notification/indication if the descriptor allows it.
2011-02-24 15:43:32 -03:00
Anderson Lizardo
34d6f0e397 Initial Client Characteristic Configuration implementation
This initial version creates a private copy of the Client Configuration
attribute for each client on the first write to that attribute. Further
reads/writes should use the client's private copy.

Two list of attributes are created: one for values to be indicated and
another for values to be notified. The actual notification/indication
sending is implemented in a separate commit.

This initial version also does not check for the characteristic
properties, which is implemented in a separate commit as well.
2011-02-24 15:42:43 -03:00
Anderson Lizardo
c3717e3420 Add read/write callbacks to attribute server
These callbacks will allow profiles to act before an attribute is read
and after it is written, to e.g. update the attribute value to/from an
external source.

Note that by the time the callback is called, the necessary security
checks (attribute permissions, authentication and encryption) were
already performed by the core attribute server.

The callback can optionally return an ATT status code, which will be
sent to the client using an Error Response PDU.
2011-02-24 15:41:47 -03:00
Claudio Takahasi
1847ffb1b6 Don't register GATT related SDP records if attrib server is disabled
GATT related SDP records should not be added if "AttributeServer" option
is false in the configuration file. Problem happens only when attribute
plugin is enabled.
2011-02-24 15:28:30 -03:00
Anderson Lizardo
941eb99732 Fix DBG() calls with bogus messages
Remove unnecessary trailing newlines (already added by DBG()) and
rewrite debug messages to become more useful.
2011-02-24 15:27:17 -03:00
Szymon Janc
87df52f525 Add GStreamer version check in acinclude.m4
Since commit cc04c6a2f7 compilation fails
with GStreamer 0.10.28 or older.
2011-02-24 15:21:42 -03:00
Anderson Lizardo
30b24e4153 Fix typo on DBG() string format 2011-02-23 11:50:18 -03:00
Elvis Pfützenreuter
de9dfe2051 Check malformed notification/indication PDU
This patch implements discard of obviously malformed
GATT notification/indication PDUs.
2011-02-23 11:48:37 -03:00
Claudio Takahasi
9152acfbc7 Add hcitool command to change the parameters of a given LE connection
Allows the LE master to start the Connection Parameter Update Procedure.
Parameters values consistency are not verified on purpose allowing
invalid values to test fail scenarios.
2011-02-23 00:27:22 -03:00
Claudio Takahasi
5edfc482ca Add hci utility function to change LE connection parameters 2011-02-23 00:27:20 -03:00
Claudio Takahasi
8e7af67a19 Remove unneeded comma in the hcitool commands declaration 2011-02-23 00:27:15 -03:00
Claudio Takahasi
3475c7f43a TODO: Add item to support characteristic authorization in the agent 2011-02-23 00:09:54 -03:00
Claudio Takahasi
45ea4d5cb7 TODO: Add item for reconnection address 2011-02-23 00:09:50 -03:00
Claudio Takahasi
4c9f8c694d TODO: Add item for static random address 2011-02-23 00:09:49 -03:00
Claudio Takahasi
950f9fd9ac TODO: Change item related to read/write long characteristic 2011-02-23 00:09:47 -03:00
Claudio Takahasi
6833edab70 TODO: Remove interactive gatttool item 2011-02-23 00:09:45 -03:00
Claudio Takahasi
4bbbd663d2 TODO: Add item for privacy feature in the central 2011-02-23 00:09:43 -03:00
Claudio Takahasi
42c3decd1f TODO: Changed item related to ATT parsing for hcidump 2011-02-23 00:09:38 -03:00
Sheldon Demario
d576392d03 Add Characteristics Discovery option to interactive gatttool 2011-02-23 00:02:08 -03:00
Sheldon Demario
7877285534 Improve help messages in interactive gatttool
Includes the parameters info on help.
2011-02-23 00:01:24 -03:00
Andre Guedes
e27614655c Fix potential bug in le_advertising_report()
In the current implementation of le_advertising_report(), the variable
'info' has an invalid memory address after the 'for' loop. If 'info'
is dereferenced it will access invalid memory.

This patch fixes this potential bug and improves the code's readability.
2011-02-22 23:59:47 -03:00
Luiz Augusto von Dentz
0001c99c20 Fix not setting global mode when SetProperty is used
Global mode should be overwrite if user application change the adapter
mode by using SetProperty while there are sessions active, otherwise
when this sessions are released the mode restored will be the global
mode from before the sessions were created and not the mode set with
SetProperty.
2011-02-22 14:19:57 -03:00
Bruna Moreira
0ae4ae5142 Fix end grp handle on Find By Type response
The attribute server was incorrectly setting the end group handle of the
last attribute to 0xFFFF on Find By Type response (used by Discover
Primary Service by UUID).
2011-02-21 13:55:45 -03:00
Bruna Moreira
ad8d1d551f Fix Find by Type Response with start == end grp handle
Find by type value response in attribute server was in loop when the
start/end grp handles from a primary service had same values.

Initializing end grp handle with start handle makes the special check
when end grp handle was zero unnecessary so it was removed.
2011-02-21 13:55:43 -03:00
Marcel Holtmann
e787f4d082 Release 4.89 2011-02-20 12:36:16 -08:00
Marcel Holtmann
892a4b68a5 Fix indentation for source file list 2011-02-20 12:17:33 -08:00
Marcel Holtmann
ab58a67738 Mention Brian's contributions 2011-02-20 12:14:10 -08:00
Marcel Holtmann
c23a0f4713 Update library version 2011-02-20 12:13:08 -08:00
Marcel Holtmann
2e637a340f Fix sorting and style of SDP includes 2011-02-20 12:12:15 -08:00
Brian Gix
8fc0ba539d Fix crash where MTU allowed to be set too large
As previously written, a remote device could request, and we would
accept an MTU larger than what we could support.
2011-02-20 15:26:43 -03:00
Brian Gix
646cc43be8 Add missing UUID16 field to Included Svc Attribute 2011-02-20 15:26:14 -03:00
Johan Hedberg
62d7730afe Fix bonding_complete indication for mgmt_pair_device complete event
In some (rare) circumstances it is possible for the mgmt_pair_device
command to complete without there being any other indication of
completion of the procedure. Therefore, the bonding_complete event needs
to be notified to the core daemon also in this situation.
2011-02-20 15:18:37 -03:00
Brian Gix
475dd53450 Add SDP registration of Primary GATT services
Add capability to register SDP record for Primary Services.
2011-02-19 12:14:00 -03:00
Johan Hedberg
a53621433c Rename device_authentication_complete to device_auth_req_free 2011-02-18 21:55:23 +02:00
Johan Hedberg
8cc4b8c9d6 Clean up btd_event_bonding_complete logic a little 2011-02-18 21:55:02 +02:00
Johan Hedberg
a20bb21f47 mgmt: Add support for auth_failed event and bonding_complete hooks
This patch adds support for the mgmt_auth_failed event together with the
related bonding_complete failure hooks to the core daemon.
2011-02-18 21:54:47 +02:00
Luiz Augusto von Dentz
de8eb4773a telephony-ofono: fix resetting network status and signal
This prevent using status and signal from previous active modem
2011-02-18 13:47:13 -03:00
Luiz Augusto von Dentz
d8fbf5b42f telephony-ofono: reset indicators when a network is found
Indicators may have invalid values set from the last time they were used
2011-02-18 13:46:49 -03:00
Elvis Pfützenreuter
74de4d7c6c Add UUID property to GATT service object 2011-02-18 12:09:26 -03:00
David Herrmann
5408e11b6b Replace batostr() with ba2str() to avoid memleaks
batostr() returns dynamically allocated strings. Replace it with
ba2str() wherever possible to avoid heap allocations and fix memleaks.
2011-02-18 12:01:12 -03:00
Sheldon Demario
78ed16f407 Add Primary Discovery Services option to interactive gatttool 2011-02-18 11:52:44 -03:00
Claudio Takahasi
a17627b507 Use memcpy for network to host order function on BE hosts
Harmless change replacing "for" by "memcpy". Note that this change
is inside the block reserved to big endian functions.
2011-02-17 15:51:58 -03:00
Sheldon Demario
0cc2459963 Use PSM value to select LE or BR/EDR transport on gatttool
Removes "le" parameter of gatt_connect() as well the global variables
used to store the le option. LE is now the default transport, if a PSM
value different than zero is given BR/EDR will be selected
2011-02-17 15:50:15 -03:00
Sheldon Demario
eb4e1d6d4b Move do_connect() to a common file between interactive.c and gatttool.c
Since do_connect() is used in both interactive.c and gatttool.c
files, it was moved to a new file that should hold all common functions
2011-02-17 15:48:43 -03:00
Claudio Takahasi
b03aa22d2d Fix Device Name Characteristic
"Name" key value defined in the main.conf file can not be used without
substitution(hostname and adapter id). This patch adds Device Name
Characteristic with length 0 and updates the value when the adapter is
initialized.

Multiple adapters with different settings is not supported at the moment
by the attribute server. GAP characteristics values will be overwritten
if the host has multiple adapters.
2011-02-17 15:35:58 -03:00
Claudio Takahasi
3893562252 Update the Device Name characteristic when the local name has changed 2011-02-17 15:35:56 -03:00
Claudio Takahasi
aaa550fe51 Update Device Appearance Characteristic based on device class
Appearance Characteristic value is still under discussion. Temporary
solution which maps directly the device class of device(major and minor)
into Device Characteristic value without shifting the two less significant
bits reserved to Format Type. The second byte of the device class
contains the major class in the 5 less significant bits.
2011-02-17 15:35:54 -03:00