summaryrefslogtreecommitdiff
path: root/obexd/client/pbap.c
AgeCommit message (Collapse)AuthorFilesLines
2013-05-01obexd: Get rid of gintLucas De Marchi1-3/+3
Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
2013-01-04obexd: Remove the total silly usage of gchar and replace it with charMarcel Holtmann1-12/+12
2012-12-22obexd: Update string enumeration values to lower caseJohan Hedberg1-9/+9
2012-12-21obex-client: Rename org.bluez.obex.PhonebookAccess to PhonebookAccess1Luiz Augusto von Dentz1-1/+1
Rename the interface and move it to obexd-api.txt since it now belongs to the same daemon.
2012-12-07Revert "Ensure config.h is included by using CPPFLAGS"Johan Hedberg1-0/+4
This reverts commit 8a03376544b046a84301847d1594f6c3674983ff. The patch needs to be split up and the gdbus/ changes were bogus compared to the original commit message. Conflicts: Makefile.am Makefile.obexd profiles/cyclingspeed/cyclingspeed.c profiles/heartrate/heartrate.c src/error.c
2012-12-05Use entire include path for gobex.hLucas De Marchi1-1/+1
2012-12-05Use the entire include path for gdbus.hLucas De Marchi1-1/+1
2012-12-05Ensure config.h is included by using CPPFLAGSLucas De Marchi1-4/+0
Instead of trying to include config.h in each file over the tree and possibly forgetting to include it, give a "-include config.h" argument to the compiler so it's guaranteed that a) it will be included for all source files and b) it will be the first header included. gdbus/ directory is left out, since it would break other projects using it.
2012-12-04obexd: Fix sending absolute pathLuiz Augusto von Dentz1-1/+1
As per OBEX spec the NAME header should not contain absolute paths
2012-12-04obexd: Fix freeing apparam data on PBAP moduleLuiz Augusto von Dentz1-2/+0
Invalid read of size 8 at 0x40EC04: g_obex_apparam_free (gobex-apparam.c:362) by 0x41A66A: obc_transfer_free (transfer.c:272) by 0x413221: pending_request_free (session.c:163) by 0x413659: session_terminate_transfer (session.c:745) by 0x41A53E: xfer_complete (transfer.c:518) by 0x41B5D7: get_xfer_progress_first (transfer.c:562) by 0x409750: handle_response (gobex.c:948) by 0x40A609: incoming_data (gobex.c:1191) by 0x371D047824: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x371D047B57: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x371D047F51: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x40542F: main (main.c:175) Address 0x4f64510 is 0 bytes inside a block of size 8 free'd at 0x4A079AE: free (vg_replace_malloc.c:427) by 0x371D04D50E: g_free (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x416060: phonebook_size_callback (pbap.c:266) by 0x413651: session_terminate_transfer (session.c:743) by 0x41A53E: xfer_complete (transfer.c:518) by 0x41B5D7: get_xfer_progress_first (transfer.c:562) by 0x409750: handle_response (gobex.c:948) by 0x40A609: incoming_data (gobex.c:1191) by 0x371D047824: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x371D047B57: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x371D047F51: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x40542F: main (main.c:175)
2012-12-04obexd: Avoid extra copies while passing apparam to transferLuiz Augusto von Dentz1-29/+13
By passing directly the reference to GObexApparam it is no longer necessary to use intermediate buffers to pass data around.
2012-12-04obexd: Move common code to pull_phonebookLuiz Augusto von Dentz1-49/+30
2012-12-04obexd: Remove deprecated methods from PhonebookAccessLuiz Augusto von Dentz1-183/+14
SetFormat, SetOrder, SetFilter and GetFilter methods are no longer necessary as other methods now take them as parameters to avoid round trips.
2012-12-04obexd: Add filters to PhonebookAccess.List and PhonebookAccess.SearchLuiz Augusto von Dentz1-39/+76
This avoid D-Bus round trips and is more aligned with what has been proposed for MessageAccess interface.
2012-12-04obexd: Add filters to PhonebookAccess.PullLuiz Augusto von Dentz1-26/+52
This avoid D-Bus round trips and is more aligned with what has been proposed for MessageAccess interface.
2012-12-04obexd: Add filters to Phonebook.PullAllLuiz Augusto von Dentz1-46/+210
This avoid D-Bus round trips and is more aligned with what has been proposed for MessageAccess interface.
2012-12-04obexd: Port PBAP module to use GObexApparamLuiz Augusto von Dentz1-132/+49
2012-12-04obexd: Fix pbap_select using absolute path with known locationsLudek Finstrle1-2/+2
pbap_select has to use absolute path with known location to support repeatable pbap_select calls. In other way the second call fails.
2012-12-04obexd: Fix dead assignmentsSzymon Janc1-1/+1
Values stored are never read.
2012-12-04obexd: Use g_malloc0 in get_filter_strsSzymon Janc1-4/+1
Use g_malloc0 instead of g_try_malloc0 to allocate list. All users expects to get valid pointer from it anyway. Also size of allocated memory is small.
2012-12-04obexd: Fix using org.openobex.ErrorLuiz Augusto von Dentz1-32/+38
In addition use define so it is easier to change this in future
2012-12-04obexd: Rename PhonebookAccess interface to org.bluez.obex.PhonebookAccessLuiz Augusto von Dentz1-1/+1
2012-12-04obexd: PhonebookAccess sessions return transfersMikel Astiz1-86/+75
Return the D-Bus path of the transfer representing the operation.
2012-12-04obexd: Do not set signature and reply in GDBus tablesLucas De Marchi1-11/+11
Use GDBUS_* macros, so signature and reply fields are not set in each method/signal.
2012-12-04obexd: Convert GDBus methods to use macro helpersLucas De Marchi1-17/+35
With these macro helpers we can separate in/out arguments and use their own vector.
2012-12-04obexd: Constify GDBus method tablesMarcel Holtmann1-1/+1
Constify method tables with the following command: find . -name '*.[ch]' -exec \ sed -i 's/\(GDBusMethodTable .* =\)/const \1/g' {} \;
2012-12-04obexd: Use stack memory for application parameters in pbap moduleLuiz Augusto von Dentz1-3/+1
The maximum amount needed is known and sufficiently small to be in the stack which is much simpler to deal with.
2012-12-04obexd: Add obc_transfer_set_params to set application parametersLuiz Augusto von Dentz1-19/+22
The parameters are optional and only used in a few occasions so it doesn't make sense to have that directly in obc_transfer_get and obc_transfer_put.
2012-12-04obexd: Create transfers in modulesMikel Astiz1-36/+46
After this patch the modules are responsible for creating the transfers, and these objects must be queued using the session API. This way the transfer initiator has full access to the transfer object, in case for example it wants to access some member variable.
2012-12-04obexd: Use new session callback style in modulesMikel Astiz1-5/+5
The session API now provides the transfer object in the callback, so the modules can directly access the transfer object.
2012-12-04obexd: Give transfer pointer in session callbacksMikel Astiz1-5/+10
Operations involving a transfer object will receive a pointer to such transfer in the callback. Note that the ownership of this object is not changed in any way, meaning that the session is still responsible for it. However this pointer can be useful during the execution of the callback, in order to access data members of the transfer.
2012-12-04obexd: Minor buffer access API changesMikel Astiz1-1/+1
Trivial changes in buffer getters in both session and transfer, regarding the access of transfer parameters: - const qualifiers added, to avoid unwanted frees - Buffers are now returned as void* instead of guint8*
2012-12-04obexd: Fix not propagating GError in session API functionsLuiz Augusto von Dentz1-18/+29
The errors should be properly forward to the caller and not just convert to generic error.
2012-12-04obexd: Remove buffer based transferLuiz Augusto von Dentz1-12/+27
Simplify the code by using temporary files and eliminates reallocations.
2012-12-04obexd: Fix possible memory leak on pbap moduleLuiz Augusto von Dentz1-0/+1
16 bytes in 1 blocks are definitely lost in loss record 26 of 146 at 0x4A075B2: realloc (vg_replace_malloc.c:525) by 0x3B5104B76D: g_realloc (in /lib64/libglib-2.0.so.0.3000.2) by 0x3B51064A96: ??? (in /lib64/libglib-2.0.so.0.3000.2) by 0x3B51065156: g_string_insert_len (in /lib64/libglib-2.0.so.0.3000.2) by 0x3B510305BC: ??? (in /lib64/libglib-2.0.so.0.3000.2) by 0x3B51031BE7: g_build_filename (in /lib64/libglib-2.0.so.0.3000.2) by 0x416FEE: pbap_select (pbap.c:254) by 0x406CCE: process_message (object.c:224) by 0x3B5301D9A0: ??? (in /lib64/libdbus-1.so.3.5.6) by 0x3B5300F92F: dbus_connection_dispatch (in /lib64/libdbus-1.so.3.5.6)
2012-12-04obexd: queue transfers in pbap sessionsMikel Astiz1-61/+66
Previous implementation reported busy when trying to queue several operations in the same session.
2012-12-04obexd: fix pbap select when same path given twiceMikel Astiz1-43/+16
If the same path is selected twice, the operation can be skipped but the D-Bus response should still be sent.
2012-12-04obexd: fix incorrect error checkMikel Astiz1-2/+4
Previous statement always returned success.
2012-12-04obexd: remove use of gobex in pbap moduleLuiz Augusto von Dentz1-94/+43
gobex should not be use directly as it can interfere with ongoing requests of the session.
2012-12-04obexd: fix circular dependency of session and transferLuiz Augusto von Dentz1-32/+10
Currently the code has to to pass session to transfer via user data (void *) only to be casted to session.
2012-12-04obexd: fix parsing of apparam on pbap driverLuiz Augusto von Dentz1-5/+6
Both hdr and size need to be updated otherwise no parameters will be parsed.
2012-12-04obexd: port to gobexLuiz Augusto von Dentz1-40/+104
This remove gwobex dependency of the client using gobex instead. Based on initial work by Johan Hedberg <johan.hedberg@intel.com>
2012-12-04obexd: add pbap targetLuiz Augusto von Dentz1-16/+66
pbap target implements phonebook access driver
2012-12-04obexd: make use of obc_ prefix for public functionsLuiz Augusto von Dentz1-27/+27
This should indicate more clearer which function are public to the drivers.
2012-12-04obexd: add target driver supportLuiz Augusto von Dentz1-0/+2
This simplify target matching to a single place making it easier to add new targets/profiles. Matching is done by either friendly name e.g. opp, ftp... or Bluetooth UUID. Drivers are probed when a session is established and removed when the session is destroyed.
2012-12-04obexd: make transfer structure privateLuiz Augusto von Dentz1-24/+18
This make it easier to modularize obex-client
2012-12-04obexd: make session structure privateLuiz Augusto von Dentz1-123/+161
Session data should not be acessible directly otherwise it cause too much dependency by profile specific code which is quite inefficient in the long term.
2012-12-04obexd: Fix endian conversion for appparams in pbap clientBartosz Szatkowski1-1/+1
2012-12-04obexd: Fix format string warnings for g_dbus_create_errorJohan Hedberg1-1/+1
This patch fixes gcc warnings for "format not a string literal and no format arguments".
2012-12-04obexd: Make sure errors are reported properly to applicationsLuiz Augusto von Dentz1-3/+3
Error message were most of the time empty. Thanks for Vitja Makarov <vitja.makarov@gmail.com> for reporting this.