Commit Graph

8311 Commits

Author SHA1 Message Date
Waldemar Rymarkiewicz
3827cfbc00 Add Sim Access Profile connect/disconnect procedures
Add support for SAP protocol features:
	* connect and disconnect requests
	* connect and disconnect responses
	* disconnect indication
	* timeouts for the valid connection
2011-03-23 14:47:50 +02:00
Luiz Augusto von Dentz
8095805736 Fix crash when unregistering a2dp driver before media driver
Since media driver uses a2dp to register its sep and store a pointer,
this pointer may be invalid/freed when media driver is unregistered.

To fix this now a2dp will also release any sep registered using media
API.

It also protect from future changes on the order of drivers removal by
checking if pointers (sep or endpoint) are still available in the list
before removing them.
2011-03-22 12:36:23 +02:00
Arun Raghavan
e70fb63e46 Recalculate remote SEP if the codec type changes
This forces recalculating the remote SEP if the local SEP's codec type
is no longer the same as the remote SEP's codec type. This can happen
after we issue a BT_STOP_STREAM+BT_CLOSE followed by a
BT_SET_CONFIGURATION with a new SEID.
2011-03-18 11:37:53 +02:00
Andre Guedes
2c0c9662d0 TODO: set owner of 'Whitelist support' task 2011-03-18 11:25:05 +02:00
Radoslaw Jablonski
9e7e6b31ad Set correct adapter state in cancel_resolve_name
Previously resetting STATE_RESOLVNAME for adapter was missing.
This was causing problems with discovering devices when discovery
was quickly turned off/on during resolving name.
2011-03-18 11:24:19 +02:00
Bruna Moreira
6fc92a5341 Add Exchange MTU in interactive gatttool 2011-03-18 11:22:45 +02:00
Bruna Moreira
1b07befa15 Add Exchange MTU operation in GATT library 2011-03-18 11:17:58 +02:00
Bruna Moreira
efcef2bd79 Use GAttrib buffer for ATT protocol PDUs
Prior to this commit, there were local buffers inside GATT functions.
Now, a single buffer is used, to make sure the MTU limit is respected.
2011-03-18 11:15:07 +02:00
Bruna Moreira
68887c2133 Add internal buffer to GAttrib struct
The new buffer is allocated in g_attrib_new() and it will be used to
send/receive PDUs. The buffer size is the MTU read from L2CAP channel
limited to ATT_MAX_MTU. Functions to handle the buffer size were also
created.
2011-03-18 11:14:35 +02:00
Bruna Moreira
f773053e55 TODO: remove 'fix MTU exchange' task 2011-03-18 11:14:31 +02:00
Anderson Lizardo
4969ae43ae TODO: set owner of 'Define attribute server API' task
An initial implementation was sent as RFC.
2011-03-17 14:59:24 +02:00
Elvis Pfützenreuter
6bcda79cbb Update TODO regarding bt_uuid_* functions 2011-03-17 14:58:42 +02:00
Anderson Lizardo
f694885825 Check for existing handle in attrib_db_add()
This check is necessary to avoid inserting attributes with same handle.
2011-03-17 14:57:52 +02:00
Anderson Lizardo
fb23d0273c Change attrib_db_update() to return reallocated data
attrib_db_update() uses g_try_realloc(), which means the memory address
of the updated attribute may change. Callers may need to update
references to the old address.

The new struct attribute pointer is returned to caller by the "attr"
paramater.
2011-03-17 14:54:56 +02:00
Anderson Lizardo
59ba9844eb Remove unnecessary assignment from attrib_db_update()
attrib_db_update() uses g_try_realloc() only to expand/shrink space for
the variable "data" field. Therefore existing fields (like handle) are
guaranteed to remain unchanged.
2011-03-17 14:53:40 +02:00
Anderson Lizardo
1b6cd1f3c6 Allow NULL pointer as UUID for attrib_db_update()
A NULL uuid_t pointer means that the UUID should remain unchanged. This
simplifies most attrib_db_update() calls which do not change the
attribute UUID.
2011-03-17 14:52:58 +02:00
Anderson Lizardo
d97e70142a Add DBG() calls to attrib_db_* functions
This will help debugging issues with registration of GATT services.
2011-03-17 14:52:36 +02:00
Sheldon Demario
922c5feb93 Add discover characteristics by UUID to gatttool
According to the specification the characteristics discover and
characteristics discover by UUID use the same opcode and the result
should be filtered by callback.
2011-03-17 14:50:59 +02:00
Dmitriy Paliy
2da716f340 Add 'Protocol not supported' error in a2dp_add_sep
'Protocol not supported' error code is added to the registration of A2DP
end-points. Error response org.bluez.Error.NotSupported instead of
org.bluez.Error.InvalidArguments is used when SEP registration fails due
to disabled corresponding interface in audio.conf.
2011-03-17 14:35:55 +02:00
Johan Hedberg
4f8d6ba353 Fix missing check for dev->up before calling init_adapter
With some kernels and the right timing it is possible to get into the
state where we get the local name but haven't yet gotten a DEVUP event.
In such a case it is *not* ok to call init_adapter.
2011-03-17 14:33:02 +02:00
Marcel Holtmann
67fc00db39 Release 4.90 2011-03-15 20:25:23 -07:00
Marcel Holtmann
43bfa36567 Update library version 2011-03-15 19:54:49 -07:00
Johan Hedberg
52e333ff28 Add attrib server refactoring task to TODO 2011-03-15 22:40:00 +02:00
Johan Hedberg
3c0786fea5 Fix minor coding style issues in attrib server code 2011-03-15 22:36:50 +02:00
Johan Hedberg
c620d295f7 Remove redundant return statements from interactive gatttool 2011-03-15 22:27:00 +02:00
Johan Hedberg
b98c30a065 Fix minor coding style issues in SAP server code 2011-03-15 22:22:52 +02:00
Johan Hedberg
6b6b100783 Add LE whitelist support to the TODO 2011-03-15 21:10:45 +02:00
Johan Hedberg
803db5d475 mgmt: support for local_name_changed event 2011-03-15 20:51:46 +02:00
Johan Hedberg
7abf8c6e4d mgmt: Fix debug log strings 2011-03-15 20:34:08 +02:00
Waldemar Rymarkiewicz
caa8299225 Add Sim Access Profile Server
Add a Sim Access Server to the SAP plugin and a framework for the dummy
sap driver as well.

	* add the server register and unregister rutines
	* add server listening socket setup
	* add SAP DBus API
	* add prototypes for SAP protocol implementation
	* add skeleton of dummy SIM driver
2011-03-15 19:51:01 +02:00
Waldemar Rymarkiewicz
d4542f4268 Adjust sap/server.c license text to the rest of the code 2011-03-15 19:41:11 +02:00
Elvis Pfützenreuter
69f57a7d56 Add "unit test" for new UUID functions 2011-03-15 19:37:40 +02:00
Elvis Pfützenreuter
a278db781a Use new UUID functions in GATT
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.
2011-03-15 19:36:48 +02:00
Dmitriy Paliy
da620b5e91 Remove unused code due to dial and re-dial change
last_dialed_number and callerid are not used after changing CreateWith
to Create and CreateFromLast csd method calls, and therefore can be
removed.
2011-03-15 19:35:42 +02:00
Dmitriy Paliy
fcd1ac9c72 Change dial and re-dial in maemo6 telephony
Dial and re-dial to last number functions are changed in maemo6
telephony driver accordingly to updated API in csd back-end. CreateWith
method call is replaced by Create and CreateFromLast.

After such modification callerid and last dialed number are not used
and hence removed in sucessive patch.
2011-03-15 19:35:40 +02:00
Dmitriy Paliy
cef5610236 Move telephony_last_dialed_number_req
telephony_last_dialed_number_req function moved to be after
send_method_call. It is used in successive commit.
2011-03-15 19:35:37 +02:00
Johan Hedberg
3011a312a7 mgmt: Implement adapter name control
This patch adds a new set_local_name command as well as a
local_name_changed event to the management interface. Instead of 248
bytes (like in the HCI spec) 249 bytes are always reserved for the name
in the messages so that there's a guarantee of it being nul-terminated
(this is not guaranteed on the HCI level).
2011-03-15 19:32:09 +02:00
Johan Hedberg
1c16543345 mgmt: Add adapter name to read_info response 2011-03-15 19:30:11 +02:00
Szymon Janc
2854ecff1f Make strtoba use str2ba for string conversion 2011-03-15 15:13:52 +02:00
Szymon Janc
1c58c18eaa Fix str2ba behaviour on malformed bt address
str2ba could create bogus bt address from malformed string. Return
all zeros bt address on malformed string.
2011-03-15 15:13:44 +02:00
Szymon Janc
9f14800ff3 Simplify ba2str function 2011-03-15 15:10:36 +02:00
Szymon Janc
e935b65783 Simplify ba2oui function 2011-03-15 15:08:51 +02:00
Vinicius Costa Gomes
020ef16431 Update the test-attrib test script
Now it is more similar to the other test-* scripts. And allows to
exercise more of the API.
2011-03-15 10:53:12 +02:00
Vinicius Costa Gomes
9dd2fb619e Add DiscoverCharacteristics method to the Attribute API 2011-03-15 10:53:07 +02:00
Vinicius Costa Gomes
6cb460ab9c Fix not returning an error when DiscoverCharacteristics() fails
When the connection fails an error should be returned to inform
the user.

This adds a field to store the DBusMessage that caused the error,
so we can send the correct reply.
2011-03-15 10:52:56 +02:00
Vinicius Costa Gomes
17c03b0de4 Fix the behaviour of the DiscoverCharacteristics method
The previous behaviour could lead to some problems, as it returned
as soon as possible. To avoid problems we return just after as the
characteristics are discovered, and to save a few round trips we
return the path of all characteristics that belong to this service.

After this method return it will try to read the characteristics
values.
2011-03-15 10:52:37 +02:00
Vinicius Costa Gomes
2663ca4207 Rename the Discover method to DiscoverCharacteristics 2011-03-15 10:52:23 +02:00
Elvis Pfützenreuter
bb096e674c Add more functions for new UUID handling
This patch adds more functions that are necessary to handle the new
bt_uuid_t type, and moves basic things like byte-swapping functions and
uint128_t type to bluetooth.h.
2011-03-15 10:42:50 +02:00
Claudio Takahasi
3ed993262f Add new UUID utility functions
New UUID functions will store the UUIDs values on host order. Added
functions to create, compare and convert UUIDs.
2011-03-15 10:35:40 +02:00
Lukasz Rymanowski
a709b2119b network: Fix for TP_BNEP_CTRL_BV_01_C qualification test
With this fix network plugin will correctly respond on unknown
BNEP control command.
2011-03-14 17:10:38 +02:00