* Re: [PATCH v4] Implement ATT handle indications
From: Claudio Takahasi @ 2011-03-10 14:16 UTC (permalink / raw)
To: Elvis Pfützenreuter; +Cc: linux-bluetooth
In-Reply-To: <1299765690-16322-1-git-send-email-epx@signove.com>
SGkgRWx2aXMsCgpJcyBpdCBhbGxvd2VkIHRvIGhhdmUgbm90aWZpY2F0aW9uIGFuZCBpbmRpY2F0
aW9uIGJpdHMgc2V0IHRvIHRoZSBzYW1lCmNoYXJhY3RlcmlzdGljPwpJZiBpdCBpcyBub3QgYWxs
b3dlZCB5b3UgY291bGQgc2ltcGxpZnkgdGhlIGxvZ2ljIGluc2lkZSB0aGUgImZvciIuCgpPbiBU
aHUsIE1hciAxMCwgMjAxMSBhdCAyOjAxIFBNLCBFbHZpcyBQZsO8dHplbnJldXRlciA8ZXB4QHNp
Z25vdmUuY29tPiB3cm90ZToKPiBUaGlzIHBhdGNoIHRha2VzIGFkdmFudGFnZSBvZiBnX2F0dHJp
Yl9zZW5kKCkgaW1wbGljaXQgZ3VhcmFudGVlIG9mCj4gcXVldWVpbmcgaS5lLiBpbmRpY2F0aW9u
IGlzIG9ubHkgc2VudCBpZiB0aGUgcHJldmlvdXMgb25lIGhhcyBiZWVuCj4gY29uZmlybWVkLCBz
byB3ZSBkb24ndCBuZWVkIHRvIG1haW50YWluIGFuIGV4cGxpY2l0IHF1ZXVlLgo+IC0tLQo+IMKg
c3JjL2F0dHJpYi1zZXJ2ZXIuYyB8IMKgIDE2ICsrKysrKysrKysrKysrKysKPiDCoDEgZmlsZXMg
Y2hhbmdlZCwgMTYgaW5zZXJ0aW9ucygrKSwgMCBkZWxldGlvbnMoLSkKPgo+IGRpZmYgLS1naXQg
YS9zcmMvYXR0cmliLXNlcnZlci5jIGIvc3JjL2F0dHJpYi1zZXJ2ZXIuYwo+IGluZGV4IGI5ODBi
MjguLmYxNTc0MjQgMTAwNjQ0Cj4gLS0tIGEvc3JjL2F0dHJpYi1zZXJ2ZXIuYwo+ICsrKyBiL3Ny
Yy9hdHRyaWItc2VydmVyLmMKPiBAQCAtODc1LDYgKzg3NSw4IEBAIHN0YXRpYyB2b2lkIGNoYW5u
ZWxfaGFuZGxlcihjb25zdCB1aW50OF90ICppcGR1LCB1aW50MTZfdCBsZW4sCj4gwqAgwqAgwqAg
wqAgwqAgwqAgwqAgwqBsZW5ndGggPSBmaW5kX2J5X3R5cGUoc3RhcnQsIGVuZCwgJnV1aWQsIHZh
bHVlLCB2bGVuLAo+IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgb3BkdSwgY2hhbm5lbC0+bXR1
KTsKPiDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoGJyZWFrOwo+ICsgwqAgwqAgwqAgY2FzZSBBVFRf
T1BfSEFORExFX0NORjoKPiArIMKgIMKgIMKgIMKgIMKgIMKgIMKgIHJldHVybjsKPiDCoCDCoCDC
oCDCoGNhc2UgQVRUX09QX1JFQURfTVVMVElfUkVROgo+IMKgIMKgIMKgIMKgY2FzZSBBVFRfT1Bf
UFJFUF9XUklURV9SRVE6Cj4gwqAgwqAgwqAgwqBjYXNlIEFUVF9PUF9FWEVDX1dSSVRFX1JFUToK
PiBAQCAtOTcyLDYgKzk3NCwyMCBAQCBzdGF0aWMgdm9pZCBhdHRyaWJfbm90aWZ5X2NsaWVudHMo
c3RydWN0IGF0dHJpYnV0ZSAqYXR0cikKPiDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoGdfYXR0cmliX3NlbmQoY2hhbm5lbC0+YXR0cmliLCAwLCBwZHVbMF0sIHBkdSwgbGVuLAo+
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgTlVMTCwgTlVMTCwgTlVMTCk7Cj4gwqAgwqAgwqAg
wqAgwqAgwqAgwqAgwqB9Cj4gKwo+ICsgwqAgwqAgwqAgwqAgwqAgwqAgwqAgLyogSW5kaWNhdGlv
biAqLwo+ICsgwqAgwqAgwqAgwqAgwqAgwqAgwqAgaWYgKGdfc2xpc3RfZmluZF9jdXN0b20oY2hh
bm5lbC0+aW5kaWNhdGUsCj4gKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoCDCoCDCoCDCoCDCoCDCoCBHVUlOVF9UT19QT0lOVEVSKGhhbmRsZSksIGhhbmRsZV9jbXAp
KSB7Cj4gKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCB1aW50OF90IHBkdVtBVFRf
TUFYX01UVV07Cj4gKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCB1aW50MTZfdCBs
ZW47CgpUaGUgc2FtZSBkZWNsYXJhdGlvbnMocGR1IGFuZCBsZW4pIGV4aXN0ICBmb3IgTm90aWZp
Y2F0aW9uLiBJIHN1Z2dlc3QKbW92ZSB0byB0aGUgb3V0ZXIgc2NvcGUuCgpCUiwKQ2xhdWRpbwoK
PiArCj4gKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCBsZW4gPSBlbmNfaW5kaWNh
dGlvbihhdHRyLCBwZHUsIGNoYW5uZWwtPm10dSk7Cj4gKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoCDCoCDCoCBpZiAobGVuID09IDApCj4gKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoCDCoCDCoCDCoCDCoCByZXR1cm47Cj4gKwo+ICsgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg
wqAgwqAgwqAgZ19hdHRyaWJfc2VuZChjaGFubmVsLT5hdHRyaWIsIDAsIHBkdVswXSwgcGR1LCBs
ZW4sCj4gKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCBOVUxMLCBOVUxMLCBOVUxMKTsKPiArIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIH0KPiDCoCDCoCDCoCDCoH0KPiDCoH0KPgo+IC0tCj4gMS43LjEK
Pgo+IC0tCj4gVG8gdW5zdWJzY3JpYmUgZnJvbSB0aGlzIGxpc3Q6IHNlbmQgdGhlIGxpbmUgInVu
c3Vic2NyaWJlIGxpbnV4LWJsdWV0b290aCIgaW4KPiB0aGUgYm9keSBvZiBhIG1lc3NhZ2UgdG8g
bWFqb3Jkb21vQHZnZXIua2VybmVsLm9yZwo+IE1vcmUgbWFqb3Jkb21vIGluZm8gYXQgwqBodHRw
Oi8vdmdlci5rZXJuZWwub3JnL21ham9yZG9tby1pbmZvLmh0bWwKPgo=
^ permalink raw reply
* Re: [PATCH v2 3/4] Sim Access Profile Server
From: Johan Hedberg @ 2011-03-10 14:28 UTC (permalink / raw)
To: Waldemar Rymarkiewicz; +Cc: linux-bluetooth, padovan, Marcel Holtmann
In-Reply-To: <1298549606-16594-4-git-send-email-waldemar.rymarkiewicz@tieto.com>
Hi Waldek,
Some coding-style issues here. In general please refer to the kernel
CodingStyle document. In addition to that the ofono project has quite a
good document to complement the kernel guidelines:
http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/coding-style.txt;hb=HEAD
On Thu, Feb 24, 2011, Waldemar Rymarkiewicz wrote:
> +/* Connection Status - SAP v1.1 section 5.2.2 */
> +typedef enum {
> + SAP_STATUS_OK = 0x00,
> + SAP_STATUS_CONNECTION_FAILED = 0x01,
> + SAP_STATUS_MAX_MSG_SIZE_NOT_SUPPORTED = 0x02,
> + SAP_STATUS_MAX_MSG_SIZE_TOO_SMALL = 0x03,
> + SAP_STATUS_OK_ONGOING_CALL = 0x04
> +} sap_status_t;
...
> +enum sap_protocol {
> + SAP_CONNECT_REQ = 0x00,
Why do you have typedef for the first, but not for the second? In
general the tendency in the source tree is to avoid typedefs where ever
possible (since they make it more difficult to discover the real types
of variables) so I'd lean towards removing the typedefs where you've
used them now.
> +/* Parameters Ids - SAP 1.1 section 5.2 */
> +#define SAP_PARAM_ID_MAX_MSG_SIZE 0x00
> +#define SAP_PARAM_ID_MAX_MSG_SIZE_LEN 0x02
And here you've got defines instead of enums. What rule have you used to
make the choice regarding when to use what?
> +static int send_message(struct sap_connection *conn, void *buf, gssize size)
> +{
> + gsize written = 0;
> + GError *gerr = NULL;
> + GIOStatus gstatus;
> +
> + if (!conn || !buf)
> + return -1;
> +
> + DBG("size = %d",(unsigned int)size);
Firstly, there's a space missing after the typecast. Secondly, you
should need the typecast here. AFAIK gsize is the same as size_t which
maps to the %zu format specifier. Actually, if possible please avoid
using GLib types for which libc already provides good alternatives. I.e.
size_t in your own code might actually work fine.
> + gstatus = g_io_channel_write_chars(conn->io, buf, size, &written,
> + &gerr);
> +
> + if (gstatus != G_IO_STATUS_NORMAL) {
No empty line needed before the if-statement (check the ofono guidelines
about this).
> + if (written != (gsize)size)
Missing space before after the typecast.
> + error("write error.(written %d size %d)", written, size);
Seems like the format specifiers might be wrong here. %zu for size_t and
%zd for ssize_t.
> + if (!conn)
> + return -1;
In general, try to avoid -1 as a return code and use more specific POSIX
codes instead, e.g. -EINVAL here. That makes it easier to add more
fine-grained error handling later.
> + if (conn->state != SAP_STATE_GRACEFUL_DISCONNECT &&
> + conn->state != SAP_STATE_IMMEDIATE_DISCONNECT) {
> + error("Processing error (state %.2X pr %.2X param)",
> + conn->state, conn->processing_req);
> + return -EPERM;
> + }
Ah, I see here you do it. So you're actually being inconsistent with
yourself in the first case.
> + if (!param)
> + goto error_rsp;
> +
> + if (conn->state != SAP_STATE_DISCONNECTED) {
> + goto error_rsp;
> + }
No {} for one-line scopes (and you're inconsistent with yourself even
within the same function here since the first if-statement doesn't have
{}.
> +static int disconnect_req(struct sap_connection *conn
> + , sap_disconnection_type_t disc_type)
What's up with the stray "," in the beginning of the second line?
> +{
> +
> + DBG("conn %p type 0x%.2X state %d", conn, disc_type, conn->state);
No empty line after the {
> + }
> + /* Disconnection is ongoing - do nothing. */
> + return 0;
Empty line after the }
> + error("Processing error (state %.2X pr %.2X param)", conn->state,
> + conn->processing_req);
I think the convention for printing byte values is 0x%02x. Also, seems
like the second line might be too little indented (it should be as much
as possible as long as the line remains under 80 columns.
> +
> + return FALSE;
> +}
> +
> +
> +int sap_connect_rsp(void *sap_device, sap_status_t status, uint16_t maxmsgsize)
Never two consecutive empty lines anywhere.
> + DBG("state %x pr %x status %x", conn->state, conn->processing_req,
> + status);
You seem to be quite inconsistent with printing byte values in hex
format. I suppose 0x%02x should be used for req and status while for
state %d might make most sense.
> + DBG("state %x pr %x", conn->state, conn->processing_req);
Same here.
> + switch (conn->state) {
> + case SAP_STATE_CLIENT_DISCONNECT:
> + memset(&msg, 0, sizeof(msg));
> + msg.id = SAP_DISCONNECT_RESP;
> +
> + conn->state = SAP_STATE_DISCONNECTED;
> + conn->processing_req = SAP_NO_REQ;
> +
> + /* Timer will close channel if client doesn't do it.*/
> + start_guard_timer(conn, SAP_TIMER_NO_ACTIVITY);
> +
> + return send_message(sap_device, &msg, sizeof(msg));
> +
> + case SAP_STATE_IMMEDIATE_DISCONNECT:
> + conn->state = SAP_STATE_DISCONNECTED;
> + conn->processing_req = SAP_NO_REQ;
> +
> + if (conn->io) {
> + g_io_channel_shutdown(conn->io, TRUE, NULL);
> + g_io_channel_unref(conn->io);
> + }
> + return 0;
> + default:
You're being inconsistent with yourself here. In the first case branch
you've got an empty line after the return statement. In the second
branch you don't. To me the one with the empty line if more readable.
Also, please add an empty line after the closing } of the if-statement.
> + if (!conn)
> + return -1;
Probably -EINVAL?
> +
> + conn->processing_req = SAP_NO_REQ;
> + return send_message(sap_device, buf, size);
> +}
Add an empty line before the return.
I'm running out of time here, so I'll need to get back to this patch
later (it is quite huge btw, so if at all possible try splitting it up
into smaller patches).
Johan
^ permalink raw reply
* Re: [PATCH v4] Implement ATT handle indications
From: Johan Hedberg @ 2011-03-10 14:31 UTC (permalink / raw)
To: Elvis Pf??tzenreuter; +Cc: linux-bluetooth
In-Reply-To: <1299765690-16322-1-git-send-email-epx@signove.com>
Hi Elvis,
On Thu, Mar 10, 2011, Elvis Pf??tzenreuter wrote:
> This patch takes advantage of g_attrib_send() implicit guarantee of
> queueing i.e. indication is only sent if the previous one has been
> confirmed, so we don't need to maintain an explicit queue.
> ---
> src/attrib-server.c | 16 ++++++++++++++++
> 1 files changed, 16 insertions(+), 0 deletions(-)
Pushed upstream. Thanks.
Johan
^ permalink raw reply
* Re: [PATCH v4] Implement ATT handle indications
From: Elvis Pfützenreuter @ 2011-03-10 14:35 UTC (permalink / raw)
To: Claudio Takahasi, André Dieb; +Cc: linux-bluetooth
In-Reply-To: <AANLkTimoeb9NAsuN3QS+UP1P2obYhY7rj+D-Ww4G1+QV@mail.gmail.com>
On 10 Mar 2011, at 11:16 , Claudio Takahasi wrote:
> Hi Elvis,
>
> Is it allowed to have notification and indication bits set to the same
> characteristic?
Client Characteristic Configuration is a bitmap, and in theory it is possible
for a client to set both bits (configuration and indication), even though it
looks silly to do so. BlueZ currently allows this and I didn't find any
mention in the docs preventing it.
André had mentioned something about mutual exclusion of indicaitons and
notifications some days ago. Do you have anything to add, Andre?
^ permalink raw reply
* Re: [PATCH v4] Implement ATT handle indications
From: Anderson Lizardo @ 2011-03-10 14:48 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: Elvis Pfützenreuter, linux-bluetooth
In-Reply-To: <AANLkTimoeb9NAsuN3QS+UP1P2obYhY7rj+D-Ww4G1+QV@mail.gmail.com>
Hi Claudio,
On Thu, Mar 10, 2011 at 10:16 AM, Claudio Takahasi
<claudio.takahasi@openbossa.org> wrote:
> Hi Elvis,
>
> Is it allowed to have notification and indication bits set to the same
> characteristic?
> If it is not allowed you could simplify the logic inside the "for".
The spec does not forbid both indication and notification to be
enabled, as Elvis mentioned.
>> + /* Indication */
>> + if (g_slist_find_custom(channel->indicate,
>> + GUINT_TO_POINTER(handle), handle_cmp)) {
>> + uint8_t pdu[ATT_MAX_MTU];
>> + uint16_t len;
>
> The same declarations(pdu and len) exist for Notification. I suggest
> move to the outer scope.
Actually, it was a suggestion from Johan to move these declarations to
inner scope. But at the time there was only one if() statement, which
justified this.
Anyway, patch is applied, so this can be made into a simple refactor
if you find it better to put in outer scope.
Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
^ permalink raw reply
* [PATCH v2] Fix unloading of adapter drivers
From: Szymon Janc @ 2011-03-10 15:10 UTC (permalink / raw)
To: linux-bluetooth; +Cc: par-gunnar.p.hjalmdahl, henrik.possung, Szymon Janc
In-Reply-To: <201103101516.30070.szymon.janc@tieto.com>
Call driver remove callback only if corresponding probe succeed.
---
src/adapter.c | 47 +++++++++++++++++++++++++++++++----------------
1 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index b119fd1..e8abf42 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -144,6 +144,8 @@ struct btd_adapter {
GSList *powered_callbacks;
gboolean name_stored;
+
+ GSList *loaded_drivers;
};
static void adapter_set_pairable_timeout(struct btd_adapter *adapter,
@@ -2246,23 +2248,25 @@ static void probe_driver(struct btd_adapter *adapter, gpointer user_data)
if (!adapter->up)
return;
+ if (driver->probe == NULL)
+ return;
+
err = driver->probe(adapter);
- if (err < 0)
+ if (err < 0) {
error("%s: %s (%d)", driver->name, strerror(-err), -err);
+ return;
+ }
+
+ adapter->loaded_drivers = g_slist_prepend(adapter->loaded_drivers,
+ driver);
}
static void load_drivers(struct btd_adapter *adapter)
{
GSList *l;
- for (l = adapter_drivers; l; l = l->next) {
- struct btd_adapter_driver *driver = l->data;
-
- if (driver->probe == NULL)
- continue;
-
- probe_driver(adapter, driver);
- }
+ for (l = adapter_drivers; l; l = l->next)
+ probe_driver(adapter, l->data);
}
static void load_connections(struct btd_adapter *adapter)
@@ -2477,16 +2481,20 @@ static void reply_pending_requests(struct btd_adapter *adapter)
}
}
-static void unload_drivers(struct btd_adapter *adapter)
+static void remove_driver(gpointer data, gpointer user_data)
{
- GSList *l;
+ struct btd_adapter_driver *driver = data;
+ struct btd_adapter *adapter = user_data;
- for (l = adapter_drivers; l; l = l->next) {
- struct btd_adapter_driver *driver = l->data;
+ if (driver->remove)
+ driver->remove(adapter);
+}
- if (driver->remove)
- driver->remove(adapter);
- }
+static void unload_drivers(struct btd_adapter *adapter)
+{
+ g_slist_foreach(adapter->loaded_drivers, remove_driver, adapter);
+ g_slist_free(adapter->loaded_drivers);
+ adapter->loaded_drivers = NULL;
}
static void set_mode_complete(struct btd_adapter *adapter)
@@ -3326,9 +3334,16 @@ int btd_register_adapter_driver(struct btd_adapter_driver *driver)
return 0;
}
+static void unload_driver(struct btd_adapter *adapter, gpointer data)
+{
+ adapter->loaded_drivers = g_slist_remove(adapter->loaded_drivers, data);
+}
+
void btd_unregister_adapter_driver(struct btd_adapter_driver *driver)
{
adapter_drivers = g_slist_remove(adapter_drivers, driver);
+
+ manager_foreach_adapter(unload_driver, driver);
}
static void agent_auth_cb(struct agent *agent, DBusError *derr,
--
1.7.0.4
on behalf of ST-Ericsson
^ permalink raw reply related
* Re: some questions about Bluez
From: Gustavo F. Padovan @ 2011-03-10 15:37 UTC (permalink / raw)
To: loody; +Cc: linux-bluetooth
In-Reply-To: <AANLkTims_WHKQ4pNPZNgWS390ASeU8Kw1=w4LN2TOsR3@mail.gmail.com>
Hi Loody,
* loody <miloody@gmail.com> [2011-03-10 20:33:49 +0800]:
> hi all:
> I have some questions about bluetooth.
> 1. how many additional libs that I need to successfully compile bluez?
> so far as I know are:
> a. DBUS
> b. GLIB
> c. ALSA
> d. GSTREAMER
> e. USB
> f. SNDFILE
> g.CAPNG
> am I right?
>
> 2. I try to compile Bluez to run on mips platform.
> What I need is a simple tool which can tell me what kind of bluetooth
> device around my usb bluetooth controller.
> it seems I only need to enable USB lib above, right?
>
> 3. from configure, I found we can turn off features by setting
> "--disable-xxxx", so I use below configure command for configuring
> ./configure --prefix=/media/sdb1/bluez-4.89.mips/build
> --host=mipsel-linux-gnu --disable-optimization --disable-fortify
> --disable-pie --disable-network --disable-serial --disable-input
> --disable-audio --disable-service
>
> but it still complain to me that he cannot find alsa header files and libs.
The ./configure line you provided work for me in x86_64. Can you provide the
logs of ./configure && make?
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* Re: re "bluetooth disabled" and "[BUG] usb problems in .38-rc3+"
From: Justin P. Mattock @ 2011-03-10 18:02 UTC (permalink / raw)
To: Ed Tomlinson, Mikko Vinni, linux-bluetooth, Gustavo F. Padovan
In-Reply-To: <20110310073206.GA1033@jh-x301>
On 03/09/2011 11:32 PM, Johan Hedberg wrote:
> Hi,
>
> On Wed, Mar 09, 2011, Ed Tomlinson wrote:
>>> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
>>> index 9c4541b..f690eb5 100644
>>> --- a/net/bluetooth/hci_core.c
>>> +++ b/net/bluetooth/hci_core.c
>>> @@ -95,18 +95,17 @@ void hci_req_complete(struct hci_dev *hdev, __u16
>>> cmd, int result)
>>> {
>>> BT_DBG("%s command 0x%04x result 0x%2.2x", hdev->name, cmd, result);
>>>
>>> + if (hdev->req_status == HCI_REQ_PEND) {
>>> + hdev->req_result = result;
>>> + hdev->req_status = HCI_REQ_DONE;
>>> + wake_up_interruptible(&hdev->req_wait_q);
>>> + }
>>> /* If the request has set req_last_cmd (typical for multi-HCI
>>> * command requests) check if the completed command matches
>>> * this, and if not just return. Single HCI command requests
>>> * typically leave req_last_cmd as 0 */
>>> if (hdev->req_last_cmd&& cmd != hdev->req_last_cmd)
>>> return;
>>> -
>>> - if (hdev->req_status == HCI_REQ_PEND) {
>>> - hdev->req_result = result;
>>> - hdev->req_status = HCI_REQ_DONE;
>>> - wake_up_interruptible(&hdev->req_wait_q);
>>> - }
>>> }
>>>
>>> static void hci_req_cancel(struct hci_dev *hdev, int err)
>>>
>>
>> Works here too - bluetooth comes up enabled. On to Linus?
>
> All the patch does is it re-breaks the __hci_request function by
> removing proper synchronization from it (again) and thereby hides the
> real bug which is the kernel sending commands to the controller before
> the HCI_Reset command has completed.
>
> Johan
>
well, please send a patch my way and I will test it out!
Justin P. Mattock
^ permalink raw reply
* Re: some questions about Bluez
From: loody @ 2011-03-10 19:01 UTC (permalink / raw)
To: loody, linux-bluetooth; +Cc: Gustavo F. Padovan
In-Reply-To: <20110310153754.GA2190@joana>
[-- Attachment #1: Type: text/plain, Size: 1295 bytes --]
hi gustavo:
2011/3/10 Gustavo F. Padovan <padovan@profusion.mobi>:
> Hi Loody,
>
> * loody <miloody@gmail.com> [2011-03-10 20:33:49 +0800]:
>
>> hi all:
>> I have some questions about bluetooth.
>> 1. how many additional libs that I need to successfully compile bluez?
>> so far as I know are:
>> a. DBUS
>> b. GLIB
>> c. ALSA
>> d. GSTREAMER
>> e. USB
>> f. SNDFILE
>> g.CAPNG
>> am I right?
>>
>> 2. I try to compile Bluez to run on mips platform.
>> What I need is a simple tool which can tell me what kind of bluetooth
>> device around my usb bluetooth controller.
>> it seems I only need to enable USB lib above, right?
>>
>> 3. from configure, I found we can turn off features by setting
>> "--disable-xxxx", so I use below configure command for configuring
>> ./configure --prefix=/media/sdb1/bluez-4.89.mips/build
>> --host=mipsel-linux-gnu --disable-optimization --disable-fortify
>> --disable-pie --disable-network --disable-serial --disable-input
>> --disable-audio --disable-service
>>
>> but it still complain to me that he cannot find alsa header files and libs.
>
> The ./configure line you provided work for me in x86_64. Can you provide the
> logs of ./configure && make?
Here you are :)
--
Regards,
miloody
[-- Attachment #2: log.bz2 --]
[-- Type: application/x-bzip2, Size: 26412 bytes --]
^ permalink raw reply
* [PATCH] Add indication/notification support to interactive gatttool
From: Sheldon Demario @ 2011-03-10 19:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Sheldon Demario
---
attrib/interactive.c | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/attrib/interactive.c b/attrib/interactive.c
index 232cf35..99e99c5 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -98,6 +98,41 @@ static void set_state(enum state st)
rl_redisplay();
}
+static void events_handler(const uint8_t *pdu, uint16_t len, gpointer user_data)
+{
+ uint8_t opdu[ATT_MAX_MTU];
+ uint16_t handle, i, olen;
+
+ handle = att_get_u16(&pdu[1]);
+
+ printf("\n");
+ switch (pdu[0]) {
+ case ATT_OP_HANDLE_NOTIFY:
+ printf("Notification handle = 0x%04x value: ", handle);
+ break;
+ case ATT_OP_HANDLE_IND:
+ printf("Indication handle = 0x%04x value: ", handle);
+ break;
+ default:
+ printf("Invalid opcode\n");
+ return;
+ }
+
+ for (i = 3; i < len; i++)
+ printf("%02x ", pdu[i]);
+
+ printf("\n");
+ rl_forced_update_display();
+
+ if (pdu[0] == ATT_OP_HANDLE_NOTIFY)
+ return;
+
+ olen = enc_confirmation(opdu, sizeof(opdu));
+
+ if (olen > 0)
+ g_attrib_send(attrib, 0, opdu[0], opdu, olen, NULL, NULL, NULL);
+}
+
static void connect_cb(GIOChannel *io, GError *err, gpointer user_data)
{
if (err) {
@@ -107,6 +142,10 @@ static void connect_cb(GIOChannel *io, GError *err, gpointer user_data)
}
attrib = g_attrib_new(iochannel);
+ g_attrib_register(attrib, ATT_OP_HANDLE_NOTIFY, events_handler,
+ attrib, NULL);
+ g_attrib_register(attrib, ATT_OP_HANDLE_IND, events_handler,
+ attrib, NULL);
set_state(STATE_CONNECTED);
}
--
1.7.1
^ permalink raw reply related
* Re: some questions about Bluez
From: Gustavo F. Padovan @ 2011-03-10 19:29 UTC (permalink / raw)
To: loody; +Cc: linux-bluetooth
In-Reply-To: <AANLkTi=ckPmqtRZQvHq5Rkg0jKCuk7uvisM10r+o2hjF@mail.gmail.com>
Hi Loody,
* loody <miloody@gmail.com> [2011-03-11 03:01:52 +0800]:
> hi gustavo:
>
> 2011/3/10 Gustavo F. Padovan <padovan@profusion.mobi>:
> > Hi Loody,
> >
> > * loody <miloody@gmail.com> [2011-03-10 20:33:49 +0800]:
> >
> >> hi all:
> >> I have some questions about bluetooth.
> >> 1. how many additional libs that I need to successfully compile bluez?
> >> so far as I know are:
> >> a. DBUS
> >> b. GLIB
> >> c. ALSA
> >> d. GSTREAMER
> >> e. USB
> >> f. SNDFILE
> >> g.CAPNG
> >> am I right?
> >>
> >> 2. I try to compile Bluez to run on mips platform.
> >> What I need is a simple tool which can tell me what kind of bluetooth
> >> device around my usb bluetooth controller.
> >> it seems I only need to enable USB lib above, right?
> >>
> >> 3. from configure, I found we can turn off features by setting
> >> "--disable-xxxx", so I use below configure command for configuring
> >> ./configure --prefix=/media/sdb1/bluez-4.89.mips/build
> >> --host=mipsel-linux-gnu --disable-optimization --disable-fortify
> >> --disable-pie --disable-network --disable-serial --disable-input
> >> --disable-audio --disable-service
> >>
> >> but it still complain to me that he cannot find alsa header files and libs.
> >
> > The ./configure line you provided work for me in x86_64. Can you provide the
> > logs of ./configure && make?
> Here you are :)
Send in plain text please.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* Re: [PATCH v2] Fix unloading of adapter drivers
From: Johan Hedberg @ 2011-03-10 20:06 UTC (permalink / raw)
To: Szymon Janc; +Cc: linux-bluetooth, par-gunnar.p.hjalmdahl, henrik.possung
In-Reply-To: <1299769834-11133-1-git-send-email-szymon.janc@tieto.com>
Hi Szymon,
On Thu, Mar 10, 2011, Szymon Janc wrote:
> Call driver remove callback only if corresponding probe succeed.
> ---
> src/adapter.c | 47 +++++++++++++++++++++++++++++++----------------
> 1 files changed, 31 insertions(+), 16 deletions(-)
Pushed upstream. Thanks.
Johan
^ permalink raw reply
* Re: [RFC 1/6] Bluetooth: Implement advertising report meta event
From: Andre Guedes @ 2011-03-10 21:56 UTC (permalink / raw)
To: Anderson Briglia; +Cc: linux-bluetooth
In-Reply-To: <AANLkTinNDU3ywqVLNfNn8iGcgM3+8k+Rmicnc85SvKqk@mail.gmail.com>
Ok,
Please, do not consider this patch set, I will rebase and send a v2 soon.
Thanks,
Andre.
On Wed, Mar 9, 2011 at 10:58 AM, Anderson Briglia
<anderson.briglia@openbossa.org> wrote:
>
> Hi,
>
> On Fri, Mar 4, 2011 at 4:35 PM, Andre Guedes <andre.guedes@openbossa.org> wrote:
> > From: Anderson Briglia <anderson.briglia@openbossa.org>
> >
> > This patch implements new LE meta event in order to handle advertising
> > reports.
> >
> > Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
> > ---
> > include/net/bluetooth/hci.h | 18 ++++++++++++++++++
> > net/bluetooth/hci_event.c | 22 ++++++++++++++++++++++
> > 2 files changed, 40 insertions(+), 0 deletions(-)
> >
> > diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> > index d851f8b..fdcc494 100644
> > --- a/include/net/bluetooth/hci.h
> > +++ b/include/net/bluetooth/hci.h
> > @@ -1011,6 +1011,24 @@ struct hci_ev_le_conn_complete {
> > __u8 clk_accurancy;
> > } __packed;
> >
> > +#define ADV_IND 0x00
> > +#define ADV_DIRECT_IND 0x01
> > +#define ADV_SCAN_IND 0x02
> > +#define ADV_NONCONN_IND 0x03
> > +#define SCAN_RSP 0x04
> > +
> > +#define ADDR_DEV_PUBLIC 0x00
> > +#define ADDR_DEV_RANDOM 0x01
> > +
> > +#define HCI_EV_LE_ADVERTISING_REPORT 0x02
> > +struct hci_ev_le_advertising_info {
> > + __u8 evt_type;
> > + __u8 bdaddr_type;
> > + bdaddr_t bdaddr;
> > + __u8 length;
> > + __u8 data[0];
> > +} __packed;
> > +
> > #define HCI_EV_LE_LTK_REQ 0x05
> > struct hci_ev_le_ltk_req {
> > __le16 handle;
> > diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> > index 5a2ab2c..8acc4a5 100644
> > --- a/net/bluetooth/hci_event.c
> > +++ b/net/bluetooth/hci_event.c
> > @@ -2556,6 +2556,24 @@ static inline void hci_le_ltk_request_evt(struct hci_dev *hdev,
> > hci_dev_unlock(hdev);
> > }
> >
> > +static inline void hci_le_adv_report_evt(struct hci_dev *hdev,
> > + struct sk_buff *skb)
> > +{
> > + struct hci_ev_le_advertising_info *ev;
> > + u8 num_reports, i;
> > +
> > + num_reports = skb->data[0];
> > +
> > + ev = (void *) &skb->data[1];
> > +
> > + BT_DBG("adv from: %s", batostr(&ev->bdaddr));
> > +
> > + for (i = 1; i < num_reports; i++) {
> > + ev = (void *) (ev->data + ev->length + 1);
> > + BT_DBG("adv from: %s", batostr(&ev->bdaddr));
> > + }
> > +}
> > +
> > static inline void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb)
> > {
> > struct hci_ev_le_meta *le_ev = (void *) skb->data;
> > @@ -2571,6 +2589,10 @@ static inline void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb)
> > hci_le_ltk_request_evt(hdev, skb);
> > break;
> >
> > + case HCI_EV_LE_ADVERTISING_REPORT:
> > + hci_le_adv_report_evt(hdev, skb);
> > + break;
> > +
> > default:
> > break;
> > }
> > --
> > 1.7.1
> >
> >
>
> Please, do not consider this patch. I have another one with some
> modifications proposed by padovan. Andre, rebase your git tree,
> please.
>
>
> --
> INdT - Instituto Nokia de tecnologia
> +55 2126 1122
> http://techblog.briglia.net
^ permalink raw reply
* Re: some questions about Bluez
From: loody @ 2011-03-11 1:23 UTC (permalink / raw)
To: loody, linux-bluetooth; +Cc: Gustavo F. Padovan
In-Reply-To: <20110310192941.GC2190@joana>
hi:
2011/3/11 Gustavo F. Padovan <padovan@profusion.mobi>:
> Hi Loody,
>
> * loody <miloody@gmail.com> [2011-03-11 03:01:52 +0800]:
>
>> hi gustavo:
>>
>> 2011/3/10 Gustavo F. Padovan <padovan@profusion.mobi>:
>> > Hi Loody,
>> >
>> > * loody <miloody@gmail.com> [2011-03-10 20:33:49 +0800]:
>> >
>> >> hi all:
>> >> I have some questions about bluetooth.
>> >> 1. how many additional libs that I need to successfully compile bluez?
>> >> so far as I know are:
>> >> a. DBUS
>> >> b. GLIB
>> >> c. ALSA
>> >> d. GSTREAMER
>> >> e. USB
>> >> f. SNDFILE
>> >> g.CAPNG
>> >> am I right?
>> >>
>> >> 2. I try to compile Bluez to run on mips platform.
>> >> What I need is a simple tool which can tell me what kind of bluetooth
>> >> device around my usb bluetooth controller.
>> >> it seems I only need to enable USB lib above, right?
>> >>
>> >> 3. from configure, I found we can turn off features by setting
>> >> "--disable-xxxx", so I use below configure command for configuring
>> >> ./configure --prefix=/media/sdb1/bluez-4.89.mips/build
>> >> --host=mipsel-linux-gnu --disable-optimization --disable-fortify
>> >> --disable-pie --disable-network --disable-serial --disable-input
>> >> --disable-audio --disable-service
>> >>
>> >> but it still complain to me that he cannot find alsa header files and libs.
>> >
>> > The ./configure line you provided work for me in x86_64. Can you provide the
>> > logs of ./configure && make?
>> Here you are :)
>
> Send in plain text please.
./configure :
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for mipsel-linux-gnu-strip... mipsel-linux-gnu-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for mipsel-linux-gnu-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for mipsel-linux-gnu-gcc... mipsel-linux-gnu-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mipsel-linux-gnu-gcc accepts -g... yes
checking for mipsel-linux-gnu-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of mipsel-linux-gnu-gcc... gcc3
checking whether mipsel-linux-gnu-gcc and cc understand -c and -o
together... yes
checking whether mipsel-linux-gnu-gcc accepts -fPIE... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for bison... bison -y
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... none needed
checking whether yytext is a pointer... no
checking build system type... i686-pc-linux-gnu
checking host system type... mipsel-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by mipsel-linux-gnu-gcc...
/media/sdb1/toolchain/mips/codesourcery.ss/mips-4.3-154/mipsel-linux-gnu/bin/ld
checking if the linker
(/media/sdb1/toolchain/mips/codesourcery.ss/mips-4.3-154/mipsel-linux-gnu/bin/ld)
is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)...
/media/sdb1/toolchain/mips/codesourcery.ss/mips-novatek/bin/mipsel-linux-gnu-nm
-B
checking the name lister
(/media/sdb1/toolchain/mips/codesourcery.ss/mips-novatek/bin/mipsel-linux-gnu-nm
-B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /media/sdb1/toolchain/mips/codesourcery.ss/mips-4.3-154/mipsel-linux-gnu/bin/ld
option to reload object files... -r
checking for mipsel-linux-gnu-objdump... mipsel-linux-gnu-objdump
checking how to recognize dependent libraries... pass_all
checking for mipsel-linux-gnu-ar... mipsel-linux-gnu-ar
checking for mipsel-linux-gnu-strip... (cached) mipsel-linux-gnu-strip
checking for mipsel-linux-gnu-ranlib... mipsel-linux-gnu-ranlib
checking command to parse
/media/sdb1/toolchain/mips/codesourcery.ss/mips-novatek/bin/mipsel-linux-gnu-nm
-B output from mipsel-linux-gnu-gcc object... ok
checking how to run the C preprocessor... mipsel-linux-gnu-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if mipsel-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
checking for mipsel-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
checking if mipsel-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
checking if mipsel-linux-gnu-gcc static flag -static works... yes
checking if mipsel-linux-gnu-gcc supports -c -o file.o... yes
checking if mipsel-linux-gnu-gcc supports -c -o file.o... (cached) yes
checking whether the mipsel-linux-gnu-gcc linker
(/media/sdb1/toolchain/mips/codesourcery.ss/mips-4.3-154/mipsel-linux-gnu/bin/ld)
supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for ppoll... yes
checking for dlopen in -ldl... yes
checking for DBUS... yes
checking for dbus_watch_get_unix_fd in -ldbus-1... no
checking for dbus_connection_can_send_type in -ldbus-1... no
checking for GLIB... yes
checking for ALSA... yes
checking for clock_gettime in -lrt... yes
checking for GSTREAMER... no
checking for USB... no
checking for usb_get_busses in -lusb... no
checking for usb_interrupt_read in -lusb... no
checking for SNDFILE... no
checking readline/readline.h usability... no
checking readline/readline.h presence... no
checking for readline/readline.h... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating scripts/bluetooth.rules
config.status: creating doc/version.xml
config.status: creating src/bluetoothd.8
config.status: creating bluez.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
make log:
make --no-print-directory all-am
CC audio/audio_libasound_module_pcm_bluetooth_la-pcm_bluetooth.lo
cc1: warning: include location "/usr/include/alsa" is unsafe for
cross-compilation
audio/pcm_bluetooth.c:40:28: error: alsa/asoundlib.h: No such file or directory
audio/pcm_bluetooth.c:41:31: error: alsa/pcm_external.h: No such file
or directory
audio/pcm_bluetooth.c:130: error: expected specifier-qualifier-list
before 'snd_pcm_ioplug_t'
audio/pcm_bluetooth.c:151: error: expected ')' before '*' token
audio/pcm_bluetooth.c:158: error: expected ')' before '*' token
audio/pcm_bluetooth.c: In function 'playback_hw_thread':
audio/pcm_bluetooth.c:171: error: array type has incomplete element type
audio/pcm_bluetooth.c:174: error: 'struct bluetooth_data' has no
member named 'server'
audio/pcm_bluetooth.c:174: error: 'POLLIN' undeclared (first use in
this function)
audio/pcm_bluetooth.c:174: error: (Each undeclared identifier is
reported only once
audio/pcm_bluetooth.c:174: error: for each function it appears in.)
audio/pcm_bluetooth.c:177: error: 'struct bluetooth_data' has no
member named 'server'
audio/pcm_bluetooth.c:178: error: 'struct bluetooth_data' has no
member named 'stream'
audio/pcm_bluetooth.c:181: error: 'struct bluetooth_data' has no
member named 'io'
audio/pcm_bluetooth.c:181: error: 'struct bluetooth_data' has no
member named 'io'
audio/pcm_bluetooth.c:194: error: 'struct bluetooth_data' has no
member named 'stopped'
audio/pcm_bluetooth.c:197: error: 'struct bluetooth_data' has no
member named 'reset'
audio/pcm_bluetooth.c:199: error: 'struct bluetooth_data' has no
member named 'reset'
audio/pcm_bluetooth.c:215: error: 'struct bluetooth_data' has no
member named 'hw_ptr'
audio/pcm_bluetooth.c:215: error: 'struct bluetooth_data' has no
member named 'io'
audio/pcm_bluetooth.c:216: error: 'struct bluetooth_data' has no
member named 'hw_ptr'
audio/pcm_bluetooth.c:216: error: 'struct bluetooth_data' has no
member named 'io'
audio/pcm_bluetooth.c:221: error: 'struct bluetooth_data' has no
member named 'pipefd'
audio/pcm_bluetooth.c:237: warning: implicit declaration of function 'poll'
audio/pcm_bluetooth.c:241: warning: implicit declaration of function 'SNDERR'
audio/pcm_bluetooth.c:248: error: 'POLLERR' undeclared (first use in
this function)
audio/pcm_bluetooth.c:248: error: 'POLLHUP' undeclared (first use in
this function)
audio/pcm_bluetooth.c:248: error: 'POLLNVAL' undeclared (first use in
this function)
audio/pcm_bluetooth.c:256: error: 'struct bluetooth_data' has no
member named 'hw_thread'
audio/pcm_bluetooth.c:171: warning: unused variable 'fds'
audio/pcm_bluetooth.c: At top level:
audio/pcm_bluetooth.c:260: error: expected ')' before '*' token
audio/pcm_bluetooth.c:277: error: expected ')' before '*' token
audio/pcm_bluetooth.c:288: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'bluetooth_pointer'
audio/pcm_bluetooth.c: In function 'bluetooth_exit':
Thanks a lot,
miloody
^ permalink raw reply
* Re: some questions about Bluez
From: Gustavo F. Padovan @ 2011-03-11 2:38 UTC (permalink / raw)
To: loody; +Cc: linux-bluetooth
In-Reply-To: <AANLkTim+dmSSYUJWF=Sd6raSUUurtsbih6YhjH89Q+9w@mail.gmail.com>
Hi Loody,
* loody <miloody@gmail.com> [2011-03-11 09:23:48 +0800]:
> hi:
>
> 2011/3/11 Gustavo F. Padovan <padovan@profusion.mobi>:
> > Hi Loody,
> >
> > * loody <miloody@gmail.com> [2011-03-11 03:01:52 +0800]:
> >
> >> hi gustavo:
> >>
> >> 2011/3/10 Gustavo F. Padovan <padovan@profusion.mobi>:
> >> > Hi Loody,
> >> >
> >> > * loody <miloody@gmail.com> [2011-03-10 20:33:49 +0800]:
> >> >
> >> >> hi all:
> >> >> I have some questions about bluetooth.
> >> >> 1. how many additional libs that I need to successfully compile bluez?
> >> >> so far as I know are:
> >> >> a. DBUS
> >> >> b. GLIB
> >> >> c. ALSA
> >> >> d. GSTREAMER
> >> >> e. USB
> >> >> f. SNDFILE
> >> >> g.CAPNG
> >> >> am I right?
> >> >>
> >> >> 2. I try to compile Bluez to run on mips platform.
> >> >> What I need is a simple tool which can tell me what kind of bluetooth
> >> >> device around my usb bluetooth controller.
> >> >> it seems I only need to enable USB lib above, right?
> >> >>
> >> >> 3. from configure, I found we can turn off features by setting
> >> >> "--disable-xxxx", so I use below configure command for configuring
> >> >> ./configure --prefix=/media/sdb1/bluez-4.89.mips/build
> >> >> --host=mipsel-linux-gnu --disable-optimization --disable-fortify
> >> >> --disable-pie --disable-network --disable-serial --disable-input
> >> >> --disable-audio --disable-service
> >> >>
> >> >> but it still complain to me that he cannot find alsa header files and libs.
> >> >
> >> > The ./configure line you provided work for me in x86_64. Can you provide the
> >> > logs of ./configure && make?
> >> Here you are :)
> >
> > Send in plain text please.
> ./configure :
> configure: WARNING: If you wanted to set the --build type, don't use --host.
> If a cross compiler is detected then cross compile mode will be used.
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for mipsel-linux-gnu-strip... mipsel-linux-gnu-strip
> checking for a thread-safe mkdir -p... /bin/mkdir -p
> checking for gawk... gawk
> checking whether make sets $(MAKE)... yes
> checking whether to enable maintainer-specific portions of Makefiles... no
> checking for mipsel-linux-gnu-pkg-config... no
> checking for pkg-config... /usr/bin/pkg-config
> checking pkg-config is at least version 0.9.0... yes
> checking for mipsel-linux-gnu-gcc... mipsel-linux-gnu-gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... yes
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether mipsel-linux-gnu-gcc accepts -g... yes
> checking for mipsel-linux-gnu-gcc option to accept ISO C89... none needed
> checking for style of include used by make... GNU
> checking dependency style of mipsel-linux-gnu-gcc... gcc3
> checking whether mipsel-linux-gnu-gcc and cc understand -c and -o
> together... yes
> checking whether mipsel-linux-gnu-gcc accepts -fPIE... yes
> checking for a BSD-compatible install... /usr/bin/install -c
> checking for bison... bison -y
> checking for flex... flex
> checking lex output file root... lex.yy
> checking lex library... none needed
> checking whether yytext is a pointer... no
> checking build system type... i686-pc-linux-gnu
> checking host system type... mipsel-unknown-linux-gnu
> checking for a sed that does not truncate output... /bin/sed
> checking for grep that handles long lines and -e... /bin/grep
> checking for egrep... /bin/grep -E
> checking for fgrep... /bin/grep -F
> checking for ld used by mipsel-linux-gnu-gcc...
> /media/sdb1/toolchain/mips/codesourcery.ss/mips-4.3-154/mipsel-linux-gnu/bin/ld
> checking if the linker
> (/media/sdb1/toolchain/mips/codesourcery.ss/mips-4.3-154/mipsel-linux-gnu/bin/ld)
> is GNU ld... yes
> checking for BSD- or MS-compatible name lister (nm)...
> /media/sdb1/toolchain/mips/codesourcery.ss/mips-novatek/bin/mipsel-linux-gnu-nm
> -B
> checking the name lister
> (/media/sdb1/toolchain/mips/codesourcery.ss/mips-novatek/bin/mipsel-linux-gnu-nm
> -B) interface... BSD nm
> checking whether ln -s works... yes
> checking the maximum length of command line arguments... 1572864
> checking whether the shell understands some XSI constructs... yes
> checking whether the shell understands "+="... yes
> checking for /media/sdb1/toolchain/mips/codesourcery.ss/mips-4.3-154/mipsel-linux-gnu/bin/ld
> option to reload object files... -r
> checking for mipsel-linux-gnu-objdump... mipsel-linux-gnu-objdump
> checking how to recognize dependent libraries... pass_all
> checking for mipsel-linux-gnu-ar... mipsel-linux-gnu-ar
> checking for mipsel-linux-gnu-strip... (cached) mipsel-linux-gnu-strip
> checking for mipsel-linux-gnu-ranlib... mipsel-linux-gnu-ranlib
> checking command to parse
> /media/sdb1/toolchain/mips/codesourcery.ss/mips-novatek/bin/mipsel-linux-gnu-nm
> -B output from mipsel-linux-gnu-gcc object... ok
> checking how to run the C preprocessor... mipsel-linux-gnu-gcc -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking for dlfcn.h... yes
> checking for objdir... .libs
> checking if mipsel-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
> checking for mipsel-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
> checking if mipsel-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
> checking if mipsel-linux-gnu-gcc static flag -static works... yes
> checking if mipsel-linux-gnu-gcc supports -c -o file.o... yes
> checking if mipsel-linux-gnu-gcc supports -c -o file.o... (cached) yes
> checking whether the mipsel-linux-gnu-gcc linker
> (/media/sdb1/toolchain/mips/codesourcery.ss/mips-4.3-154/mipsel-linux-gnu/bin/ld)
> supports shared libraries... yes
> checking whether -lc should be explicitly linked in... no
> checking dynamic linker characteristics... GNU/Linux ld.so
> checking how to hardcode library paths into programs... immediate
> checking whether stripping libraries is possible... yes
> checking if libtool supports shared libraries... yes
> checking whether to build shared libraries... yes
> checking whether to build static libraries... no
> checking for ppoll... yes
> checking for dlopen in -ldl... yes
> checking for DBUS... yes
> checking for dbus_watch_get_unix_fd in -ldbus-1... no
> checking for dbus_connection_can_send_type in -ldbus-1... no
> checking for GLIB... yes
> checking for ALSA... yes
> checking for clock_gettime in -lrt... yes
> checking for GSTREAMER... no
> checking for USB... no
> checking for usb_get_busses in -lusb... no
> checking for usb_interrupt_read in -lusb... no
> checking for SNDFILE... no
> checking readline/readline.h usability... no
> checking readline/readline.h presence... no
> checking for readline/readline.h... no
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: creating scripts/bluetooth.rules
> config.status: creating doc/version.xml
> config.status: creating src/bluetoothd.8
> config.status: creating bluez.pc
> config.status: creating config.h
> config.status: config.h is unchanged
> config.status: executing depfiles commands
> config.status: executing libtool commands
>
> make log:
> make --no-print-directory all-am
> CC audio/audio_libasound_module_pcm_bluetooth_la-pcm_bluetooth.lo
> cc1: warning: include location "/usr/include/alsa" is unsafe for
> cross-compilation
That is a cross-compilation issue, there is no problem with BlueZ here.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* Re: some questions about Bluez
From: loody @ 2011-03-11 3:05 UTC (permalink / raw)
To: loody, linux-bluetooth; +Cc: Gustavo F. Padovan
In-Reply-To: <20110311023800.GA2191@joana>
Hi:
> That is a cross-compilation issue, there is no problem with BlueZ here.
>
I know the error comes from that it cannot find the libs and headers.
Is it possible to turn off everything except basic bluetooth detecting
feature such that I don't need to prepare the libs running over MIPS?
If it is possible, how can I do that?
Thanks a lot,
miloody
^ permalink raw reply
* Re: some questions about Bluez
From: Arun K. Singh @ 2011-03-11 5:10 UTC (permalink / raw)
To: loody; +Cc: linux-bluetooth, Gustavo F. Padovan
In-Reply-To: <AANLkTikgVGUHPF_jhBaETndgBDtbwpQ3WeN6TQBZDDRF@mail.gmail.com>
Hi,
>> That is a cross-compilation issue, there is no problem with BlueZ here.
>>
> I know the error comes from that it cannot find the libs and headers.
> Is it possible to turn off everything except basic bluetooth detecting
> feature such that I don't need to prepare the libs running over MIPS?
> If it is possible, how can I do that?
Try disabling audio plugin via --disable-audio in ./configure if that
is the only irritant library ..
>
> Thanks a lot,
> miloody
Thanks,
Arun
^ permalink raw reply
* Re: some questions about Bluez
From: loody @ 2011-03-11 6:25 UTC (permalink / raw)
To: Arun K. Singh; +Cc: linux-bluetooth, Gustavo F. Padovan
In-Reply-To: <AANLkTimj8qN=z=g=DxLcQ6KNhdxvmUK9Ex=q2UFTWu5Q@mail.gmail.com>
hi
2011/3/11 Arun K. Singh <arunkat@gmail.com>:
> Hi,
>
>>> That is a cross-compilation issue, there is no problem with BlueZ here.
>>>
>> I know the error comes from that it cannot find the libs and headers.
>> Is it possible to turn off everything except basic bluetooth detecting
>> feature such that I don't need to prepare the libs running over MIPS?
>> If it is possible, how can I do that?
>
> Try disabling audio plugin via --disable-audio in ./configure if that
> is the only irritant library ..
>
I did so as below:
./configure --host=mipsel-linux-gnu --disable-optimization
--disable-fortify --disable-pie --disable-network --disable-serial
--disable-input --disable-audio --disable-service
But it still try to compile ALSA.
thanks a lot,
miloody
^ permalink raw reply
* [PATCH v2 0/4] Message Access Profile plugin
From: Slawomir Bochenski @ 2011-03-11 7:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Slawomir Bochenski
V2 takes into account Johan's comments presented so far.
^ permalink raw reply
* [PATCH v2 2/4] Add actual service for Message Access Profile
From: Slawomir Bochenski @ 2011-03-11 7:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Slawomir Bochenski
In-Reply-To: <1299829612-3704-1-git-send-email-lkslawek@gmail.com>
This adds basic service functionality in MAP code, accompanied by proper
record for SDP.
RFCOMM channel of choice is 16 which is in accordance with
doc/assigned-numbers.txt.
---
plugins/mas.c | 189 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 189 insertions(+), 0 deletions(-)
diff --git a/plugins/mas.c b/plugins/mas.c
index 0eab43b..aefd291 100644
--- a/plugins/mas.c
+++ b/plugins/mas.c
@@ -25,18 +25,207 @@
#include <config.h>
#endif
+#include <errno.h>
+#include <glib.h>
+#include <openobex/obex.h>
+
#include "plugin.h"
#include "log.h"
+#include "obex.h"
+#include "service.h"
+#include "dbus.h"
#include "messages.h"
+/* Channel number according to bluez doc/assigned-numbers.txt */
+#define MAS_CHANNEL 16
+
+#define MAS_RECORD "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> \
+<record> \
+ <attribute id=\"0x0001\"> \
+ <sequence> \
+ <uuid value=\"0x1132\"/> \
+ </sequence> \
+ </attribute> \
+ \
+ <attribute id=\"0x0004\"> \
+ <sequence> \
+ <sequence> \
+ <uuid value=\"0x0100\"/> \
+ </sequence> \
+ <sequence> \
+ <uuid value=\"0x0003\"/> \
+ <uint8 value=\"%u\" name=\"channel\"/> \
+ </sequence> \
+ <sequence> \
+ <uuid value=\"0x0008\"/> \
+ </sequence> \
+ </sequence> \
+ </attribute> \
+ \
+ <attribute id=\"0x0009\"> \
+ <sequence> \
+ <sequence> \
+ <uuid value=\"0x1134\"/> \
+ <uint16 value=\"0x0100\" name=\"version\"/> \
+ </sequence> \
+ </sequence> \
+ </attribute> \
+ \
+ <attribute id=\"0x0100\"> \
+ <text value=\"%s\" name=\"name\"/> \
+ </attribute> \
+ \
+ <attribute id=\"0x0315\"> \
+ <uint8 value=\"0x00\"/> \
+ </attribute> \
+ \
+ <attribute id=\"0x0316\"> \
+ <uint8 value=\"0x0F\"/> \
+ </attribute> \
+</record>"
+
+struct mas_session {
+ struct mas_request *request;
+};
+
+static const uint8_t MAS_TARGET[TARGET_SIZE] = {
+ 0xbb, 0x58, 0x2b, 0x40, 0x42, 0x0c, 0x11, 0xdb,
+ 0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 };
+
+static void mas_clean(struct mas_session *mas)
+{
+ g_free(mas);
+}
+
+static void *mas_connect(struct obex_session *os, int *err)
+{
+ struct mas_session *mas;
+
+ DBG("");
+
+ *err = 0;
+
+ mas = g_new0(struct mas_session, 1);
+
+ manager_register_session(os);
+
+ return mas;
+}
+
+static void mas_disconnect(struct obex_session *os, void *user_data)
+{
+ struct mas_session *mas = user_data;
+
+ DBG("");
+
+ manager_unregister_session(os);
+
+ mas_clean(mas);
+}
+
+static int mas_get(struct obex_session *os, obex_object_t *obj,
+ gboolean *stream, void *user_data)
+{
+ struct mas_session *mas = user_data;
+ const char *type = obex_get_type(os);
+ const char *name = obex_get_name(os);
+ int ret;
+
+ DBG("GET: name %s type %s mas %p",
+ name, type, mas);
+
+ if (type == NULL)
+ return -EBADR;
+
+ *stream = FALSE;
+
+ ret = obex_get_stream_start(os, name);
+ if (ret < 0)
+ goto failed;
+
+ return 0;
+
+failed:
+ return ret;
+}
+
+static int mas_put(struct obex_session *os, obex_object_t *obj, void *user_data)
+{
+ struct mas_session *mas = user_data;
+ const char *type = obex_get_type(os);
+ const char *name = obex_get_name(os);
+ int ret;
+
+ DBG("PUT: name %s type %s mas %p", name, type, mas);
+
+ if (type == NULL)
+ return -EBADR;
+
+ ret = obex_put_stream_start(os, name);
+ if (ret < 0)
+ goto failed;
+
+ return 0;
+
+failed:
+ return ret;
+}
+
+static int mas_setpath(struct obex_session *os, obex_object_t *obj,
+ void *user_data)
+{
+ const char *name;
+ uint8_t *nonhdr;
+
+ if (OBEX_ObjectGetNonHdrData(obj, &nonhdr) != 2) {
+ error("Set path failed: flag and constants not found!");
+ return -EBADR;
+ }
+
+ name = obex_get_name(os);
+
+ DBG("SETPATH: name %s nonhdr 0x%x%x", name, nonhdr[0], nonhdr[1]);
+
+ if ((nonhdr[0] & 0x02) != 0x02) {
+ DBG("Error: requested directory creation");
+ return -EBADR;
+ }
+
+ return 0;
+}
+
+static struct obex_service_driver mas = {
+ .name = "Message Access server",
+ .service = OBEX_MAS,
+ .channel = MAS_CHANNEL,
+ .record = MAS_RECORD,
+ .target = MAS_TARGET,
+ .target_size = TARGET_SIZE,
+ .connect = mas_connect,
+ .get = mas_get,
+ .put = mas_put,
+ .setpath = mas_setpath,
+ .disconnect = mas_disconnect,
+};
+
static int mas_init(void)
{
+ int err;
+
+ err = obex_service_driver_register(&mas);
+ if (err < 0)
+ goto failed_mas_reg;
+
return 0;
+
+failed_mas_reg:
+ return err;
}
static void mas_exit(void)
{
+ obex_service_driver_unregister(&mas);
}
OBEX_PLUGIN_DEFINE(mas, mas_init, mas_exit)
--
1.7.1
^ permalink raw reply related
* [PATCH v2 3/4] Add MIME driver to MAP plugin
From: Slawomir Bochenski @ 2011-03-11 7:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Slawomir Bochenski
In-Reply-To: <1299829612-3704-1-git-send-email-lkslawek@gmail.com>
As procedures when communicating with message backend will be the same
regardless of the actual type in request, there is only one MIME driver,
thus .mimetype is left NULL.
---
plugins/mas.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/plugins/mas.c b/plugins/mas.c
index aefd291..a84b8fd 100644
--- a/plugins/mas.c
+++ b/plugins/mas.c
@@ -33,6 +33,7 @@
#include "log.h"
#include "obex.h"
#include "service.h"
+#include "mimetype.h"
#include "dbus.h"
#include "messages.h"
@@ -195,6 +196,43 @@ static int mas_setpath(struct obex_session *os, obex_object_t *obj,
return 0;
}
+static void *any_open(const char *name, int oflag, mode_t mode,
+ void *driver_data, size_t *size, int *err)
+{
+ struct mas_session *mas = driver_data;
+
+ DBG("");
+
+ *err = 0;
+
+ return mas;
+}
+
+static ssize_t any_write(void *object, const void *buf, size_t count)
+{
+ DBG("");
+
+ return count;
+}
+
+static ssize_t any_read(void *obj, void *buf, size_t count,
+ uint8_t *hi, unsigned int *flags)
+{
+ DBG("");
+
+ *hi = OBEX_HDR_BODY;
+ *flags = 0;
+
+ return 0;
+}
+
+static int any_close(void *obj)
+{
+ DBG("");
+
+ return 0;
+}
+
static struct obex_service_driver mas = {
.name = "Message Access server",
.service = OBEX_MAS,
@@ -209,10 +247,24 @@ static struct obex_service_driver mas = {
.disconnect = mas_disconnect,
};
+static struct obex_mime_type_driver mime_map = {
+ .target = MAS_TARGET,
+ .target_size = TARGET_SIZE,
+ .mimetype = NULL,
+ .open = any_open,
+ .close = any_close,
+ .read = any_read,
+ .write = any_write,
+};
+
static int mas_init(void)
{
int err;
+ err = obex_mime_type_driver_register(&mime_map);
+ if (err < 0)
+ goto failed_mime;
+
err = obex_service_driver_register(&mas);
if (err < 0)
goto failed_mas_reg;
@@ -220,12 +272,16 @@ static int mas_init(void)
return 0;
failed_mas_reg:
+ obex_mime_type_driver_unregister(&mime_map);
+
+failed_mime:
return err;
}
static void mas_exit(void)
{
obex_service_driver_unregister(&mas);
+ obex_mime_type_driver_unregister(&mime_map);
}
OBEX_PLUGIN_DEFINE(mas, mas_init, mas_exit)
--
1.7.1
^ permalink raw reply related
* [PATCH v2 4/4] Add detection of MAP function in OBEX requests
From: Slawomir Bochenski @ 2011-03-11 7:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Slawomir Bochenski
In-Reply-To: <1299829612-3704-1-git-send-email-lkslawek@gmail.com>
There is also first part of mas.c <-> backend API. The mas_request
structure will be used when calling backend functions.
---
plugins/mas.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
plugins/messages.h | 15 +++++++++++++
2 files changed, 72 insertions(+), 0 deletions(-)
diff --git a/plugins/mas.c b/plugins/mas.c
index a84b8fd..106544d 100644
--- a/plugins/mas.c
+++ b/plugins/mas.c
@@ -25,6 +25,7 @@
#include <config.h>
#endif
+#include <string.h>
#include <errno.h>
#include <glib.h>
#include <openobex/obex.h>
@@ -38,6 +39,14 @@
#include "messages.h"
+#define EVENT_TYPE "x-bt/MAP-event-report"
+#define MESSAGE_TYPE "x-bt/message"
+#define FOLDER_LISTING_TYPE "x-obex/folder-listing"
+#define MESSAGES_LISTING_TYPE "x-bt/MAP-msg-listing"
+#define NOTIFICATION_TYPE "x-bt/MAP-NotificationRegistration"
+#define STATUS_TYPE "x-bt/messageStatus"
+#define UPDATE_TYPE "x-bt/MAP-messageUpdate"
+
/* Channel number according to bluez doc/assigned-numbers.txt */
#define MAS_CHANNEL 16
@@ -99,6 +108,14 @@ static void mas_clean(struct mas_session *mas)
g_free(mas);
}
+static void reset_request(struct mas_session *mas)
+{
+ if (mas->request) {
+ g_free(mas->request);
+ mas->request = NULL;
+ }
+}
+
static void *mas_connect(struct obex_session *os, int *err)
{
struct mas_session *mas;
@@ -139,6 +156,21 @@ static int mas_get(struct obex_session *os, obex_object_t *obj,
if (type == NULL)
return -EBADR;
+ mas->request = g_new0(struct mas_request, 1);
+
+ /* NOTE: type is case-insensitive! */
+ if (g_ascii_strcasecmp(type, FOLDER_LISTING_TYPE) == 0)
+ mas->request->fid = MFID_GET_FOLDER_LISTING;
+ else if (g_ascii_strcasecmp(type, MESSAGES_LISTING_TYPE) == 0)
+ mas->request->fid = MFID_GET_MESSAGES_LISTING;
+ else if (g_ascii_strcasecmp(type, MESSAGE_TYPE) == 0)
+ mas->request->fid = MFID_GET_MESSAGE;
+ else {
+ DBG("Incorrect type: %s", type);
+ ret = -EBADR;
+ goto failed;
+ }
+
*stream = FALSE;
ret = obex_get_stream_start(os, name);
@@ -148,6 +180,8 @@ static int mas_get(struct obex_session *os, obex_object_t *obj,
return 0;
failed:
+ reset_request(mas);
+
return ret;
}
@@ -163,6 +197,23 @@ static int mas_put(struct obex_session *os, obex_object_t *obj, void *user_data)
if (type == NULL)
return -EBADR;
+ mas->request = g_new0(struct mas_request, 1);
+
+ /* NOTE: type is case-insensitive! */
+ if (g_ascii_strcasecmp(type, NOTIFICATION_TYPE) == 0)
+ mas->request->fid = MFID_SET_NOTIFICATION_REGISTRATION;
+ else if (g_ascii_strcasecmp(type, STATUS_TYPE) == 0)
+ mas->request->fid = MFID_SET_MESSAGE_STATUS;
+ else if (g_ascii_strcasecmp(type, MESSAGE_TYPE) == 0)
+ mas->request->fid = MFID_PUSH_MESSAGE;
+ else if (g_ascii_strcasecmp(type, UPDATE_TYPE) == 0)
+ mas->request->fid = MFID_UPDATE_INBOX;
+ else {
+ DBG("Incorrect type: %s", type);
+ ret = -EBADR;
+ goto failed;
+ }
+
ret = obex_put_stream_start(os, name);
if (ret < 0)
goto failed;
@@ -170,6 +221,8 @@ static int mas_put(struct obex_session *os, obex_object_t *obj, void *user_data)
return 0;
failed:
+ reset_request(mas);
+
return ret;
}
@@ -228,8 +281,12 @@ static ssize_t any_read(void *obj, void *buf, size_t count,
static int any_close(void *obj)
{
+ struct mas_session *mas = obj;
+
DBG("");
+ reset_request(mas);
+
return 0;
}
diff --git a/plugins/messages.h b/plugins/messages.h
index c510244..91e7b3b 100644
--- a/plugins/messages.h
+++ b/plugins/messages.h
@@ -20,3 +20,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
+
+enum messages_function_id {
+ MFID_INVALID = 0,
+ MFID_SET_NOTIFICATION_REGISTRATION,
+ MFID_GET_FOLDER_LISTING,
+ MFID_GET_MESSAGES_LISTING,
+ MFID_GET_MESSAGE,
+ MFID_SET_MESSAGE_STATUS,
+ MFID_PUSH_MESSAGE,
+ MFID_UPDATE_INBOX,
+};
+
+struct mas_request {
+ enum messages_function_id fid;
+};
--
1.7.1
^ permalink raw reply related
* [PATCH] Change order of freeing contacts data in send_pull_part
From: Radoslaw Jablonski @ 2011-03-11 10:24 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Radoslaw Jablonski
Moved freeing data->contacts before asynchronous data sending
is triggered via data->cb callback.
This data is no longer needed anyway after vcards are generated
and freeing it later may cause race condition (because freeing
this data need to be handled also in phonebook_req_finalize to
avoid memory leaks when client disconnects in the middle of
retrieving contacts from db).
---
plugins/phonebook-tracker.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index 2fced7a..f241cb4 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -1576,13 +1576,16 @@ static void send_pull_part(struct phonebook_data *data,
const struct apparam_field *params, gboolean lastpart)
{
GString *vcards;
+ int amount;
DBG("");
vcards = gen_vcards(data->contacts, params);
- data->cb(vcards->str, vcards->len, g_slist_length(data->contacts),
- data->newmissedcalls, lastpart, data->user_data);
-
+ amount = g_slist_length(data->contacts);
free_data_contacts(data);
+
+ data->cb(vcards->str, vcards->len, amount, data->newmissedcalls,
+ lastpart, data->user_data);
+
g_string_free(vcards, TRUE);
}
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH] Add indication/notification support to interactive gatttool
From: Johan Hedberg @ 2011-03-11 10:56 UTC (permalink / raw)
To: Sheldon Demario; +Cc: linux-bluetooth
In-Reply-To: <1299785206-15145-1-git-send-email-sheldon.demario@openbossa.org>
Hi Sheldon,
On Thu, Mar 10, 2011, Sheldon Demario wrote:
> ---
> attrib/interactive.c | 39 +++++++++++++++++++++++++++++++++++++++
> 1 files changed, 39 insertions(+), 0 deletions(-)
Pushed upstream. Thanks.
Johan
^ permalink raw reply
* Re: [PATCH v2 4/4] Add detection of MAP function in OBEX requests
From: Johan Hedberg @ 2011-03-11 11:13 UTC (permalink / raw)
To: Slawomir Bochenski; +Cc: linux-bluetooth
In-Reply-To: <1299829612-3704-4-git-send-email-lkslawek@gmail.com>
Hi Slawek,
On Fri, Mar 11, 2011, Slawomir Bochenski wrote:
> There is also first part of mas.c <-> backend API. The mas_request
> structure will be used when calling backend functions.
> ---
> plugins/mas.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> plugins/messages.h | 15 +++++++++++++
> 2 files changed, 72 insertions(+), 0 deletions(-)
I've pushed 2/4 and 3/4 upstream, but there's at least issue one with
this last patch:
> +enum messages_function_id {
> + MFID_INVALID = 0,
> + MFID_SET_NOTIFICATION_REGISTRATION,
> + MFID_GET_FOLDER_LISTING,
> + MFID_GET_MESSAGES_LISTING,
> + MFID_GET_MESSAGE,
> + MFID_SET_MESSAGE_STATUS,
> + MFID_PUSH_MESSAGE,
> + MFID_UPDATE_INBOX,
> +};
Since "function" here doesn't seem to be referring to a C function but
to the type of request, could you call it e.g. request_type instead? Is
there a reason you you want to have this enum instead of e.g. storing
the original value of the type header?
Johan
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox