Commit Graph

14503 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz
99c6f52218 A2DP: Mark start flag if resume happen while in configured state
If SEP is in configured state that means OPEN is about to happen so just
mark start flag and send START once OPEN completes.
2013-02-22 11:14:33 +02:00
Luiz Augusto von Dentz
d52af8763b tools: Add support for registering external player
This adds --external/-e to register remote players found as local player
2013-02-22 11:14:33 +02:00
Luiz Augusto von Dentz
22ec5f4195 tools: Fix hcidump parser of AVRCP for SetBrowsedPlayer command 2013-02-22 11:14:32 +02:00
Christian Fetzer
ed3b98a683 obexd: Handle absolute paths in obc_session_setpath
For absolute paths (that begin with '/'), obc_session_setpath gets called
twice to reset to the root folder.
This is caused by an empty first element in the folder list created by g_strsplit.

This solution sets the index to the folder array correctly and ignores
empty folder names. This fixes as well paths with double slashes.

Trace for 'SetFolder /telecom':

< ACL data: handle 21 flags 0x00 dlen 21
    L2CAP(d): cid 0x0040 len 17 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 32 pf 0 ilen 13 fcs 0xd8
        OBEX: SetPath cmd(f): len 13 flags 2 constants 0
        Connection ID (0xcb) = 17
        Name (0x01) = Unicode length 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 21 packets 1
> ACL data: handle 21 flags 0x02 dlen 11
    L2CAP(d): cid 0x0041 len 7 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 32 pf 0 ilen 3 fcs 0x2
        OBEX: SetPath rsp(f): status 200 len 3
< ACL data: handle 21 flags 0x00 dlen 21
    L2CAP(d): cid 0x0040 len 17 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 32 pf 0 ilen 13 fcs 0xd8
        OBEX: SetPath cmd(f): len 13 flags 2 constants 0
        Connection ID (0xcb) = 17
        Name (0x01) = Unicode length 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 21 packets 1
> ACL data: handle 21 flags 0x02 dlen 11
    L2CAP(d): cid 0x0041 len 7 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 32 pf 0 ilen 3 fcs 0x2
        OBEX: SetPath rsp(f): status 200 len 3
< ACL data: handle 21 flags 0x00 dlen 37
    L2CAP(d): cid 0x0040 len 33 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 32 pf 0 ilen 29 fcs 0xd8
        OBEX: SetPath cmd(f): len 29 flags 2 constants 0
        Connection ID (0xcb) = 17
        Name (0x01) = Unicode length 16
        0000: 00 74 00 65 00 6c 00 65  00 63 00 6f 00 6d 00 00  .t.e.l.e.c.o.m..
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 21 packets 1
> ACL data: handle 21 flags 0x02 dlen 11
    L2CAP(d): cid 0x0041 len 7 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 32 pf 0 ilen 3 fcs 0x2
        OBEX: SetPath rsp(f): status 200 len 3
2013-02-22 10:41:52 +02:00
Christian Fetzer
7f80320654 obexd: Remove obc_session_setpath limit
obc_session_setpath is able to handle multiple folder changes at once.
This removes the limit, that was introduced because of PBAP's limitation
to 3 levels (75d32c6b3a).

Other profiles like MAP might have deeper folder hierarchies.
2013-02-22 10:41:52 +02:00
Timo Mueller
9278cee741 tools: btmgmt: Fix return value to return request id
Commit 947a7477d2 introduced the method
send_cmd which returned the index of the adapter instead of the
request id. As a result no mgmt command could be sent to hci0, as 0
marks an invalid request id.
2013-02-20 20:15:24 +02:00
Anderson Lizardo
17f5f61f67 build: Remove leftover from .gitignore
profiles/sap/sap.c used to be a symlink to a SAP driver. This symlink is
not created anymore (only the dummy driver is linked to bluetoothd at
the moment.)
2013-02-20 10:00:58 +02:00
Anderson Lizardo
23f625871d tools: btmgmt: Add missing return after g_main_loop_quit()
This change keeps semantic of previous code that used to call exit()
directly.
2013-02-20 10:00:46 +02:00
Syam Sidhardhan
4c5ba570aa avctp: Fix invalid file descriptor close
During avctp_confirm_cb(), if any error happens we set the session
state to AVCTP_STATE_DISCONNECTED, which inturn try to close fd 0.
2013-02-20 09:59:22 +02:00
Syam Sidhardhan
f6c3832afa tools: Fix compilation error with GINT_TO_POINTER
Fixes the following error:
tools/btmgmt.c: In function ‘index_rsp’:
tools/btmgmt.c:756:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
tools/btmgmt.c: In function ‘cmd_info’:
tools/btmgmt.c:791:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1: all warnings being treated as errors
make[1]: *** [tools/btmgmt.o] Error 1
make: *** [all] Error 2
2013-02-18 18:12:18 +02:00
Johan Hedberg
12d8434dd8 tools: btmgmt: Remove old unused mgmt command handling 2013-02-18 14:38:29 +02:00
Johan Hedberg
f4ec6b5175 tools: btmgmt: Convert User Confirm replies from mgmt_send_cmd to mgmt_reply 2013-02-18 14:33:03 +02:00
Johan Hedberg
b6c4f06585 tools: btmgmt: Convert PIN replies from mgmt_send_cmd to mgmt_reply 2013-02-18 14:28:59 +02:00
Johan Hedberg
111c0e3671 tools: btmgmt: Convert confirm_name from mgmt_send_cmd to mgmt_send 2013-02-18 14:23:58 +02:00
Johan Hedberg
947a7477d2 tools: btmgmt: Convert from mgmt_send_cmd to mgmt_send 2013-02-18 14:19:54 +02:00
Johan Hedberg
bd35ad3e67 tools: btmgmt: Convert authentication request event monitoring to new API 2013-02-18 12:58:38 +02:00
Johan Hedberg
87649e87f5 tools: btmgmt: Convert device found event monitoring to new API 2013-02-18 12:51:51 +02:00
Johan Hedberg
b7dcbc79e7 tools: btmgmt: Convert local name changed event monitoring to new API 2013-02-18 12:48:58 +02:00
Johan Hedberg
bfce7f800b tools: btmgmt: Convert auth failed event monitoring to new API 2013-02-18 12:47:00 +02:00
Johan Hedberg
850b9d7c9b tools: btmgmt: Convert connection event monitoring to new API 2013-02-18 12:41:37 +02:00
Johan Hedberg
b8c9114f9e tools: btmgmt: Convert new link key event monitoring to new API 2013-02-18 12:37:45 +02:00
Johan Hedberg
cab7bd44d5 tools: btmgmt: Prefer quitting mainloop over calling exit() directly 2013-02-18 12:35:47 +02:00
Johan Hedberg
a02bd1b257 tools: btmgmt: Convert discovering event monitoring to new API 2013-02-18 11:56:22 +02:00
Johan Hedberg
e12790fc9c tools: btmgmt: Convert new settings event monitoring to new API 2013-02-18 11:53:56 +02:00
Johan Hedberg
aaf689ce71 tools: btmgmt: Convert to using GLib main loop 2013-02-18 11:50:39 +02:00
Johan Hedberg
ac57ca0008 tools: btmgmt: Convert index added/removed events monitoring to new API 2013-02-18 11:42:46 +02:00
Johan Hedberg
c2555c3149 tools: btmgmt: Convert controller error event monitoring to new API 2013-02-18 11:38:51 +02:00
Johan Hedberg
17fff52ab1 tools: btmgmt: Add initial stubs for converting to new mgmt API 2013-02-18 11:32:50 +02:00
Johan Hedberg
5008dc2ba9 doc: Add short explanation for how to create mgmt sockets 2013-02-18 10:37:53 +02:00
Anderson Lizardo
accf3e8144 unit: Add tests for sdp_get_server_ver() 2013-02-18 10:01:53 +02:00
Anderson Lizardo
78ca13b4f7 unit: Add tests for sdp_get_profile_descs() 2013-02-18 10:01:50 +02:00
Anderson Lizardo
b52d10d7ab lib: Validate DTDs when parsing VersionNumberList 2013-02-18 10:01:27 +02:00
Anderson Lizardo
4c07609a59 lib: Add comment to BluetoothProfileDescriptorList parsing workaround
Commits 0f5a5a9580 and
46b3a3d2d0 introduced this workaround.
2013-02-18 10:01:23 +02:00
Anderson Lizardo
bbabc6792c lib: Validate DTDs when parsing BluetoothProfileDescriptorList
The "seq->val.dataseq != NULL" check is also removed from the for()
statement because it should be done after verifying that the data
element is a sequence (inside the "if (SDP_IS_SEQ(...))" block.)
2013-02-18 10:01:06 +02:00
Anderson Lizardo
1e75de470e lib: Validate DTDs when parsing LanguageBaseAttributeIDList
Also check if the required number of entries is present.
2013-02-18 10:00:52 +02:00
Anderson Lizardo
67c7f0bf9b lib: Add missing DTD validation in sdp_record_print() 2013-02-18 10:00:33 +02:00
Anderson Lizardo
429cee00a5 unit: Add tests for sdp_get_lang_attr() 2013-02-18 09:59:39 +02:00
Anderson Lizardo
fcb9ece0f9 lib: Fix missing DTD validation while accessing SDP data elements
It is necessary to validate the sdp_data_t "dtd" field before accessing
the "val" union members, specially when handling SDP_SEQ*, SDP_ALT* and
SDP_STR* elements, otherwise remote devices can trigger memory
corruption by passing invalid data elements where others are expected.
2013-02-18 09:59:35 +02:00
Anderson Lizardo
9e2d91bc75 lib: Add SDP_IS_ALT() macro
This macro will simplify internal SDP library code, and is similar to
the existing SDP_IS_SEQ() macro.
2013-02-18 09:59:35 +02:00
Anderson Lizardo
5e72074c9c lib: Cleanup coding style in sdp_get_proto_descs() 2013-02-18 09:59:35 +02:00
Anderson Lizardo
eff66b3ebb lib: Reuse identical code in sdp_get_{add,}_access_protos()
sdp_get_access_protos() and sdp_get_add_access_protos() do almost
exactly the same thing, except for an additional statement for the
latter.
2013-02-18 09:59:34 +02:00
Anderson Lizardo
a9544b8062 unit: Add initial SDP library unit tests
These tests will cover all public SDP library API not covered yet by the
tests in test-sdp.c (which focus on the SDP server).
2013-02-18 09:55:03 +02:00
Luiz Augusto von Dentz
a11adccb08 AVRCP: Fix parsing of SetBrowsedPlayer response
Folder depth is actually the byte 13 not 14 of the response.
2013-02-15 16:44:22 +02:00
Luiz Augusto von Dentz
fd6381cd7e AVRCP: Add support for GetItemAttributes
GetItemAttributes should be used instead of GetElementAttributes if
browsing is supported.
2013-02-15 16:39:51 +02:00
Luiz Augusto von Dentz
89f1f6a629 AVRCP: Create folders for /Filesystem and /NowPlaying
If browsing is supported create objects representing /Filesystem and
/NowPlaying, these object implement MediaItem interface and can be
passed to ChangeFolder to change the scope.
2013-02-15 16:35:26 +02:00
Luiz Augusto von Dentz
0eb8474255 AVRCP: Move features to avrcp.c
avrcp.c should be responsible for specifics of AVRCP not player.c which
is more high level abstraction.
2013-02-15 16:35:12 +02:00
Luiz Augusto von Dentz
6b3eb942cd media-api: Fix referencing to MediaLibrary instead of MediaFolder
MediaLibrary was replaced by MediaFolder so doesn't exist anymore.
2013-02-15 16:35:03 +02:00
Luiz Augusto von Dentz
771594ef67 AVRCP: Parse browsing and searching features bits
This parses browsing and searching features bits and set the respective
property.
2013-02-15 16:34:40 +02:00
Luiz Augusto von Dentz
7508d96899 AVRCP: Prefix folder name with /Filesystem
This separate the scopes of the folder as documented in doc/media-api.txt
2013-02-15 16:34:04 +02:00
Johan Hedberg
ab5be5cb35 neard: Use more appropriate log levels than info() 2013-02-15 16:32:38 +02:00