* Re: [PATCH] Add João Paulo to the AUTHORS file
From: Johan Hedberg @ 2012-11-10 12:30 UTC (permalink / raw)
To: Gustavo Padovan; +Cc: linux-bluetooth, Gustavo Padovan
In-Reply-To: <1352473571-7939-1-git-send-email-gustavo@padovan.org>
Hi Gustavo,
On Fri, Nov 09, 2012, Gustavo Padovan wrote:
> ---
> AUTHORS | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/AUTHORS b/AUTHORS
> index 4b2d123..944ada2 100644
> --- a/AUTHORS
> +++ b/AUTHORS
> @@ -65,3 +65,4 @@ Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
> Eder Ruiz Maria <eder.ruiz@openbossa.org>
> Mikel Astiz <mikel.astiz@bmw-carit.de>
> Chan-yeol Park <chanyeol.park@samsung.com>
> +João Paulo Rechi Vita <jprvita@gmail.com>
Applied. Thanks.
Johan
^ permalink raw reply
* Re: Feedback on potential fix for issue while advertising Feature List
From: Johan Hedberg @ 2012-11-10 12:25 UTC (permalink / raw)
To: Bart Westgeest; +Cc: linux-bluetooth
In-Reply-To: <509D879C.1080205@elbrys.com>
Hi Bart,
On Fri, Nov 09, 2012, Bart Westgeest wrote:
> > I appreciate any input from anybody more familiar with the SDP
> > code on what the accepted/preferred approach is to get this
> > issue fixed.
>
> Anybody? Again, I've already root caused the problem and have a fix.
>
> I am Just looking for input to see if what I have is acceptable, or
> if something else is preferred.
Have a bit more patience, sometimes it can take a few days to get
feedback. I think the option of looking at the length and using the old
type for < 256 and a 16-bit type for greater lengths would be the
safest. This way old code will still produce the same result for < 256
lengths.
Johan
^ permalink raw reply
* [PATCHv2] Bluetooth: Add support for BCM20702A0 [0b05, 17b5]
From: Jeff Cook @ 2012-11-09 23:39 UTC (permalink / raw)
To: linux-bluetooth, marcel, gustavo, johan.hedberg; +Cc: linux-kernel, Jeff Cook
In-Reply-To: <5087B517.9090703@deserettechnology.com>
Vendor-specific ID for BCM20702A0.
Support for bluetooth over Asus Wi-Fi GO!, included with Asus P8Z77-V
Deluxe.
T: Bus=07 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0b05 ProdID=17b5 Rev=01.12
S: Manufacturer=Broadcom Corp
S: Product=BCM20702A0
S: SerialNumber=94DBC98AC113
C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
Signed-off-by: Jeff Cook <jeff@deserettechnology.com>
---
drivers/bluetooth/btusb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index ee82f2f..a1d4ede 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -96,6 +96,7 @@ static struct usb_device_id btusb_table[] = {
{ USB_DEVICE(0x0c10, 0x0000) },
/* Broadcom BCM20702A0 */
+ { USB_DEVICE(0x0b05, 0x17b5) },
{ USB_DEVICE(0x04ca, 0x2003) },
{ USB_DEVICE(0x0489, 0xe042) },
{ USB_DEVICE(0x413c, 0x8197) },
--
Hi Gustavo,
Here is the rebased patch. Sorry for the delay getting this out.
^ permalink raw reply related
* Re: Feedback on potential fix for issue while advertising Feature List
From: Bart Westgeest @ 2012-11-09 22:45 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <509BD103.2040808@elbrys.com>
> I appreciate any input from anybody more familiar with the SDP
> code on what the accepted/preferred approach is to get this
> issue fixed.
Anybody? Again, I've already root caused the problem and have a fix.
I am Just looking for input to see if what I have is acceptable, or if
something else is preferred.
^ permalink raw reply
* [PATCH] attrib: Convert properties to DBus.Properties
From: Andrzej Kaczmarek @ 2012-11-09 16:48 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Andrzej Kaczmarek
---
attrib/client.c | 258 ++++++++++++++++++++++++++++----------------------------
1 file changed, 131 insertions(+), 127 deletions(-)
diff --git a/attrib/client.c b/attrib/client.c
index c7bceed..5cec0fe 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -287,38 +287,6 @@ static int watcher_cmp(gconstpointer a, gconstpointer b)
return g_strcmp0(watcher->path, match->path);
}
-static void append_char_dict(DBusMessageIter *iter, struct characteristic *chr)
-{
- DBusMessageIter dict;
- const char *name;
- char *uuid;
-
- dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
- DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
- DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
-
- uuid = g_strdup(chr->type);
- dict_append_entry(&dict, "UUID", DBUS_TYPE_STRING, &uuid);
- g_free(uuid);
-
- name = get_char_name(chr->type);
- if (name)
- dict_append_entry(&dict, "Name", DBUS_TYPE_STRING, &name);
-
- if (chr->desc)
- dict_append_entry(&dict, "Description", DBUS_TYPE_STRING,
- &chr->desc);
-
- if (chr->value)
- dict_append_array(&dict, "Value", DBUS_TYPE_BYTE, &chr->value,
- chr->vlen);
-
- /* FIXME: Missing Format, Value and Representation */
-
- dbus_message_iter_close_container(iter, &dict);
-}
-
static void watcher_exit(DBusConnection *conn, void *user_data)
{
struct watcher *watcher = user_data;
@@ -538,92 +506,135 @@ static DBusMessage *unregister_watcher(DBusConnection *conn,
return dbus_message_new_method_return(msg);
}
-static DBusMessage *set_value(DBusMessage *msg,
- DBusMessageIter *iter, struct characteristic *chr)
+static gboolean property_get_char_uuid(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
{
- struct gatt_service *gatt = chr->gatt;
- DBusMessageIter sub;
- uint8_t *value;
- int len;
+ struct characteristic *ch = data;
+ const char *uuid = ch->type;
- if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY ||
- dbus_message_iter_get_element_type(iter) != DBUS_TYPE_BYTE)
- return btd_error_invalid_args(msg);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid);
- dbus_message_iter_recurse(iter, &sub);
+ return TRUE;
+}
- dbus_message_iter_get_fixed_array(&sub, &value, &len);
+static gboolean property_get_char_name(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct characteristic *ch = data;
+ const char *name;
- characteristic_set_value(chr, value, len);
+ name = get_char_name(ch->type);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &name);
- if (gatt->attioid == 0)
- gatt->attioid = btd_device_add_attio_callback(gatt->dev,
- attio_connected,
- attio_disconnected,
- gatt);
+ return TRUE;
+}
- if (gatt->attrib)
- gatt_write_cmd(gatt->attrib, chr->handle, value, len,
- NULL, NULL);
- else
- gatt->offline_chars = g_slist_append(gatt->offline_chars, chr);
+static gboolean property_exists_char_name(
+ const GDBusPropertyTable *property, void *data)
+{
+ struct characteristic *ch = data;
- return dbus_message_new_method_return(msg);
+ if (get_char_name(ch->type) == NULL)
+ return FALSE;
+
+ return TRUE;
}
-static DBusMessage *get_properties(DBusConnection *conn, DBusMessage *msg,
- void *data)
+static gboolean property_get_char_description(
+ const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
{
- struct characteristic *chr = data;
- DBusMessage *reply;
- DBusMessageIter iter;
+ struct characteristic *ch = data;
+ const char *desc = ch->desc;
- reply = dbus_message_new_method_return(msg);
- if (!reply)
- return NULL;
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &desc);
- dbus_message_iter_init_append(reply, &iter);
+ return TRUE;
+}
- append_char_dict(&iter, chr);
+static gboolean property_exists_char_description(
+ const GDBusPropertyTable *property, void *data)
+{
+ struct characteristic *ch = data;
- return reply;
+ if (ch->desc == NULL)
+ return FALSE;
+
+ return TRUE;
}
-static DBusMessage *set_property(DBusConnection *conn,
- DBusMessage *msg, void *data)
+static gboolean property_get_char_value(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
{
- struct characteristic *chr = data;
- DBusMessageIter iter;
- DBusMessageIter sub;
- const char *property;
+ struct characteristic *ch = data;
+ DBusMessageIter entry;
- if (!dbus_message_iter_init(msg, &iter))
- return btd_error_invalid_args(msg);
+ dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_BYTE_AS_STRING, &entry);
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
- return btd_error_invalid_args(msg);
+ dbus_message_iter_append_fixed_array(&entry, DBUS_TYPE_BYTE,
+ &ch->value, ch->vlen);
- dbus_message_iter_get_basic(&iter, &property);
- dbus_message_iter_next(&iter);
+ dbus_message_iter_close_container(iter, &entry);
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT)
- return btd_error_invalid_args(msg);
+ return TRUE;
+}
+
+static void property_set_char_value(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, GDBusPendingPropertySet id, void *data)
+{
+ struct characteristic *ch = data;
+ struct gatt_service *gatt = ch->gatt;
+ DBusMessageIter entry;
+ uint8_t *value;
+ int len;
+
+ if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY ||
+ dbus_message_iter_get_element_type(iter) != DBUS_TYPE_BYTE)
+ return g_dbus_pending_property_error(id,
+ ERROR_INTERFACE ".InvalidArguments",
+ "Invalid arguments in method call");
+
+ dbus_message_iter_recurse(iter, &entry);
+
+ dbus_message_iter_get_fixed_array(&entry, &value, &len);
- dbus_message_iter_recurse(&iter, &sub);
+ characteristic_set_value(ch, value, len);
+
+ if (gatt->attioid == 0)
+ gatt->attioid = btd_device_add_attio_callback(gatt->dev,
+ attio_connected,
+ attio_disconnected,
+ gatt);
+
+ if (gatt->attrib)
+ gatt_write_cmd(gatt->attrib, ch->handle, value, len,
+ NULL, NULL);
+ else
+ gatt->offline_chars = g_slist_append(gatt->offline_chars, ch);
+
+ g_dbus_pending_property_success(id);
+}
+
+static gboolean property_exists_char_value(
+ const GDBusPropertyTable *property, void *data)
+{
+ struct characteristic *ch = data;
- if (g_str_equal("Value", property))
- return set_value(msg, &sub, chr);
+ if (ch->value == NULL)
+ return FALSE;
- return btd_error_invalid_args(msg);
+ return TRUE;
}
-static const GDBusMethodTable char_methods[] = {
- { GDBUS_METHOD("GetProperties",
- NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
- get_properties) },
- { GDBUS_ASYNC_METHOD("SetProperty",
- GDBUS_ARGS({ "name", "s" }, { "value", "v" }), NULL,
- set_property) },
+static const GDBusPropertyTable char_properties[] = {
+ { "UUID", "s", property_get_char_uuid },
+ { "Name", "s", property_get_char_name, NULL,
+ property_exists_char_name },
+ { "Description", "s", property_get_char_description, NULL,
+ property_exists_char_description },
+ { "Value", "ay", property_get_char_value, property_set_char_value,
+ property_exists_char_value },
{ }
};
@@ -673,7 +684,7 @@ static void register_characteristic(gpointer data, gpointer user_data)
g_dbus_register_interface(btd_get_dbus_connection(),
chr->path, CHAR_INTERFACE,
- char_methods, NULL, NULL, chr, NULL);
+ NULL, NULL, char_properties, chr, NULL);
DBG("Registered: %s", chr->path);
}
@@ -1091,48 +1102,45 @@ static DBusMessage *discover_char(DBusConnection *conn, DBusMessage *msg,
return NULL;
}
-static DBusMessage *prim_get_properties(DBusConnection *conn, DBusMessage *msg,
- void *data)
+static gboolean property_get_prim_characteristics(
+ const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
{
struct gatt_service *gatt = data;
- DBusMessage *reply;
- DBusMessageIter iter;
- DBusMessageIter dict;
+ DBusMessageIter entry;
GSList *l;
- char **chars;
- const char *uuid;
- int i;
-
- reply = dbus_message_new_method_return(msg);
- if (!reply)
- return NULL;
-
- dbus_message_iter_init_append(reply, &iter);
-
- dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
- DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
- DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
- chars = g_new0(char *, g_slist_length(gatt->chars) + 1);
+ dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_OBJECT_PATH_AS_STRING, &entry);
- for (i = 0, l = gatt->chars; l; l = l->next, i++) {
- struct characteristic *chr = l->data;
- chars[i] = chr->path;
+ for (l = gatt->chars; l != NULL; l = l->next) {
+ struct characteristic *ch = l->data;
+ dbus_message_iter_append_basic(&entry, DBUS_TYPE_OBJECT_PATH,
+ &ch->path);
}
- dict_append_array(&dict, "Characteristics", DBUS_TYPE_OBJECT_PATH,
- &chars, i);
- uuid = gatt->prim->uuid;
- dict_append_entry(&dict, "UUID", DBUS_TYPE_STRING, &uuid);
+ dbus_message_iter_close_container(iter, &entry);
- g_free(chars);
+ return TRUE;
+}
- dbus_message_iter_close_container(&iter, &dict);
+static gboolean property_get_prim_uuid(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct gatt_service *gatt = data;
+ const char *uuid = gatt->prim->uuid;
- return reply;
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid);
+
+ return TRUE;
}
+static const GDBusPropertyTable prim_properties[] = {
+ { "Characteristics", "ao", property_get_prim_characteristics },
+ { "UUID", "s", property_get_prim_uuid },
+ { }
+};
+
static const GDBusMethodTable prim_methods[] = {
{ GDBUS_ASYNC_METHOD("DiscoverCharacteristics",
NULL, GDBUS_ARGS({ "characteristics", "ao" }),
@@ -1143,10 +1151,6 @@ static const GDBusMethodTable prim_methods[] = {
{ GDBUS_METHOD("UnregisterCharacteristicsWatcher",
GDBUS_ARGS({ "agent", "o" }), NULL,
unregister_watcher) },
- { GDBUS_METHOD("GetProperties",
- NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
- prim_get_properties) },
- { }
};
static struct gatt_service *primary_register(struct btd_device *device,
@@ -1167,7 +1171,7 @@ static struct gatt_service *primary_register(struct btd_device *device,
g_dbus_register_interface(btd_get_dbus_connection(), gatt->path,
CHAR_INTERFACE, prim_methods,
- NULL, NULL, gatt, NULL);
+ NULL, prim_properties, gatt, NULL);
gatt->chars = load_characteristics(gatt, prim->range.start);
g_slist_foreach(gatt->chars, register_characteristic, gatt->path);
--
1.8.0
^ permalink raw reply related
* Re: [PATCH obexd v1 2/3] MAP: Add MSETime application parameter
From: Sunil Kumar Behera @ 2012-11-09 16:06 UTC (permalink / raw)
To: Luiz Augusto von Dentz, Sunil Kumar Behera; +Cc: linux-bluetooth
In-Reply-To: <CABBYNZ+DJrDNDYYKy9tF0mud=zyVrrXB754j_VTPcHqq=aL8Aw@mail.gmail.com>
Hi Luiz,
--------------------------------------------------
From: "Luiz Augusto von Dentz" <luiz.dentz@gmail.com>
Sent: Friday, November 09, 2012 9:10 PM
To: "Sunil Kumar Behera" <sunil.behera@samsung.com>
Cc: <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH obexd v1 2/3] MAP: Add MSETime application parameter
> Hi Sunil,
>
> On Fri, Nov 9, 2012 at 1:29 PM, Sunil Kumar Behera
> <sunil.behera@samsung.com> wrote:
>> Hi Luiz,
>>
>> --------------------------------------------------
>> From: "Luiz Augusto von Dentz" <luiz.dentz@gmail.com>
>> Sent: Friday, November 09, 2012 3:33 PM
>> To: "Sunil Kumar Behera" <sunil.behera@samsung.com>
>> Cc: <linux-bluetooth@vger.kernel.org>
>> Subject: Re: [PATCH obexd v1 2/3] MAP: Add MSETime application parameter
>>
>>
>>> Hi Sunil,
>>>
>>> On Thu, Nov 8, 2012 at 1:04 PM, Sunil Kumar Behera
>>> <sunil.behera@samsung.com> wrote:
>>>>
>>>> MSETime application parameter shall be used in the response
>>>> to report the Local Time basis of the MSE.
>>>> ---
>>>> plugins/mas.c | 4 +++-
>>>> plugins/messages.h | 1 +
>>>> 2 files changed, 4 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/plugins/mas.c b/plugins/mas.c
>>>> index 319c87f..bdf2b6b 100644
>>>> --- a/plugins/mas.c
>>>> +++ b/plugins/mas.c
>>>> @@ -284,7 +284,7 @@ static const char *yesorno(gboolean a)
>>>> }
>>>>
>>>> static void get_messages_listing_cb(void *session, int err, uint16_t
>>>> size,
>>>> - gboolean newmsg,
>>>> + gboolean newmsg, gchar
>>>> *msetime,
>>>> const struct messages_message
>>>> *entry,
>>>> void *user_data)
>>>> {
>>>> @@ -403,6 +403,8 @@ proceed:
>>>> mas->outparams =
>>>> g_obex_apparam_set_uint8(mas->outparams,
>>>> MAP_AP_NEWMESSAGE,
>>>> newmsg ? 1 : 0);
>>>> + mas->outparams =
>>>> g_obex_apparam_set_string(mas->outparams,
>>>> + MAP_AP_MSETIME,
>>>> msetime);
>>>> }
>>>>
>>>> if (err != -EAGAIN)
>>>> diff --git a/plugins/messages.h b/plugins/messages.h
>>>> index 00a16b1..2ab4ba1 100644
>>>> --- a/plugins/messages.h
>>>> +++ b/plugins/messages.h
>>>> @@ -226,6 +226,7 @@ int messages_get_folder_listing(void *session,
>>>> const
>>>> char *name, uint16_t max,
>>>> */
>>>> typedef void (*messages_get_messages_listing_cb)(void *session, int
>>>> err,
>>>> uint16_t size, gboolean newmsg,
>>>> + gchar *msetime,
>>>> const struct messages_message
>>>> *message,
>>>> void *user_data);
>>>
>>>
>>> Do we really need to do this in the backend? We could possible
>>> generate the timestamp on get_messages_listing_cb and which should
>>> avoid having duplicate code doing the same for each backend.
>>>
>>
>> The data for application parameter MSETime is string with current time
>> basis
>> and UTC-offset of the MSE. Since the UTC value depends on the location of
>> the device
>> so I think it is better left to backend on deciding the UTC value.
>
> We should be able to retrieve this information with tzname or timezone
> defined on time.h, so with that and gettimeofday of clock_gettime
> should be enough to generate the MSETime without having to depend on
> the backend which potentially will do the same thing, besides the
> backend could still fail to format the string properly so at least it
> should have been an integer but I still prefer to do everything in the
> plugin side.
>
ok I shall consider your suggestion and update the patch set accordingly.
I think the below mentioned patch is independent of other changes
so it can be applied
[PATCH obexd 1/3] Add get next header function in message listing.
Thanks for your suggestion.
Best Regards,
Sunil
^ permalink raw reply
* [PATCH] gatt: Update characteristic names translation table
From: Andrzej Kaczmarek @ 2012-11-09 15:41 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Andrzej Kaczmarek
---
attrib/client.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/attrib/client.c b/attrib/client.c
index 55f2b3f..9d9bb30 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -109,26 +109,45 @@ static const struct {
const char *uuid;
const char *name;
} char_names[] = {
+ { "00002a5a-0000-1000-8000-00805f9b34fb", "Aggregate Input" },
{ "00002a43-0000-1000-8000-00805f9b34fb", "Alert Category ID" },
{ "00002a42-0000-1000-8000-00805f9b34fb", "Alert Category ID Bit Mask" },
{ "00002a06-0000-1000-8000-00805f9b34fb", "Alert Level" },
{ "00002a44-0000-1000-8000-00805f9b34fb", "Alert Notification Control Point" },
{ "00002a3f-0000-1000-8000-00805f9b34fb", "Alert Status" },
+ { "00002a58-0000-1000-8000-00805f9b34fb", "Analog Input" },
+ { "00002a59-0000-1000-8000-00805f9b34fb", "Analog Output" },
{ "00002a01-0000-1000-8000-00805f9b34fb", "Appearance" },
+ { "00002a19-0000-1000-8000-00805f9b34fb", "Battery Level" },
+ { "00002a1b-0000-1000-8000-00805f9b34fb", "Battery Level State" },
+ { "00002a1a-0000-1000-8000-00805f9b34fb", "Battery Power State" },
{ "00002a49-0000-1000-8000-00805f9b34fb", "Blood Pressure Feature" },
{ "00002a35-0000-1000-8000-00805f9b34fb", "Blood Pressure Measurement" },
{ "00002a38-0000-1000-8000-00805f9b34fb", "Body Sensor Location" },
+ { "00002a22-0000-1000-8000-00805f9b34fb", "Boot Keyboard Input Report" },
+ { "00002a32-0000-1000-8000-00805f9b34fb", "Boot Keyboard Output Report" },
+ { "00002a33-0000-1000-8000-00805f9b34fb", "Boot Mouse Input Report" },
+ { "00002a5c-0000-1000-8000-00805f9b34fb", "CSC Feature" },
+ { "00002a5b-0000-1000-8000-00805f9b34fb", "CSC Measurement" },
{ "00002a2b-0000-1000-8000-00805f9b34fb", "Current Time" },
{ "00002a08-0000-1000-8000-00805f9b34fb", "Date Time" },
{ "00002a0a-0000-1000-8000-00805f9b34fb", "Day Date Time" },
{ "00002a09-0000-1000-8000-00805f9b34fb", "Day of Week" },
{ "00002a00-0000-1000-8000-00805f9b34fb", "Device Name" },
+ { "00002a56-0000-1000-8000-00805f9b34fb", "Digital Input" },
+ { "00002a57-0000-1000-8000-00805f9b34fb", "Digital Output" },
{ "00002a0d-0000-1000-8000-00805f9b34fb", "DST Offset" },
+ { "00002a0b-0000-1000-8000-00805f9b34fb", "Exact Time 100" },
{ "00002a0c-0000-1000-8000-00805f9b34fb", "Exact Time 256" },
{ "00002a26-0000-1000-8000-00805f9b34fb", "Firmware Revision String" },
+ { "00002a51-0000-1000-8000-00805f9b34fb", "Glucose Feature" },
+ { "00002a18-0000-1000-8000-00805f9b34fb", "Glucose Measurement" },
+ { "00002a34-0000-1000-8000-00805f9b34fb", "Glucose Measurement Context" },
{ "00002a27-0000-1000-8000-00805f9b34fb", "Hardware Revision String" },
{ "00002a39-0000-1000-8000-00805f9b34fb", "Heart Rate Control Point" },
{ "00002a37-0000-1000-8000-00805f9b34fb", "Heart Rate Measurement" },
+ { "00002a4c-0000-1000-8000-00805f9b34fb", "HID Control Point" },
+ { "00002a4a-0000-1000-8000-00805f9b34fb", "HID Information" },
{ "00002a2a-0000-1000-8000-00805f9b34fb", "IEEE 11073-20601 Regulatory" },
{ "00002a36-0000-1000-8000-00805f9b34fb", "Intermediate Cuff Pressure" },
{ "00002a1e-0000-1000-8000-00805f9b34fb", "Intermediate Temperature" },
@@ -136,22 +155,47 @@ static const struct {
{ "00002a29-0000-1000-8000-00805f9b34fb", "Manufacturer Name String" },
{ "00002a21-0000-1000-8000-00805f9b34fb", "Measurement Interval" },
{ "00002a24-0000-1000-8000-00805f9b34fb", "Model Number String" },
+ { "00002a3e-0000-1000-8000-00805f9b34fb", "Network Availability" },
{ "00002a46-0000-1000-8000-00805f9b34fb", "New Alert" },
{ "00002a04-0000-1000-8000-00805f9b34fb", "Peripheral Preferred Connection Parameters" },
{ "00002a02-0000-1000-8000-00805f9b34fb", "Peripheral Privacy Flag" },
+ { "00002a50-0000-1000-8000-00805f9b34fb", "PnP ID" },
+ { "00002a4e-0000-1000-8000-00805f9b34fb", "Protocol Mode" },
+ { "00002a5f-0000-1000-8000-00805f9b34fb", "Pulse Oximetry Continuous Measurement" },
+ { "00002a62-0000-1000-8000-00805f9b34fb", "Pulse Oximetry Control Point" },
+ { "00002a61-0000-1000-8000-00805f9b34fb", "Pulse Oximetry Features" },
+ { "00002a60-0000-1000-8000-00805f9b34fb", "Pulse Oximetry Pulsatile Event" },
+ { "00002a5e-0000-1000-8000-00805f9b34fb", "Pulse Oximetry Spot-Check Measurement" },
{ "00002a03-0000-1000-8000-00805f9b34fb", "Reconnection Address" },
+ { "00002a52-0000-1000-8000-00805f9b34fb", "Record Access Control Point" },
{ "00002a14-0000-1000-8000-00805f9b34fb", "Reference Time Information" },
+ { "00002a3a-0000-1000-8000-00805f9b34fb", "Removable" },
+ { "00002a4d-0000-1000-8000-00805f9b34fb", "Report" },
+ { "00002a4b-0000-1000-8000-00805f9b34fb", "Report Map" },
{ "00002a40-0000-1000-8000-00805f9b34fb", "Ringer Control Point" },
{ "00002a41-0000-1000-8000-00805f9b34fb", "Ringer Setting" },
+ { "00002a54-0000-1000-8000-00805f9b34fb", "RSC Feature" },
+ { "00002a53-0000-1000-8000-00805f9b34fb", "RSC Measurement" },
+ { "00002a55-0000-1000-8000-00805f9b34fb", "SC Control Point" },
+ { "00002a4f-0000-1000-8000-00805f9b34fb", "Scan Interval Window" },
+ { "00002a31-0000-1000-8000-00805f9b34fb", "Scan Refresh" },
+ { "00002a3c-0000-1000-8000-00805f9b34fb", "Scientific Temperature in Celsius" },
+ { "00002a10-0000-1000-8000-00805f9b34fb", "Secondary Time Zone" },
+ { "00002a5d-0000-1000-8000-00805f9b34fb", "Sensor Location" },
{ "00002a25-0000-1000-8000-00805f9b34fb", "Serial Number String" },
{ "00002a05-0000-1000-8000-00805f9b34fb", "Service Changed" },
+ { "00002a3b-0000-1000-8000-00805f9b34fb", "Service Required" },
{ "00002a28-0000-1000-8000-00805f9b34fb", "Software Revision String" },
+ { "00002a3d-0000-1000-8000-00805f9b34fb", "String" },
{ "00002a47-0000-1000-8000-00805f9b34fb", "Supported New Alert Category" },
{ "00002a48-0000-1000-8000-00805f9b34fb", "Supported Unread Alert Category" },
{ "00002a23-0000-1000-8000-00805f9b34fb", "System ID" },
+ { "00002a1f-0000-1000-8000-00805f9b34fb", "Temperature in Celsius" },
+ { "00002a20-0000-1000-8000-00805f9b34fb", "Temperature in Fahrenheit" },
{ "00002a1c-0000-1000-8000-00805f9b34fb", "Temperature Measurement" },
{ "00002a1d-0000-1000-8000-00805f9b34fb", "Temperature Type" },
{ "00002a12-0000-1000-8000-00805f9b34fb", "Time Accuracy" },
+ { "00002a15-0000-1000-8000-00805f9b34fb", "Time Broadcast" },
{ "00002a13-0000-1000-8000-00805f9b34fb", "Time Source" },
{ "00002a16-0000-1000-8000-00805f9b34fb", "Time Update Control Point" },
{ "00002a17-0000-1000-8000-00805f9b34fb", "Time Update State" },
--
1.8.0
^ permalink raw reply related
* Re: [PATCH obexd v1 2/3] MAP: Add MSETime application parameter
From: Luiz Augusto von Dentz @ 2012-11-09 15:40 UTC (permalink / raw)
To: Sunil Kumar Behera; +Cc: linux-bluetooth
In-Reply-To: <1F1B79404D1345F5B0892E4441A11BA5@sisodomain.com>
Hi Sunil,
On Fri, Nov 9, 2012 at 1:29 PM, Sunil Kumar Behera
<sunil.behera@samsung.com> wrote:
> Hi Luiz,
>
> --------------------------------------------------
> From: "Luiz Augusto von Dentz" <luiz.dentz@gmail.com>
> Sent: Friday, November 09, 2012 3:33 PM
> To: "Sunil Kumar Behera" <sunil.behera@samsung.com>
> Cc: <linux-bluetooth@vger.kernel.org>
> Subject: Re: [PATCH obexd v1 2/3] MAP: Add MSETime application parameter
>
>
>> Hi Sunil,
>>
>> On Thu, Nov 8, 2012 at 1:04 PM, Sunil Kumar Behera
>> <sunil.behera@samsung.com> wrote:
>>>
>>> MSETime application parameter shall be used in the response
>>> to report the Local Time basis of the MSE.
>>> ---
>>> plugins/mas.c | 4 +++-
>>> plugins/messages.h | 1 +
>>> 2 files changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/plugins/mas.c b/plugins/mas.c
>>> index 319c87f..bdf2b6b 100644
>>> --- a/plugins/mas.c
>>> +++ b/plugins/mas.c
>>> @@ -284,7 +284,7 @@ static const char *yesorno(gboolean a)
>>> }
>>>
>>> static void get_messages_listing_cb(void *session, int err, uint16_t
>>> size,
>>> - gboolean newmsg,
>>> + gboolean newmsg, gchar *msetime,
>>> const struct messages_message
>>> *entry,
>>> void *user_data)
>>> {
>>> @@ -403,6 +403,8 @@ proceed:
>>> mas->outparams = g_obex_apparam_set_uint8(mas->outparams,
>>> MAP_AP_NEWMESSAGE,
>>> newmsg ? 1 : 0);
>>> + mas->outparams =
>>> g_obex_apparam_set_string(mas->outparams,
>>> + MAP_AP_MSETIME, msetime);
>>> }
>>>
>>> if (err != -EAGAIN)
>>> diff --git a/plugins/messages.h b/plugins/messages.h
>>> index 00a16b1..2ab4ba1 100644
>>> --- a/plugins/messages.h
>>> +++ b/plugins/messages.h
>>> @@ -226,6 +226,7 @@ int messages_get_folder_listing(void *session, const
>>> char *name, uint16_t max,
>>> */
>>> typedef void (*messages_get_messages_listing_cb)(void *session, int err,
>>> uint16_t size, gboolean newmsg,
>>> + gchar *msetime,
>>> const struct messages_message
>>> *message,
>>> void *user_data);
>>
>>
>> Do we really need to do this in the backend? We could possible
>> generate the timestamp on get_messages_listing_cb and which should
>> avoid having duplicate code doing the same for each backend.
>>
>
> The data for application parameter MSETime is string with current time basis
> and UTC-offset of the MSE. Since the UTC value depends on the location of
> the device
> so I think it is better left to backend on deciding the UTC value.
We should be able to retrieve this information with tzname or timezone
defined on time.h, so with that and gettimeofday of clock_gettime
should be enough to generate the MSETime without having to depend on
the backend which potentially will do the same thing, besides the
backend could still fail to format the string properly so at least it
should have been an integer but I still prefer to do everything in the
plugin side.
--
Luiz Augusto von Dentz
^ permalink raw reply
* Re: [bluetooth:master 60/61] net/bluetooth/hci_core.c:683:19: sparse: incorrect type in assignment (different base types)
From: Johan Hedberg @ 2012-11-09 15:16 UTC (permalink / raw)
To: Gustavo Padovan; +Cc: linux-bluetooth
In-Reply-To: <509ce8e0.fhFHxG5k0tIvGjwr%fengguang.wu@intel.com>
Hi,
On Fri, Nov 09, 2012, kbuild test robot wrote:
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
> head: 108777e09bbe7874dc5224173a1e3f3ee4ac6471
> commit: c82263e2cfbf6d5c030d0e424ecc91402910e46e [60/61] Bluetooth: Add support for setting LE advertising data
>
>
> sparse warnings:
>
> + net/bluetooth/hci_core.c:683:19: sparse: incorrect type in assignment (different base types)
> net/bluetooth/hci_core.c:683:19: expected unsigned char [unsigned] [addressable] [usertype] length
> net/bluetooth/hci_core.c:683:19: got restricted __le16 [usertype] <noident>
>
> vim +683 net/bluetooth/hci_core.c
>
> c82263e2 Johan Hedberg 2012-11-08 667 goto unlock;
> c82263e2 Johan Hedberg 2012-11-08 668 }
> c82263e2 Johan Hedberg 2012-11-08 669
> c82263e2 Johan Hedberg 2012-11-08 670 memset(&cp, 0, sizeof(cp));
> c82263e2 Johan Hedberg 2012-11-08 671
> c82263e2 Johan Hedberg 2012-11-08 672 len = create_ad(hdev, cp.data);
> c82263e2 Johan Hedberg 2012-11-08 673
> c82263e2 Johan Hedberg 2012-11-08 674 if (hdev->adv_data_len == len &&
> c82263e2 Johan Hedberg 2012-11-08 675 memcmp(cp.data, hdev->adv_data, len) == 0) {
> c82263e2 Johan Hedberg 2012-11-08 676 err = 0;
> c82263e2 Johan Hedberg 2012-11-08 677 goto unlock;
> c82263e2 Johan Hedberg 2012-11-08 678 }
> c82263e2 Johan Hedberg 2012-11-08 679
> c82263e2 Johan Hedberg 2012-11-08 680 memcpy(hdev->adv_data, cp.data, sizeof(cp.data));
> c82263e2 Johan Hedberg 2012-11-08 681 hdev->adv_data_len = len;
> c82263e2 Johan Hedberg 2012-11-08 682
> c82263e2 Johan Hedberg 2012-11-08 @683 cp.length = cpu_to_le16(len);
This is actually a real bug which would show up at least on big endian
systems: cp.length is just one byte so no byte order conversion should
be attempted. Gustavo, do you want me to send a patch to fix it or will
you remove this patch from the current tree and let me send a revised
version?
Johan
^ permalink raw reply
* Re: HFP can't work well and sound can't be heard
From: Luiz Augusto von Dentz @ 2012-11-09 15:13 UTC (permalink / raw)
To: Zheng, Wu; +Cc: Von Dentz, Luiz, linux-bluetooth@vger.kernel.org
In-Reply-To: <2CF57A644018A745B8FE029C7223E16E0FE3E843@SHSMSX102.ccr.corp.intel.com>
Hi,
On Thu, Nov 8, 2012 at 11:41 AM, Zheng, Wu <wu.zheng@intel.com> wrote:
> Hi Luiz,
>
> The GetProperties methods of "org.bluez.manager", "org.bluez.Adapter" and so on have been converted to some methods of "org.freedesktop.DBus.Properties".
>
> It results in pulseaudio can't communicate with bluez well and sound can't be heard when using HFP.
>
> What do upstream plan for it? Thanks.
Obviously we need to port PulseAudio to work with BlueZ 5, this should
not take long but first we need a release, if you still want to test
there are patches that I send to the list not long ago just search the
archives, but note that they are workaround so they are not meant to
go upstream it is just to be able to run bluetoothd with tools that
have not been ported yet.
--
Luiz Augusto von Dentz
^ permalink raw reply
* [PATCH] Add João Paulo to the AUTHORS file
From: Gustavo Padovan @ 2012-11-09 15:06 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Gustavo Padovan
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
AUTHORS | 1 +
1 file changed, 1 insertion(+)
diff --git a/AUTHORS b/AUTHORS
index 4b2d123..944ada2 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -65,3 +65,4 @@ Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Eder Ruiz Maria <eder.ruiz@openbossa.org>
Mikel Astiz <mikel.astiz@bmw-carit.de>
Chan-yeol Park <chanyeol.park@samsung.com>
+João Paulo Rechi Vita <jprvita@gmail.com>
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH] bluetooth: ath3k: Add support for VAIO VPCEH [0489:e027]
From: Marcos Chaparro @ 2012-11-09 13:55 UTC (permalink / raw)
To: Gustavo Padovan; +Cc: marcel, johan.hedberg, linux-bluetooth, linux-kernel
In-Reply-To: <20121109094305.GB9183@joana>
Hi Gustavo,
On Friday, November 09, 2012 06:43:05 Gustavo Padovan wrote:
> Patch has been applied to bluetooth.git. Thanks.
Thanks a lot for the support.
--
Marcos
^ permalink raw reply
* [PATCH 4/4] test: Update proximity test script
From: Andrzej Kaczmarek @ 2012-11-09 12:33 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Andrzej Kaczmarek
In-Reply-To: <1352464401-12702-1-git-send-email-andrzej.kaczmarek@tieto.com>
---
test/test-proximity | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/test/test-proximity b/test/test-proximity
index b08a62a..3cb98cc 100755
--- a/test/test-proximity
+++ b/test/test-proximity
@@ -13,10 +13,12 @@ import dbus
import dbus.mainloop.glib
from optparse import OptionParser, make_option
-def property_changed(name, value):
+def properties_changed(interface, changed, invalidated):
+ if interface != "org.bluez.ProximityMonitor":
+ return
- print("PropertyChanged('%s', '%s')" % (name, value))
- mainloop.quit()
+ for name, value in changed.iteritems():
+ print("Property %s changed: %s" % (name, str(value)))
if __name__ == "__main__":
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -54,15 +56,19 @@ if __name__ == "__main__":
device_path = adapter.FindDevice(options.address)
- bus.add_signal_receiver(property_changed, bus_name="org.bluez",
- dbus_interface="org.bluez.ProximityMonitor",
- signal_name="PropertyChanged")
+ bus.add_signal_receiver(properties_changed, bus_name="org.bluez",
+ path=device_path,
+ dbus_interface="org.freedesktop.DBus.Properties",
+ signal_name="PropertiesChanged")
proximity = dbus.Interface(bus.get_object("org.bluez",
device_path), "org.bluez.ProximityMonitor")
+ device_prop = dbus.Interface(bus.get_object("org.bluez", device_path),
+ "org.freedesktop.DBus.Properties")
+
print("Proximity SetProperty('%s', '%s')" % (args[0], args[1]))
- proximity.SetProperty(args[0], args[1])
+ device_prop.Set("org.bluez.ProximityMonitor", args[0], args[1])
mainloop = gobject.MainLoop()
mainloop.run()
--
1.8.0
^ permalink raw reply related
* [PATCH 3/4] doc: Update proximity API document
From: Andrzej Kaczmarek @ 2012-11-09 12:33 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Andrzej Kaczmarek
In-Reply-To: <1352464401-12702-1-git-send-email-andrzej.kaczmarek@tieto.com>
---
doc/proximity-api.txt | 36 ++----------------------------------
1 file changed, 2 insertions(+), 34 deletions(-)
diff --git a/doc/proximity-api.txt b/doc/proximity-api.txt
index c8eae50..b68a4fe 100644
--- a/doc/proximity-api.txt
+++ b/doc/proximity-api.txt
@@ -11,27 +11,7 @@ Service org.bluez
Interface org.bluez.ProximityMonitor
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-Methods dict GetProperties()
-
- Returns all properties for the interface. See the
- properties section for available properties.
-
- void SetProperty(string name, variant value)
-
- Changes the value of the specified property. Only
- properties that are listed as read-write are changeable.
- On success this will emit a PropertyChanged signal.
-
- Possible Errors: org.bluez.Error.InvalidArguments
-
-Signals PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of a given
- property.
-
-Properties
-
- string SignalLevel[readonly]
+Properties string SignalLevel [readonly]
Alert indicating that a threshold has been reached.
Possible values: "unknown", "good", "regular", "weak"
@@ -63,19 +43,7 @@ Service org.bluez
Interface org.bluez.ProximityReporter
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
-Methods dict GetProperties()
-
- Returns all properties for the interface. See the
- properties section for available properties.
-
-Signals PropertyChanged(string name, variant value)
-
- This signal indicates a changed value of a given
- property.
-
-Properties
-
- string ImmediateAlertLevel [readonly]
+Properties string ImmediateAlertLevel [readonly]
This property indicates that Immediate Alert Level
characteristic in the local Immediate Alert Service
--
1.8.0
^ permalink raw reply related
* [PATCH 2/4] proximity: Convert monitor properties to DBus.Properties
From: Andrzej Kaczmarek @ 2012-11-09 12:33 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Andrzej Kaczmarek
In-Reply-To: <1352464401-12702-1-git-send-email-andrzej.kaczmarek@tieto.com>
---
profiles/proximity/monitor.c | 214 ++++++++++++++++++++++---------------------
1 file changed, 111 insertions(+), 103 deletions(-)
diff --git a/profiles/proximity/monitor.c b/profiles/proximity/monitor.c
index e45fa4a..ba61e1b 100644
--- a/profiles/proximity/monitor.c
+++ b/profiles/proximity/monitor.c
@@ -160,9 +160,8 @@ static void linkloss_written(guint8 status, const guint8 *pdu, guint16 plen,
DBG("Link Loss Alert Level written");
- emit_property_changed(path,
- PROXIMITY_INTERFACE, "LinkLossAlertLevel",
- DBUS_TYPE_STRING, &monitor->linklosslevel);
+ g_dbus_emit_property_changed(btd_get_dbus_connection(), path,
+ PROXIMITY_INTERFACE, "LinkLossAlertLevel");
}
static void char_discovered_cb(GSList *characteristics, guint8 status,
@@ -289,9 +288,10 @@ static gboolean immediate_timeout(gpointer user_data)
g_free(monitor->immediatelevel);
monitor->immediatelevel = g_strdup("none");
- emit_property_changed(path,
- PROXIMITY_INTERFACE, "ImmediateAlertLevel",
- DBUS_TYPE_STRING, &monitor->immediatelevel);
+
+
+ g_dbus_emit_property_changed(btd_get_dbus_connection(), path,
+ PROXIMITY_INTERFACE, "ImmediateAlertLevel");
return FALSE;
}
@@ -304,9 +304,9 @@ static void immediate_written(gpointer user_data)
g_free(monitor->fallbacklevel);
monitor->fallbacklevel = NULL;
- emit_property_changed(path,
- PROXIMITY_INTERFACE, "ImmediateAlertLevel",
- DBUS_TYPE_STRING, &monitor->immediatelevel);
+
+ g_dbus_emit_property_changed(btd_get_dbus_connection(), path,
+ PROXIMITY_INTERFACE, "ImmediateAlertLevel");
monitor->immediateto = g_timeout_add_seconds(IMMEDIATE_TIMEOUT,
immediate_timeout, monitor);
@@ -390,9 +390,9 @@ static void attio_disconnected_cb(gpointer user_data)
g_free(monitor->immediatelevel);
monitor->immediatelevel = g_strdup("none");
- emit_property_changed(path,
- PROXIMITY_INTERFACE, "ImmediateAlertLevel",
- DBUS_TYPE_STRING, &monitor->immediatelevel);
+
+ g_dbus_emit_property_changed(btd_get_dbus_connection(), path,
+ PROXIMITY_INTERFACE, "ImmediateAlertLevel");
}
static gboolean level_is_valid(const char *level)
@@ -402,17 +402,38 @@ static gboolean level_is_valid(const char *level)
g_str_equal("high", level));
}
-static DBusMessage *set_link_loss_alert(DBusConnection *conn, DBusMessage *msg,
- const char *level, void *data)
+static gboolean property_get_link_loss_level(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct monitor *monitor = data;
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
+ &monitor->linklosslevel);
+
+ return TRUE;
+}
+
+static void property_set_link_loss_level(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, GDBusPendingPropertySet id, void *data)
{
struct monitor *monitor = data;
struct btd_device *device = monitor->device;
+ const char *level;
+
+ if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_STRING)
+ return g_dbus_pending_property_error(id,
+ ERROR_INTERFACE ".InvalidArguments",
+ "Invalid arguments in method call");
+
+ dbus_message_iter_get_basic(iter, &level);
if (!level_is_valid(level))
- return btd_error_invalid_args(msg);
+ return g_dbus_pending_property_error(id,
+ ERROR_INTERFACE ".InvalidArguments",
+ "Invalid arguments in method call");
if (g_strcmp0(monitor->linklosslevel, level) == 0)
- return dbus_message_new_method_return(msg);
+ goto done;
g_free(monitor->linklosslevel);
monitor->linklosslevel = g_strdup(level);
@@ -424,19 +445,55 @@ static DBusMessage *set_link_loss_alert(DBusConnection *conn, DBusMessage *msg,
if (monitor->attrib)
write_alert_level(monitor);
- return dbus_message_new_method_return(msg);
+done:
+ g_dbus_pending_property_success(id);
+}
+
+static gboolean property_exists_link_loss_level(
+ const GDBusPropertyTable *property, void *data)
+{
+ struct monitor *monitor = data;
+
+ if (!monitor->enabled.linkloss)
+ return FALSE;
+
+ return TRUE;
+}
+
+static gboolean property_get_immediate_alert_level(
+ const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct monitor *monitor = data;
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
+ &monitor->immediatelevel);
+
+ return TRUE;
}
-static DBusMessage *set_immediate_alert(DBusConnection *conn, DBusMessage *msg,
- const char *level, void *data)
+static void property_set_immediate_alert_level(
+ const GDBusPropertyTable *property, DBusMessageIter *iter,
+ GDBusPendingPropertySet id, void *data)
{
struct monitor *monitor = data;
+ struct btd_device *device = monitor->device;
+ const char *level;
+
+ if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_STRING)
+ return g_dbus_pending_property_error(id,
+ ERROR_INTERFACE ".InvalidArguments",
+ "Invalid arguments in method call");
+
+ dbus_message_iter_get_basic(iter, &level);
if (!level_is_valid(level))
- return btd_error_invalid_args(msg);
+ return g_dbus_pending_property_error(id,
+ ERROR_INTERFACE ".InvalidArguments",
+ "Invalid arguments in method call");
if (g_strcmp0(monitor->immediatelevel, level) == 0)
- return dbus_message_new_method_return(msg);
+ goto done;
if (monitor->immediateto) {
g_source_remove(monitor->immediateto);
@@ -456,109 +513,60 @@ static DBusMessage *set_immediate_alert(DBusConnection *conn, DBusMessage *msg,
* when the Proximity Monitor starts.
*/
if (monitor->attioid == 0)
- monitor->attioid = btd_device_add_attio_callback(monitor->device,
+ monitor->attioid = btd_device_add_attio_callback(device,
attio_connected_cb,
attio_disconnected_cb,
monitor);
else if (monitor->attrib)
write_immediate_alert(monitor);
- return dbus_message_new_method_return(msg);
+done:
+ g_dbus_pending_property_success(id);
}
-static DBusMessage *get_properties(DBusConnection *conn,
- DBusMessage *msg, void *data)
+static gboolean property_exists_immediate_alert_level(
+ const GDBusPropertyTable *property, void *data)
{
struct monitor *monitor = data;
- DBusMessageIter iter;
- DBusMessageIter dict;
- DBusMessage *reply;
-
- reply = dbus_message_new_method_return(msg);
- if (!reply)
- return NULL;
-
- dbus_message_iter_init_append(reply, &iter);
-
- dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
- DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
- DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
- if (monitor->enabled.linkloss)
- dict_append_entry(&dict, "LinkLossAlertLevel",
- DBUS_TYPE_STRING, &monitor->linklosslevel);
-
- if (monitor->enabled.findme || monitor->enabled.pathloss)
- dict_append_entry(&dict, "ImmediateAlertLevel",
- DBUS_TYPE_STRING, &monitor->immediatelevel);
-
- if (monitor->enabled.pathloss)
- dict_append_entry(&dict, "SignalLevel",
- DBUS_TYPE_STRING, &monitor->signallevel);
-
- dbus_message_iter_close_container(&iter, &dict);
+ if (!(monitor->enabled.findme || monitor->enabled.pathloss))
+ return FALSE;
- return reply;
+ return TRUE;
}
-static DBusMessage *set_property(DBusConnection *conn,
- DBusMessage *msg, void *data)
+static gboolean property_get_signal_level(
+ const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
{
struct monitor *monitor = data;
- const char *property;
- DBusMessageIter iter;
- DBusMessageIter sub;
- const char *level;
- if (!dbus_message_iter_init(msg, &iter))
- return btd_error_invalid_args(msg);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
+ &monitor->signallevel);
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
- return btd_error_invalid_args(msg);
-
- dbus_message_iter_get_basic(&iter, &property);
- dbus_message_iter_next(&iter);
-
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT)
- return btd_error_invalid_args(msg);
-
- dbus_message_iter_recurse(&iter, &sub);
-
- if (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_STRING)
- return btd_error_invalid_args(msg);
-
- dbus_message_iter_get_basic(&sub, &level);
-
- if (g_str_equal("ImmediateAlertLevel", property)) {
- if (monitor->enabled.findme == FALSE &&
- monitor->enabled.pathloss == FALSE)
- return btd_error_not_available(msg);
+ return TRUE;
+}
- return set_immediate_alert(conn, msg, level, data);
- } else if (g_str_equal("LinkLossAlertLevel", property)) {
- if (monitor->enabled.linkloss == FALSE)
- return btd_error_not_available(msg);
+static gboolean property_exists_signal_level(const GDBusPropertyTable *property,
+ void *data)
+{
+ struct monitor *monitor = data;
- return set_link_loss_alert(conn, msg, level, data);
- }
+ if (!monitor->enabled.pathloss)
+ return FALSE;
- return btd_error_invalid_args(msg);
+ return TRUE;
}
-static const GDBusMethodTable monitor_methods[] = {
- { GDBUS_METHOD("GetProperties",
- NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
- get_properties) },
- { GDBUS_ASYNC_METHOD("SetProperty",
- GDBUS_ARGS({ "name", "s" }, { "value", "v" }), NULL,
- set_property) },
- { }
-};
-
-static const GDBusSignalTable monitor_signals[] = {
- { GDBUS_SIGNAL("PropertyChanged",
- GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
+static const GDBusPropertyTable monitor_device_properties[] = {
+ { "LinkLossAlertLevel", "s", property_get_link_loss_level,
+ property_set_link_loss_level,
+ property_exists_link_loss_level },
+ { "ImmediateAlertLevel", "s", property_get_immediate_alert_level,
+ property_set_immediate_alert_level,
+ property_exists_immediate_alert_level },
+ { "SignalLevel", "s", property_get_signal_level, NULL,
+ property_exists_signal_level },
{ }
};
@@ -605,8 +613,8 @@ int monitor_register(struct btd_device *device,
if (g_dbus_register_interface(btd_get_dbus_connection(), path,
PROXIMITY_INTERFACE,
- monitor_methods, monitor_signals,
- NULL, monitor, monitor_destroy) == FALSE) {
+ NULL, NULL, monitor_device_properties,
+ monitor, monitor_destroy) == FALSE) {
error("D-Bus failed to register %s interface",
PROXIMITY_INTERFACE);
monitor_destroy(monitor);
--
1.8.0
^ permalink raw reply related
* [PATCH 1/4] proximity: Convert reporter properties to DBus.Properties
From: Andrzej Kaczmarek @ 2012-11-09 12:33 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Andrzej Kaczmarek
---
profiles/proximity/immalert.c | 5 ++--
profiles/proximity/linkloss.c | 5 ++--
profiles/proximity/reporter.c | 62 +++++++++++++++----------------------------
3 files changed, 25 insertions(+), 47 deletions(-)
diff --git a/profiles/proximity/immalert.c b/profiles/proximity/immalert.c
index 77b4966..ff40bdf 100644
--- a/profiles/proximity/immalert.c
+++ b/profiles/proximity/immalert.c
@@ -137,9 +137,8 @@ static void imm_alert_emit_alert_signal(struct connected_device *condev,
DBG("alert %s remote %s", alert_level_str, path);
- emit_property_changed(path,
- PROXIMITY_REPORTER_INTERFACE, "ImmediateAlertLevel",
- DBUS_TYPE_STRING, &alert_level_str);
+ g_dbus_emit_property_changed(btd_get_dbus_connection(), path,
+ PROXIMITY_REPORTER_INTERFACE, "ImmediateAlertLevel");
}
static void imm_alert_remove_condev(struct connected_device *condev)
diff --git a/profiles/proximity/linkloss.c b/profiles/proximity/linkloss.c
index 40510d8..de92be7 100644
--- a/profiles/proximity/linkloss.c
+++ b/profiles/proximity/linkloss.c
@@ -138,9 +138,8 @@ static void link_loss_emit_alert_signal(struct connected_device *condev)
DBG("alert %s remote %s", alert_level_str, path);
- emit_property_changed(path,
- PROXIMITY_REPORTER_INTERFACE, "LinkLossAlertLevel",
- DBUS_TYPE_STRING, &alert_level_str);
+ g_dbus_emit_property_changed(btd_get_dbus_connection(), path,
+ PROXIMITY_REPORTER_INTERFACE, "LinkLossAlertLevel");
}
static uint8_t link_loss_alert_lvl_read(struct attribute *a,
diff --git a/profiles/proximity/reporter.c b/profiles/proximity/reporter.c
index 6ec5f73..1d98ba9 100644
--- a/profiles/proximity/reporter.c
+++ b/profiles/proximity/reporter.c
@@ -139,56 +139,36 @@ static void register_tx_power(struct btd_adapter *adapter)
g_assert(h - start_handle == svc_size);
}
-static DBusMessage *get_properties(DBusConnection *conn,
- DBusMessage *msg, void *data)
+static gboolean property_get_link_loss_level(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
{
- DBusMessageIter iter;
- DBusMessageIter dict;
- DBusMessage *reply = NULL;
- const char *linkloss_level, *immalert_level;
struct btd_device *device = data;
+ const char *level;
- reply = dbus_message_new_method_return(msg);
- if (!reply)
- return NULL;
-
- linkloss_level = link_loss_get_alert_level(device);
- immalert_level = imm_alert_get_level(device);
+ level = link_loss_get_alert_level(device);
- dbus_message_iter_init_append(reply, &iter);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &level);
- if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
- DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
- DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict))
- goto err;
+ return TRUE;
+}
- dict_append_entry(&dict, "LinkLossAlertLevel", DBUS_TYPE_STRING,
- &linkloss_level);
- dict_append_entry(&dict, "ImmediateAlertLevel", DBUS_TYPE_STRING,
- &immalert_level);
+static gboolean property_get_immediate_alert_level(
+ const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct btd_device *device = data;
+ const char *level;
- if (!dbus_message_iter_close_container(&iter, &dict))
- goto err;
+ level = imm_alert_get_level(device);
- return reply;
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &level);
-err:
- if (reply)
- dbus_message_unref(reply);
- return btd_error_failed(msg, "not enough memory");
+ return TRUE;
}
-static const GDBusMethodTable reporter_methods[] = {
- { GDBUS_METHOD("GetProperties",
- NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
- get_properties) },
- { }
-};
-
-static const GDBusSignalTable reporter_signals[] = {
- { GDBUS_SIGNAL("PropertyChanged",
- GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
+static const GDBusPropertyTable reporter_device_properties[] = {
+ { "LinkLossAlertLevel", "s", property_get_link_loss_level },
+ { "ImmediateAlertLevel", "s", property_get_immediate_alert_level },
{ }
};
@@ -216,8 +196,8 @@ static void register_reporter_device(struct btd_device *device,
g_dbus_register_interface(btd_get_dbus_connection(), path,
PROXIMITY_REPORTER_INTERFACE,
- reporter_methods, reporter_signals,
- NULL, device, NULL);
+ NULL, NULL, reporter_device_properties,
+ device, NULL);
btd_device_ref(device);
radapter->devices = g_slist_prepend(radapter->devices, device);
--
1.8.0
^ permalink raw reply related
* Re: [PATCH obexd v1 2/3] MAP: Add MSETime application parameter
From: Sunil Kumar Behera @ 2012-11-09 11:29 UTC (permalink / raw)
To: Luiz Augusto von Dentz, Sunil Kumar Behera; +Cc: linux-bluetooth
In-Reply-To: <CABBYNZ+K+R_i6ofgCP9rgsOPP2rBVk_9RKG=Q1v4BVRO_RCRCw@mail.gmail.com>
Hi Luiz,
--------------------------------------------------
From: "Luiz Augusto von Dentz" <luiz.dentz@gmail.com>
Sent: Friday, November 09, 2012 3:33 PM
To: "Sunil Kumar Behera" <sunil.behera@samsung.com>
Cc: <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH obexd v1 2/3] MAP: Add MSETime application parameter
> Hi Sunil,
>
> On Thu, Nov 8, 2012 at 1:04 PM, Sunil Kumar Behera
> <sunil.behera@samsung.com> wrote:
>> MSETime application parameter shall be used in the response
>> to report the Local Time basis of the MSE.
>> ---
>> plugins/mas.c | 4 +++-
>> plugins/messages.h | 1 +
>> 2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/plugins/mas.c b/plugins/mas.c
>> index 319c87f..bdf2b6b 100644
>> --- a/plugins/mas.c
>> +++ b/plugins/mas.c
>> @@ -284,7 +284,7 @@ static const char *yesorno(gboolean a)
>> }
>>
>> static void get_messages_listing_cb(void *session, int err, uint16_t
>> size,
>> - gboolean newmsg,
>> + gboolean newmsg, gchar *msetime,
>> const struct messages_message
>> *entry,
>> void *user_data)
>> {
>> @@ -403,6 +403,8 @@ proceed:
>> mas->outparams = g_obex_apparam_set_uint8(mas->outparams,
>> MAP_AP_NEWMESSAGE,
>> newmsg ? 1 : 0);
>> + mas->outparams =
>> g_obex_apparam_set_string(mas->outparams,
>> + MAP_AP_MSETIME, msetime);
>> }
>>
>> if (err != -EAGAIN)
>> diff --git a/plugins/messages.h b/plugins/messages.h
>> index 00a16b1..2ab4ba1 100644
>> --- a/plugins/messages.h
>> +++ b/plugins/messages.h
>> @@ -226,6 +226,7 @@ int messages_get_folder_listing(void *session, const
>> char *name, uint16_t max,
>> */
>> typedef void (*messages_get_messages_listing_cb)(void *session, int err,
>> uint16_t size, gboolean newmsg,
>> + gchar *msetime,
>> const struct messages_message
>> *message,
>> void *user_data);
>
> Do we really need to do this in the backend? We could possible
> generate the timestamp on get_messages_listing_cb and which should
> avoid having duplicate code doing the same for each backend.
>
The data for application parameter MSETime is string with current time basis
and UTC-offset of the MSE. Since the UTC value depends on the location of
the device
so I think it is better left to backend on deciding the UTC value.
Best regards,
Sunil Kumar Behera
^ permalink raw reply
* [bluetooth:master 60/61] net/bluetooth/hci_core.c:683:19: sparse: incorrect type in assignment (different base types)
From: kbuild test robot @ 2012-11-09 11:28 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth, Gustavo Padovan
tree: git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
head: 108777e09bbe7874dc5224173a1e3f3ee4ac6471
commit: c82263e2cfbf6d5c030d0e424ecc91402910e46e [60/61] Bluetooth: Add support for setting LE advertising data
sparse warnings:
+ net/bluetooth/hci_core.c:683:19: sparse: incorrect type in assignment (different base types)
net/bluetooth/hci_core.c:683:19: expected unsigned char [unsigned] [addressable] [usertype] length
net/bluetooth/hci_core.c:683:19: got restricted __le16 [usertype] <noident>
vim +683 net/bluetooth/hci_core.c
c82263e2 Johan Hedberg 2012-11-08 667 goto unlock;
c82263e2 Johan Hedberg 2012-11-08 668 }
c82263e2 Johan Hedberg 2012-11-08 669
c82263e2 Johan Hedberg 2012-11-08 670 memset(&cp, 0, sizeof(cp));
c82263e2 Johan Hedberg 2012-11-08 671
c82263e2 Johan Hedberg 2012-11-08 672 len = create_ad(hdev, cp.data);
c82263e2 Johan Hedberg 2012-11-08 673
c82263e2 Johan Hedberg 2012-11-08 674 if (hdev->adv_data_len == len &&
c82263e2 Johan Hedberg 2012-11-08 675 memcmp(cp.data, hdev->adv_data, len) == 0) {
c82263e2 Johan Hedberg 2012-11-08 676 err = 0;
c82263e2 Johan Hedberg 2012-11-08 677 goto unlock;
c82263e2 Johan Hedberg 2012-11-08 678 }
c82263e2 Johan Hedberg 2012-11-08 679
c82263e2 Johan Hedberg 2012-11-08 680 memcpy(hdev->adv_data, cp.data, sizeof(cp.data));
c82263e2 Johan Hedberg 2012-11-08 681 hdev->adv_data_len = len;
c82263e2 Johan Hedberg 2012-11-08 682
c82263e2 Johan Hedberg 2012-11-08 @683 cp.length = cpu_to_le16(len);
c82263e2 Johan Hedberg 2012-11-08 684
c82263e2 Johan Hedberg 2012-11-08 685 err = hci_send_cmd(hdev, HCI_OP_LE_SET_ADV_DATA, sizeof(cp), &cp);
c82263e2 Johan Hedberg 2012-11-08 686
c82263e2 Johan Hedberg 2012-11-08 687 unlock:
c82263e2 Johan Hedberg 2012-11-08 688 hci_dev_unlock(hdev);
c82263e2 Johan Hedberg 2012-11-08 689
c82263e2 Johan Hedberg 2012-11-08 690 return err;
c82263e2 Johan Hedberg 2012-11-08 691 }
---
0-DAY kernel build testing backend Open Source Technology Center
Fengguang Wu, Yuanhan Liu Intel Corporation
^ permalink raw reply
* Re: [PATCH BlueZ v2] audio: Move to profiles directory
From: Marcel Holtmann @ 2012-11-09 10:48 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1352455094-17992-1-git-send-email-luiz.dentz@gmail.com>
Hi Luiz,
> ---
> v2: Rebase after changes to remove gstreamer and SBC code
>
> Makefile.am | 64 +++++++++++++++-------------
> {audio => profiles/audio}/a2dp-codecs.h | 0
this one is used from avinfo.c as well. We might move that one better
into lib/ or some place else.
> {audio => profiles/audio}/a2dp.c | 0
> {audio => profiles/audio}/a2dp.h | 0
> {audio => profiles/audio}/audio.conf | 0
> {audio => profiles/audio}/avctp.c | 0
> {audio => profiles/audio}/avctp.h | 0
> {audio => profiles/audio}/avdtp.c | 0
> {audio => profiles/audio}/avdtp.h | 0
> {audio => profiles/audio}/avrcp.c | 0
> {audio => profiles/audio}/avrcp.h | 0
> {audio => profiles/audio}/control.c | 0
> {audio => profiles/audio}/control.h | 0
> {audio => profiles/audio}/device.c | 0
> {audio => profiles/audio}/device.h | 0
> {audio => profiles/audio}/gateway.c | 0
> {audio => profiles/audio}/gateway.h | 0
> {audio => profiles/audio}/headset.c | 0
> {audio => profiles/audio}/headset.h | 0
> {audio => profiles/audio}/main.c | 0
> {audio => profiles/audio}/manager.c | 0
> {audio => profiles/audio}/manager.h | 0
> {audio => profiles/audio}/media.c | 0
> {audio => profiles/audio}/media.h | 0
> {audio => profiles/audio}/player.c | 0
> {audio => profiles/audio}/player.h | 0
> {audio => profiles/audio}/rtp.h | 0
> {audio => profiles/audio}/sink.c | 0
> {audio => profiles/audio}/sink.h | 0
> {audio => profiles/audio}/source.c | 0
> {audio => profiles/audio}/source.h | 0
> {audio => profiles/audio}/telephony-dummy.c | 0
> {audio => profiles/audio}/telephony-maemo5.c | 0
> {audio => profiles/audio}/telephony-maemo6.c | 0
> {audio => profiles/audio}/telephony-ofono.c | 0
> {audio => profiles/audio}/telephony.h | 0
> {audio => profiles/audio}/transport.c | 0
> {audio => profiles/audio}/transport.h | 0
> 38 files changed, 35 insertions(+), 29 deletions(-)
> rename {audio => profiles/audio}/a2dp-codecs.h (100%)
> rename {audio => profiles/audio}/a2dp.c (100%)
> rename {audio => profiles/audio}/a2dp.h (100%)
> rename {audio => profiles/audio}/audio.conf (100%)
> rename {audio => profiles/audio}/avctp.c (100%)
> rename {audio => profiles/audio}/avctp.h (100%)
> rename {audio => profiles/audio}/avdtp.c (100%)
> rename {audio => profiles/audio}/avdtp.h (100%)
> rename {audio => profiles/audio}/avrcp.c (100%)
> rename {audio => profiles/audio}/avrcp.h (100%)
> rename {audio => profiles/audio}/control.c (100%)
> rename {audio => profiles/audio}/control.h (100%)
> rename {audio => profiles/audio}/device.c (100%)
> rename {audio => profiles/audio}/device.h (100%)
> rename {audio => profiles/audio}/gateway.c (100%)
> rename {audio => profiles/audio}/gateway.h (100%)
> rename {audio => profiles/audio}/headset.c (100%)
> rename {audio => profiles/audio}/headset.h (100%)
> rename {audio => profiles/audio}/main.c (100%)
> rename {audio => profiles/audio}/manager.c (100%)
> rename {audio => profiles/audio}/manager.h (100%)
> rename {audio => profiles/audio}/media.c (100%)
> rename {audio => profiles/audio}/media.h (100%)
> rename {audio => profiles/audio}/player.c (100%)
> rename {audio => profiles/audio}/player.h (100%)
> rename {audio => profiles/audio}/rtp.h (100%)
> rename {audio => profiles/audio}/sink.c (100%)
> rename {audio => profiles/audio}/sink.h (100%)
> rename {audio => profiles/audio}/source.c (100%)
> rename {audio => profiles/audio}/source.h (100%)
> rename {audio => profiles/audio}/telephony-dummy.c (100%)
> rename {audio => profiles/audio}/telephony-maemo5.c (100%)
> rename {audio => profiles/audio}/telephony-maemo6.c (100%)
> rename {audio => profiles/audio}/telephony-ofono.c (100%)
> rename {audio => profiles/audio}/telephony.h (100%)
> rename {audio => profiles/audio}/transport.c (100%)
> rename {audio => profiles/audio}/transport.h (100%)
Before we do this, lets take the telephony stuff out first. We do not
want to keep it anyway.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH BlueZ 1/2] build: Require D-Bus 1.5 or later
From: Marcel Holtmann @ 2012-11-09 10:44 UTC (permalink / raw)
To: Syam Sidhardhan; +Cc: linux-bluetooth
In-Reply-To: <1352449889-5149-1-git-send-email-s.syam@samsung.com>
Hi Syam,
> The gdbus require D-Bus 1.5 version.
>
> Log:
> CC gdbus/object.o
> gdbus/object.c: In function ‘properties_set’:
> gdbus/object.c:876:7: error: ‘DBUS_ERROR_UNKNOWN_PROPERTY’ undeclared
> (first use in this function)
> gdbus/object.c:876:7: note: each undeclared identifier is reported
> only once for each function it appears in
> gdbus/object.c:881:6: error: ‘DBUS_ERROR_PROPERTY_READ_ONLY’
> undeclared (first use in this function)
> make[1]: *** [gdbus/object.o] Error 1
> make: *** [all] Error 2
if they are still simple defines, then lets just #ifndef them and define
them in gdbus/object.c
Regards
Marcel
^ permalink raw reply
* Re: [PATCH obexd v1 3/3] MAP: Reset ap_sent variable
From: Luiz Augusto von Dentz @ 2012-11-09 10:22 UTC (permalink / raw)
To: Sunil Kumar Behera; +Cc: linux-bluetooth
In-Reply-To: <1352372786-18324-1-git-send-email-sunil.behera@samsung.com>
Hi Sunil,
On Thu, Nov 8, 2012 at 1:06 PM, Sunil Kumar Behera
<sunil.behera@samsung.com> wrote:
> For multiple subsequent request for message listing
> we need to reset this variable to FALSE, so that each
> time the get next header function is executed properly.
> ---
> plugins/mas.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/plugins/mas.c b/plugins/mas.c
> index bdf2b6b..459df87 100644
> --- a/plugins/mas.c
> +++ b/plugins/mas.c
> @@ -162,6 +162,7 @@ static void reset_request(struct mas_session *mas)
>
> mas->nth_call = FALSE;
> mas->finished = FALSE;
> + mas->ap_sent = FALSE;
> }
>
> static void mas_clean(struct mas_session *mas)
> --
> 1.7.9.5
I went ahead and pushed this upstream, the other 2 patches Im waiting
your reply.
--
Luiz Augusto von Dentz
^ permalink raw reply
* Re: [PATCH obexd v1 2/3] MAP: Add MSETime application parameter
From: Luiz Augusto von Dentz @ 2012-11-09 10:03 UTC (permalink / raw)
To: Sunil Kumar Behera; +Cc: linux-bluetooth
In-Reply-To: <1352372667-18288-1-git-send-email-sunil.behera@samsung.com>
Hi Sunil,
On Thu, Nov 8, 2012 at 1:04 PM, Sunil Kumar Behera
<sunil.behera@samsung.com> wrote:
> MSETime application parameter shall be used in the response
> to report the Local Time basis of the MSE.
> ---
> plugins/mas.c | 4 +++-
> plugins/messages.h | 1 +
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/plugins/mas.c b/plugins/mas.c
> index 319c87f..bdf2b6b 100644
> --- a/plugins/mas.c
> +++ b/plugins/mas.c
> @@ -284,7 +284,7 @@ static const char *yesorno(gboolean a)
> }
>
> static void get_messages_listing_cb(void *session, int err, uint16_t size,
> - gboolean newmsg,
> + gboolean newmsg, gchar *msetime,
> const struct messages_message *entry,
> void *user_data)
> {
> @@ -403,6 +403,8 @@ proceed:
> mas->outparams = g_obex_apparam_set_uint8(mas->outparams,
> MAP_AP_NEWMESSAGE,
> newmsg ? 1 : 0);
> + mas->outparams = g_obex_apparam_set_string(mas->outparams,
> + MAP_AP_MSETIME, msetime);
> }
>
> if (err != -EAGAIN)
> diff --git a/plugins/messages.h b/plugins/messages.h
> index 00a16b1..2ab4ba1 100644
> --- a/plugins/messages.h
> +++ b/plugins/messages.h
> @@ -226,6 +226,7 @@ int messages_get_folder_listing(void *session, const char *name, uint16_t max,
> */
> typedef void (*messages_get_messages_listing_cb)(void *session, int err,
> uint16_t size, gboolean newmsg,
> + gchar *msetime,
> const struct messages_message *message,
> void *user_data);
Do we really need to do this in the backend? We could possible
generate the timestamp on get_messages_listing_cb and which should
avoid having duplicate code doing the same for each backend.
--
Luiz Augusto von Dentz
^ permalink raw reply
* [PATCH BlueZ v2] audio: Move to profiles directory
From: Luiz Augusto von Dentz @ 2012-11-09 9:58 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
v2: Rebase after changes to remove gstreamer and SBC code
Makefile.am | 64 +++++++++++++++-------------
{audio => profiles/audio}/a2dp-codecs.h | 0
{audio => profiles/audio}/a2dp.c | 0
{audio => profiles/audio}/a2dp.h | 0
{audio => profiles/audio}/audio.conf | 0
{audio => profiles/audio}/avctp.c | 0
{audio => profiles/audio}/avctp.h | 0
{audio => profiles/audio}/avdtp.c | 0
{audio => profiles/audio}/avdtp.h | 0
{audio => profiles/audio}/avrcp.c | 0
{audio => profiles/audio}/avrcp.h | 0
{audio => profiles/audio}/control.c | 0
{audio => profiles/audio}/control.h | 0
{audio => profiles/audio}/device.c | 0
{audio => profiles/audio}/device.h | 0
{audio => profiles/audio}/gateway.c | 0
{audio => profiles/audio}/gateway.h | 0
{audio => profiles/audio}/headset.c | 0
{audio => profiles/audio}/headset.h | 0
{audio => profiles/audio}/main.c | 0
{audio => profiles/audio}/manager.c | 0
{audio => profiles/audio}/manager.h | 0
{audio => profiles/audio}/media.c | 0
{audio => profiles/audio}/media.h | 0
{audio => profiles/audio}/player.c | 0
{audio => profiles/audio}/player.h | 0
{audio => profiles/audio}/rtp.h | 0
{audio => profiles/audio}/sink.c | 0
{audio => profiles/audio}/sink.h | 0
{audio => profiles/audio}/source.c | 0
{audio => profiles/audio}/source.h | 0
{audio => profiles/audio}/telephony-dummy.c | 0
{audio => profiles/audio}/telephony-maemo5.c | 0
{audio => profiles/audio}/telephony-maemo6.c | 0
{audio => profiles/audio}/telephony-ofono.c | 0
{audio => profiles/audio}/telephony.h | 0
{audio => profiles/audio}/transport.c | 0
{audio => profiles/audio}/transport.h | 0
38 files changed, 35 insertions(+), 29 deletions(-)
rename {audio => profiles/audio}/a2dp-codecs.h (100%)
rename {audio => profiles/audio}/a2dp.c (100%)
rename {audio => profiles/audio}/a2dp.h (100%)
rename {audio => profiles/audio}/audio.conf (100%)
rename {audio => profiles/audio}/avctp.c (100%)
rename {audio => profiles/audio}/avctp.h (100%)
rename {audio => profiles/audio}/avdtp.c (100%)
rename {audio => profiles/audio}/avdtp.h (100%)
rename {audio => profiles/audio}/avrcp.c (100%)
rename {audio => profiles/audio}/avrcp.h (100%)
rename {audio => profiles/audio}/control.c (100%)
rename {audio => profiles/audio}/control.h (100%)
rename {audio => profiles/audio}/device.c (100%)
rename {audio => profiles/audio}/device.h (100%)
rename {audio => profiles/audio}/gateway.c (100%)
rename {audio => profiles/audio}/gateway.h (100%)
rename {audio => profiles/audio}/headset.c (100%)
rename {audio => profiles/audio}/headset.h (100%)
rename {audio => profiles/audio}/main.c (100%)
rename {audio => profiles/audio}/manager.c (100%)
rename {audio => profiles/audio}/manager.h (100%)
rename {audio => profiles/audio}/media.c (100%)
rename {audio => profiles/audio}/media.h (100%)
rename {audio => profiles/audio}/player.c (100%)
rename {audio => profiles/audio}/player.h (100%)
rename {audio => profiles/audio}/rtp.h (100%)
rename {audio => profiles/audio}/sink.c (100%)
rename {audio => profiles/audio}/sink.h (100%)
rename {audio => profiles/audio}/source.c (100%)
rename {audio => profiles/audio}/source.h (100%)
rename {audio => profiles/audio}/telephony-dummy.c (100%)
rename {audio => profiles/audio}/telephony-maemo5.c (100%)
rename {audio => profiles/audio}/telephony-maemo6.c (100%)
rename {audio => profiles/audio}/telephony-ofono.c (100%)
rename {audio => profiles/audio}/telephony.h (100%)
rename {audio => profiles/audio}/transport.c (100%)
rename {audio => profiles/audio}/transport.h (100%)
diff --git a/Makefile.am b/Makefile.am
index 11f7468..0465b5d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -105,29 +105,31 @@ endif
if AUDIOPLUGIN
builtin_modules += audio
-builtin_sources += audio/main.c \
- audio/manager.h audio/manager.c \
- audio/gateway.h audio/gateway.c \
- audio/headset.h audio/headset.c \
- audio/control.h audio/control.c \
- audio/avctp.h audio/avctp.c \
- audio/avrcp.h audio/avrcp.c \
- audio/device.h audio/device.c \
- audio/source.h audio/source.c \
- audio/sink.h audio/sink.c \
- audio/a2dp.h audio/a2dp.c \
- audio/avdtp.h audio/avdtp.c \
- audio/media.h audio/media.c \
- audio/transport.h audio/transport.c \
- audio/player.h audio/player.c \
- audio/telephony.h audio/a2dp-codecs.h
-builtin_nodist += audio/telephony.c
-
-noinst_LIBRARIES += audio/libtelephony.a
-
-audio_libtelephony_a_SOURCES = audio/telephony.h audio/telephony-dummy.c \
- audio/telephony-maemo5.c audio/telephony-ofono.c \
- audio/telephony-maemo6.c
+builtin_sources += profiles/audio/main.c \
+ profiles/audio/manager.h profiles/audio/manager.c \
+ profiles/audio/gateway.h profiles/audio/gateway.c \
+ profiles/audio/headset.h profiles/audio/headset.c \
+ profiles/audio/control.h profiles/audio/control.c \
+ profiles/audio/avctp.h profiles/audio/avctp.c \
+ profiles/audio/avrcp.h profiles/audio/avrcp.c \
+ profiles/audio/device.h profiles/audio/device.c \
+ profiles/audio/source.h profiles/audio/source.c \
+ profiles/audio/sink.h profiles/audio/sink.c \
+ profiles/audio/a2dp.h profiles/audio/a2dp.c \
+ profiles/audio/avdtp.h profiles/audio/avdtp.c \
+ profiles/audio/media.h profiles/audio/media.c \
+ profiles/audio/transport.h profiles/audio/transport.c \
+ profiles/audio/player.h profiles/audio/player.c \
+ profiles/audio/telephony.h profiles/audio/a2dp-codecs.h
+builtin_nodist += profiles/audio/telephony.c
+
+noinst_LIBRARIES += profiles/audio/libtelephony.a
+
+profiles_audio_libtelephony_a_SOURCES = profiles/audio/telephony.h
+ profiles/audio/telephony-dummy.c \
+ profiles/audio/telephony-maemo5.c \
+ profiles/audio/telephony-ofono.c \
+ profiles/audio/telephony-maemo6.c
endif
if SAPPLUGIN
@@ -315,10 +317,14 @@ endif
EXTRA_DIST += src/genbuiltin src/bluetooth.conf src/org.bluez.service \
src/main.conf profiles/network/network.conf \
- profiles/input/input.conf profiles/proximity/proximity.conf \
- audio/audio.conf audio/telephony-dummy.c \
- audio/telephony-maemo5.c audio/telephony-ofono.c \
- audio/telephony-maemo6.c profiles/sap/sap-dummy.c \
+ profiles/input/input.conf \
+ profiles/proximity/proximity.conf \
+ profiles/audio/audio.conf \
+ profiles/audio/telephony-dummy.c \
+ profiles/audio/telephony-maemo5.c \
+ profiles/audio/telephony-ofono.c \
+ profiles/audio/telephony-maemo6.c \
+ profiles/sap/sap-dummy.c \
profiles/sap/sap-u8500.c
include Makefile.tools
@@ -360,7 +366,7 @@ EXTRA_DIST += doc/manager-api.txt \
AM_CFLAGS += @DBUS_CFLAGS@ @GLIB_CFLAGS@
AM_CPPFLAGS = -I$(builddir)/lib -I$(builddir)/src -I$(srcdir)/src \
- -I$(srcdir)/audio -I$(srcdir)/gdbus \
+ -I$(srcdir)/profiles/audio -I$(srcdir)/gdbus \
-I$(srcdir)/attrib -I$(srcdir)/btio -I$(srcdir)/tools \
-I$(builddir)/tools -I$(srcdir)/monitor
@@ -400,7 +406,7 @@ MAINTAINERCLEANFILES = Makefile.in \
src/builtin.h: src/genbuiltin $(builtin_sources)
$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
-audio/telephony.c: audio/@TELEPHONY_DRIVER@
+profiles/audio/telephony.c: profiles/audio/@TELEPHONY_DRIVER@
$(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
profiles/sap/sap.c: profiles/sap/@SAP_DRIVER@
diff --git a/audio/a2dp-codecs.h b/profiles/audio/a2dp-codecs.h
similarity index 100%
rename from audio/a2dp-codecs.h
rename to profiles/audio/a2dp-codecs.h
diff --git a/audio/a2dp.c b/profiles/audio/a2dp.c
similarity index 100%
rename from audio/a2dp.c
rename to profiles/audio/a2dp.c
diff --git a/audio/a2dp.h b/profiles/audio/a2dp.h
similarity index 100%
rename from audio/a2dp.h
rename to profiles/audio/a2dp.h
diff --git a/audio/audio.conf b/profiles/audio/audio.conf
similarity index 100%
rename from audio/audio.conf
rename to profiles/audio/audio.conf
diff --git a/audio/avctp.c b/profiles/audio/avctp.c
similarity index 100%
rename from audio/avctp.c
rename to profiles/audio/avctp.c
diff --git a/audio/avctp.h b/profiles/audio/avctp.h
similarity index 100%
rename from audio/avctp.h
rename to profiles/audio/avctp.h
diff --git a/audio/avdtp.c b/profiles/audio/avdtp.c
similarity index 100%
rename from audio/avdtp.c
rename to profiles/audio/avdtp.c
diff --git a/audio/avdtp.h b/profiles/audio/avdtp.h
similarity index 100%
rename from audio/avdtp.h
rename to profiles/audio/avdtp.h
diff --git a/audio/avrcp.c b/profiles/audio/avrcp.c
similarity index 100%
rename from audio/avrcp.c
rename to profiles/audio/avrcp.c
diff --git a/audio/avrcp.h b/profiles/audio/avrcp.h
similarity index 100%
rename from audio/avrcp.h
rename to profiles/audio/avrcp.h
diff --git a/audio/control.c b/profiles/audio/control.c
similarity index 100%
rename from audio/control.c
rename to profiles/audio/control.c
diff --git a/audio/control.h b/profiles/audio/control.h
similarity index 100%
rename from audio/control.h
rename to profiles/audio/control.h
diff --git a/audio/device.c b/profiles/audio/device.c
similarity index 100%
rename from audio/device.c
rename to profiles/audio/device.c
diff --git a/audio/device.h b/profiles/audio/device.h
similarity index 100%
rename from audio/device.h
rename to profiles/audio/device.h
diff --git a/audio/gateway.c b/profiles/audio/gateway.c
similarity index 100%
rename from audio/gateway.c
rename to profiles/audio/gateway.c
diff --git a/audio/gateway.h b/profiles/audio/gateway.h
similarity index 100%
rename from audio/gateway.h
rename to profiles/audio/gateway.h
diff --git a/audio/headset.c b/profiles/audio/headset.c
similarity index 100%
rename from audio/headset.c
rename to profiles/audio/headset.c
diff --git a/audio/headset.h b/profiles/audio/headset.h
similarity index 100%
rename from audio/headset.h
rename to profiles/audio/headset.h
diff --git a/audio/main.c b/profiles/audio/main.c
similarity index 100%
rename from audio/main.c
rename to profiles/audio/main.c
diff --git a/audio/manager.c b/profiles/audio/manager.c
similarity index 100%
rename from audio/manager.c
rename to profiles/audio/manager.c
diff --git a/audio/manager.h b/profiles/audio/manager.h
similarity index 100%
rename from audio/manager.h
rename to profiles/audio/manager.h
diff --git a/audio/media.c b/profiles/audio/media.c
similarity index 100%
rename from audio/media.c
rename to profiles/audio/media.c
diff --git a/audio/media.h b/profiles/audio/media.h
similarity index 100%
rename from audio/media.h
rename to profiles/audio/media.h
diff --git a/audio/player.c b/profiles/audio/player.c
similarity index 100%
rename from audio/player.c
rename to profiles/audio/player.c
diff --git a/audio/player.h b/profiles/audio/player.h
similarity index 100%
rename from audio/player.h
rename to profiles/audio/player.h
diff --git a/audio/rtp.h b/profiles/audio/rtp.h
similarity index 100%
rename from audio/rtp.h
rename to profiles/audio/rtp.h
diff --git a/audio/sink.c b/profiles/audio/sink.c
similarity index 100%
rename from audio/sink.c
rename to profiles/audio/sink.c
diff --git a/audio/sink.h b/profiles/audio/sink.h
similarity index 100%
rename from audio/sink.h
rename to profiles/audio/sink.h
diff --git a/audio/source.c b/profiles/audio/source.c
similarity index 100%
rename from audio/source.c
rename to profiles/audio/source.c
diff --git a/audio/source.h b/profiles/audio/source.h
similarity index 100%
rename from audio/source.h
rename to profiles/audio/source.h
diff --git a/audio/telephony-dummy.c b/profiles/audio/telephony-dummy.c
similarity index 100%
rename from audio/telephony-dummy.c
rename to profiles/audio/telephony-dummy.c
diff --git a/audio/telephony-maemo5.c b/profiles/audio/telephony-maemo5.c
similarity index 100%
rename from audio/telephony-maemo5.c
rename to profiles/audio/telephony-maemo5.c
diff --git a/audio/telephony-maemo6.c b/profiles/audio/telephony-maemo6.c
similarity index 100%
rename from audio/telephony-maemo6.c
rename to profiles/audio/telephony-maemo6.c
diff --git a/audio/telephony-ofono.c b/profiles/audio/telephony-ofono.c
similarity index 100%
rename from audio/telephony-ofono.c
rename to profiles/audio/telephony-ofono.c
diff --git a/audio/telephony.h b/profiles/audio/telephony.h
similarity index 100%
rename from audio/telephony.h
rename to profiles/audio/telephony.h
diff --git a/audio/transport.c b/profiles/audio/transport.c
similarity index 100%
rename from audio/transport.c
rename to profiles/audio/transport.c
diff --git a/audio/transport.h b/profiles/audio/transport.h
similarity index 100%
rename from audio/transport.h
rename to profiles/audio/transport.h
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH] Bluetooth: Fix memory leak when removing a UUID
From: Gustavo Padovan @ 2012-11-09 9:46 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
In-Reply-To: <1352366726-4308-1-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
* Johan Hedberg <johan.hedberg@gmail.com> [2012-11-08 10:25:26 +0100]:
> From: Johan Hedberg <johan.hedberg@intel.com>
>
> When removing a UUID from the list in the remove_uuid() function we must
> also kfree the entry in addition to removing it from the list.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/mgmt.c | 1 +
> 1 file changed, 1 insertion(+)
Patch has been applied to bluetooth.git. Thanks.
Gustavo
^ permalink raw reply
* Re: [PATCH] bluetooth: ath3k: Add support for VAIO VPCEH [0489:e027]
From: Gustavo Padovan @ 2012-11-09 9:43 UTC (permalink / raw)
To: Marcos Chaparro; +Cc: marcel, johan.hedberg, linux-bluetooth, linux-kernel
In-Reply-To: <1352229551-22842-1-git-send-email-marcos@mrkindustries.com.ar>
Hi Marcos,
* Marcos Chaparro <marcos@mrkindustries.com.ar> [2012-11-06 16:19:11 -0300]:
> Added Atheros AR3011 internal bluetooth device found in Sony VAIO VPCEH to the
> devices list.
> Before this, the bluetooth module was identified as an Foxconn / Hai bluetooth
> device [0489:e027], now it claims to be an AtherosAR3011 Bluetooth
> [0cf3:3005].
>
> T: Bus=01 Lev=02 Prnt=02 Port=04 Cnt=02 Dev#= 4 Spd=12 MxCh= 0
> D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
> P: Vendor=0489 ProdID=e027 Rev= 0.01
> C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
> I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
> E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
> E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
> I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
> I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
> I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
> I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
> I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
> I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
>
> Signed-off-by: Marcos Chaparro <marcos@mrkindustries.com.ar>
> ---
> drivers/bluetooth/ath3k.c | 1 +
> drivers/bluetooth/btusb.c | 1 +
> 2 files changed, 2 insertions(+)
Patch has been applied to bluetooth.git. Thanks.
Gustavo
^ 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