* Re: use of hci_recv_fragment in HCI UART transport driver
From: Marcel Holtmann @ 2010-05-21 7:33 UTC (permalink / raw)
To: suraj; +Cc: linux-bluetooth, Luis.Rodriguez, Jothikumar.Mothilal
In-Reply-To: <1274416666.28388.29.camel@atheros013-desktop>
Hi Suraj,
> The function "hci_recv_fragment()" was designed to avoid messy Bluetooth Rx packet reassembly on the HCI transport driver.
> It does work well for HCI USB transport driver but it becomes a bit redundant when used on HCI UART transport driver.
>
> This is basically due to the fact that the function require the caller to provide the HCI Packet type as input parameter.
>
> This is pretty straight forward for a BT USB transport driver as both ACL data and HCI events are received through different callbacks.
> Which means you will have 2 calls of hci_recv_fragment(). One with HCI_EVENT_PKT as packet type and other with HCI_ACLDATA_PKT, with packet type hard coded.
>
> As far as HCI UART transport driver is concerned, it does not have this luxury. Both event and data are received through the same callback.
> So, if the driver has to provide the packet type as input to hci_recv_fragment(), it will have to parse the HCI Rx data to get it in the first place.
>
> This means driver will have to do everything hci_recv_fragment() does minus the memcpy, implementing the same messy code.
>
> I know that we should be able to work around it by checking whether which reassembly buffer is not null and so on. But this is just a hack not a solution.
I remember why I added the packet type to the function. The reason is
that events and ACL packets arrive on different USB endpoints and in
theory they can arrive at exactly the same time or intermix with each
other. So that needs to be protected.
So I think we need something like hci_recv_packet_fragment and
hci_recv_stream_fragment.
This would result at least in that we can consolidate all this code
duplication in the Bluetooth core.
> The second reason is, hci_recv_fragment() implements a certain policy on the driver i.e
>
> " Whenever HCI Rx data is reassembled it directly has to be sent to host, without the driver interfering".
>
> This robs the driver a chance have a look at the HCI event and do some housekeeping (it is entirely up to the driver what he wants to do then).
>
> This is the one reason why someone would write a custom HCI transport driver protocol.
> Other ways he could have used the standard H4 implementation if he just wanted to transfer packets to and from Host.
This is actually fully on purpose. A driver should not interfere with
HCI event or commands for that matter at all. It should be just a pure
transport.
If we need to hook something into vendor command/event handling then we
should find a different way in doing this. The major job of a HCI driver
is to be a pure, simple and stupid transport driver.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH v3] hciattach application support for Atheros AR300x Bluetooth Chip
From: Marcel Holtmann @ 2010-05-21 7:34 UTC (permalink / raw)
To: Suraj Sumangala
Cc: Suraj Sumangala, linux-bluetooth@vger.kernel.org, Luis Rodriguez,
Jothikumar Mothilal
In-Reply-To: <4BF613AF.2080303@atheros.com>
Hi Suraj,
> >> Implements support for Atheros AR300x Bluetooth chip in hciattach.
> >> Adds feature to bring up AR300x Bluetooth chip
> >> with and without enhanced power management enabled.
> >>
> >> Signed-off-by: Suraj <suraj@Atheros.com>
> >
> > not SOBs for BlueZ userspace. That is kernel only.
> >
> >> ---
> >> Makefile.tools | 1 +
> >> tools/hciattach.8 | 6 +
> >> tools/hciattach.c | 111 +++++
> >> tools/hciattach.h | 3 +
> >> tools/hciattach_ar3k.c | 1223 ++++++++++++++++++++++++++++++++++++++++++++++++
> >> 5 files changed, 1344 insertions(+), 0 deletions(-)
> >> create mode 100755 tools/hciattach_ar3k.c
> >
> > While hciattach is kinda the bad sheep inside BlueZ, I will enforce the
> > general coding style for it for all new contributions. So could you
> > please fix that one first. Otherwise it makes no sense for me to go
> > through such a big patch if I have to complain about the coding style
> > breakage for every second line. A general rule is if it fails
> > check-patch.pl from the kernel, then you are doing something wrong.
>
> I had verified this patch using checkpatch and it did not complain. I
> had also verified it manually according to the comments others have
> given previously for different patches.
>
> If you still see issues, then we can add that check too to checkpatch if
> possible.
then maybe checkpatch.pl is not good enough for this. I see way too many
empty lines, weird if breakages, and many more. So as I said, this needs
cleanup first.
Regards
Marcel
^ permalink raw reply
* Re: use of hci_recv_fragment in HCI UART transport driver
From: Suraj Sumangala @ 2010-05-21 8:16 UTC (permalink / raw)
To: Marcel Holtmann
Cc: Suraj Sumangala, linux-bluetooth@vger.kernel.org, Luis Rodriguez,
Jothikumar Mothilal
In-Reply-To: <1274427182.27220.29.camel@localhost.localdomain>
Hi Marcel,
On 5/21/2010 1:03 PM, Marcel Holtmann wrote:
> Hi Suraj,
>
>> The function "hci_recv_fragment()" was designed to avoid messy Bluetooth Rx packet reassembly on the HCI transport driver.
>> It does work well for HCI USB transport driver but it becomes a bit redundant when used on HCI UART transport driver.
>>
>> This is basically due to the fact that the function require the caller to provide the HCI Packet type as input parameter.
>>
>> This is pretty straight forward for a BT USB transport driver as both ACL data and HCI events are received through different callbacks.
>> Which means you will have 2 calls of hci_recv_fragment(). One with HCI_EVENT_PKT as packet type and other with HCI_ACLDATA_PKT, with packet type hard coded.
>>
>> As far as HCI UART transport driver is concerned, it does not have this luxury. Both event and data are received through the same callback.
>> So, if the driver has to provide the packet type as input to hci_recv_fragment(), it will have to parse the HCI Rx data to get it in the first place.
>>
>> This means driver will have to do everything hci_recv_fragment() does minus the memcpy, implementing the same messy code.
>>
>> I know that we should be able to work around it by checking whether which reassembly buffer is not null and so on. But this is just a hack not a solution.
>
> I remember why I added the packet type to the function. The reason is
> that events and ACL packets arrive on different USB endpoints and in
> theory they can arrive at exactly the same time or intermix with each
> other. So that needs to be protected.
>
> So I think we need something like hci_recv_packet_fragment and
> hci_recv_stream_fragment.
>
> This would result at least in that we can consolidate all this code
> duplication in the Bluetooth core.
Yes, that would be great. Do you want me to wait for this implementation
before resubmitting the patch?
>
>> The second reason is, hci_recv_fragment() implements a certain policy on the driver i.e
>>
>> " Whenever HCI Rx data is reassembled it directly has to be sent to host, without the driver interfering".
>>
>> This robs the driver a chance have a look at the HCI event and do some housekeeping (it is entirely up to the driver what he wants to do then).
>>
>> This is the one reason why someone would write a custom HCI transport driver protocol.
>> Other ways he could have used the standard H4 implementation if he just wanted to transfer packets to and from Host.
>
> This is actually fully on purpose. A driver should not interfere with
> HCI event or commands for that matter at all. It should be just a pure
> transport.
>
> If we need to hook something into vendor command/event handling then we
> should find a different way in doing this. The major job of a HCI driver
> is to be a pure, simple and stupid transport driver.
It will be great if we can have some mechanism to let the driver keep
track of specific commands/Events.
Until then, there is no other option.
>
> Regards
>
> Marcel
>
>
Regards
Suraj
^ permalink raw reply
* Re: use of hci_recv_fragment in HCI UART transport driver
From: Marcel Holtmann @ 2010-05-21 8:34 UTC (permalink / raw)
To: Suraj Sumangala
Cc: Suraj Sumangala, linux-bluetooth@vger.kernel.org, Luis Rodriguez,
Jothikumar Mothilal
In-Reply-To: <4BF6416F.6000503@Atheros.com>
Hi Suraj,
> >> The function "hci_recv_fragment()" was designed to avoid messy Bluetooth Rx packet reassembly on the HCI transport driver.
> >> It does work well for HCI USB transport driver but it becomes a bit redundant when used on HCI UART transport driver.
> >>
> >> This is basically due to the fact that the function require the caller to provide the HCI Packet type as input parameter.
> >>
> >> This is pretty straight forward for a BT USB transport driver as both ACL data and HCI events are received through different callbacks.
> >> Which means you will have 2 calls of hci_recv_fragment(). One with HCI_EVENT_PKT as packet type and other with HCI_ACLDATA_PKT, with packet type hard coded.
> >>
> >> As far as HCI UART transport driver is concerned, it does not have this luxury. Both event and data are received through the same callback.
> >> So, if the driver has to provide the packet type as input to hci_recv_fragment(), it will have to parse the HCI Rx data to get it in the first place.
> >>
> >> This means driver will have to do everything hci_recv_fragment() does minus the memcpy, implementing the same messy code.
> >>
> >> I know that we should be able to work around it by checking whether which reassembly buffer is not null and so on. But this is just a hack not a solution.
> >
> > I remember why I added the packet type to the function. The reason is
> > that events and ACL packets arrive on different USB endpoints and in
> > theory they can arrive at exactly the same time or intermix with each
> > other. So that needs to be protected.
> >
> > So I think we need something like hci_recv_packet_fragment and
> > hci_recv_stream_fragment.
> >
> > This would result at least in that we can consolidate all this code
> > duplication in the Bluetooth core.
>
> Yes, that would be great. Do you want me to wait for this implementation
> before resubmitting the patch?
I actually expect you to work on such a patch that add this to the core
first. Then you can submit your patch.
> >> The second reason is, hci_recv_fragment() implements a certain policy on the driver i.e
> >>
> >> " Whenever HCI Rx data is reassembled it directly has to be sent to host, without the driver interfering".
> >>
> >> This robs the driver a chance have a look at the HCI event and do some housekeeping (it is entirely up to the driver what he wants to do then).
> >>
> >> This is the one reason why someone would write a custom HCI transport driver protocol.
> >> Other ways he could have used the standard H4 implementation if he just wanted to transfer packets to and from Host.
> >
> > This is actually fully on purpose. A driver should not interfere with
> > HCI event or commands for that matter at all. It should be just a pure
> > transport.
> >
> > If we need to hook something into vendor command/event handling then we
> > should find a different way in doing this. The major job of a HCI driver
> > is to be a pure, simple and stupid transport driver.
>
> It will be great if we can have some mechanism to let the driver keep
> track of specific commands/Events.
> Until then, there is no other option.
Please come up with a proposal for this. It might be useful for other
drivers as well.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 1/4] Add manual log to hcitrace
From: Marcel Holtmann @ 2010-05-21 8:46 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1274149638-31580-1-git-send-email-gustavo@padovan.org>
Hi Gustavo,
> Remove the BlueZ log scheme from hcitrace to avoid intersection with the
> new BlueZ dynamic debug.
patch has been applied. Thanks.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 2/4] Add dynamic debug feature
From: Marcel Holtmann @ 2010-05-21 8:46 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1274149638-31580-2-git-send-email-gustavo@padovan.org>
Hi Gustavo,
> It is still needed a sed work in the sources to changes debug() to DBG()
>
> Thanks, to Vinicius Gomes that helped me sort out a linking issue with
> this patch.
patch has been applied. Thanks.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 3/4] Move debug() to DBG()
From: Marcel Holtmann @ 2010-05-21 8:49 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1274149638-31580-3-git-send-email-gustavo@padovan.org>
Hi Gustavo,
> Use the new dynamic debug feature
I need an updated version of this patch. This one doesn't apply cleanly
with git am anymore.
Regards
Marcel
^ permalink raw reply
* Re: use of hci_recv_fragment in HCI UART transport driver
From: Suraj Sumangala @ 2010-05-21 8:49 UTC (permalink / raw)
To: Marcel Holtmann
Cc: Suraj Sumangala, linux-bluetooth@vger.kernel.org, Luis Rodriguez,
Jothikumar Mothilal
In-Reply-To: <1274430844.27220.33.camel@localhost.localdomain>
Hi Marcel,
On 5/21/2010 2:04 PM, Marcel Holtmann wrote:
> Hi Suraj,
>
>>>> The function "hci_recv_fragment()" was designed to avoid messy Bluetooth Rx packet reassembly on the HCI transport driver.
>>>> It does work well for HCI USB transport driver but it becomes a bit redundant when used on HCI UART transport driver.
>>>>
>>>> This is basically due to the fact that the function require the caller to provide the HCI Packet type as input parameter.
>>>>
>>>> This is pretty straight forward for a BT USB transport driver as both ACL data and HCI events are received through different callbacks.
>>>> Which means you will have 2 calls of hci_recv_fragment(). One with HCI_EVENT_PKT as packet type and other with HCI_ACLDATA_PKT, with packet type hard coded.
>>>>
>>>> As far as HCI UART transport driver is concerned, it does not have this luxury. Both event and data are received through the same callback.
>>>> So, if the driver has to provide the packet type as input to hci_recv_fragment(), it will have to parse the HCI Rx data to get it in the first place.
>>>>
>>>> This means driver will have to do everything hci_recv_fragment() does minus the memcpy, implementing the same messy code.
>>>>
>>>> I know that we should be able to work around it by checking whether which reassembly buffer is not null and so on. But this is just a hack not a solution.
>>>
>>> I remember why I added the packet type to the function. The reason is
>>> that events and ACL packets arrive on different USB endpoints and in
>>> theory they can arrive at exactly the same time or intermix with each
>>> other. So that needs to be protected.
>>>
>>> So I think we need something like hci_recv_packet_fragment and
>>> hci_recv_stream_fragment.
>>>
>>> This would result at least in that we can consolidate all this code
>>> duplication in the Bluetooth core.
>>
>> Yes, that would be great. Do you want me to wait for this implementation
>> before resubmitting the patch?
>
> I actually expect you to work on such a patch that add this to the core
> first. Then you can submit your patch.
Yep,will do that.
>
>>>> The second reason is, hci_recv_fragment() implements a certain policy on the driver i.e
>>>>
>>>> " Whenever HCI Rx data is reassembled it directly has to be sent to host, without the driver interfering".
>>>>
>>>> This robs the driver a chance have a look at the HCI event and do some housekeeping (it is entirely up to the driver what he wants to do then).
>>>>
>>>> This is the one reason why someone would write a custom HCI transport driver protocol.
>>>> Other ways he could have used the standard H4 implementation if he just wanted to transfer packets to and from Host.
>>>
>>> This is actually fully on purpose. A driver should not interfere with
>>> HCI event or commands for that matter at all. It should be just a pure
>>> transport.
>>>
>>> If we need to hook something into vendor command/event handling then we
>>> should find a different way in doing this. The major job of a HCI driver
>>> is to be a pure, simple and stupid transport driver.
>>
>> It will be great if we can have some mechanism to let the driver keep
>> track of specific commands/Events.
>> Until then, there is no other option.
>
> Please come up with a proposal for this. It might be useful for other
> drivers as well.
Sure, thanks.
>
> Regards
>
> Marcel
>
>
Regards
Suraj
^ permalink raw reply
* Re: [PATCH 4/4] Move logging.{c,h} to log.{c,h}
From: Marcel Holtmann @ 2010-05-21 8:49 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1274149638-31580-4-git-send-email-gustavo@padovan.org>
Hi Gustavo,
> Try to make log stuff more similar to ConnMan and oFono.
please also send and updated version for this one.
Regards
Marcel
^ permalink raw reply
* WRT non-UTF-8 device names
From: Fabian Greffrath @ 2010-05-21 9:01 UTC (permalink / raw)
To: linux-bluetooth@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 2456 bytes --]
Dear Bluez list,
I am experiencing the following issues with the bluez 4.63-2 and
gnome-bluetooth 2.30.0-1 packages from Debian unstable:
Please find two text files attached. UTF-8.txt contains the string
"föøbär" in UTF-8 Unicode encoding, whereas non-UTF-8.txt contains the
same string in ISO-8859 encoding. Now please try the following steps,
assuming your bluetooth device identifies as hci0 and you have
bluetooth-applet running (please note that "no bluetooth icon in the
system" tray also means "it is impossible to establish a connection to
or from this device at all"):
$ sudo hciconfig hci0 name `cat UTF-8.txt`
$ sudo hciconfig -a
[...]
Name: 'föøbär'
$ sudo /etc/init.d/bluetooth restart
Stopping bluetooth: bluetoothd.
Starting bluetooth: bluetoothd.
[Not necessary here, everything is fine.]
$ sudo hciconfig hci0 name `cat non-UTF-8.txt`
[The bluetooth system tray icon disappears immediately.]
$ sudo hciconfig -a
[...]
Name: 'f��b�r'
[The device name contains non-UTF-8 characters against the spec.]
$ sudo /etc/init.d/bluetooth restart
Stopping bluetooth: bluetoothd.
Starting bluetooth: bluetoothd.
[Doesn't bring the icon back.]
$ sudo hciconfig hci0 name `cat UTF-8.txt`
$ sudo hciconfig -a
[...]
Name: 'föøbär'
[Now the name is back to the valid variant, but still no icon.]
$ sudo /etc/init.d/bluetooth restart
Stopping bluetooth: bluetoothd.
Starting bluetooth: bluetoothd.
[Finally the icon is back.]
Long story short: If the bluetooth adapter's device name contains
non-UTF-8 characters (which my dongle does by default), it requires a
manual device name change and a restart of the daemon (!) to bring the
device back to life. I have previously posted a patch to this list which
fixes this issue by instantly converting faulty device names to UTF-8
and writing them back to the device during the device configuration
phase:
<http://marc.info/?l=linux-bluetooth&m=127315737929319&w=2>
However, I have been told that my "patch might be just working around
the real issue instead of fixing it" and that "It sounds like there's
something else wrong in the initialization process which makes the
initialzation fail if the adapter contains some invalid default name".
So, please, try the steps I presented above yourself and tell me what is
wrong so I can attempt to fix the root of the problem. I am really
itching to get this issue fixed in the short term.
Thank you very much!
Cheers,
Fabian
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: non-UTF-8.txt --]
[-- Type: text/plain; name="non-UTF-8.txt"; charset="UTF-8", Size: 7 bytes --]
föøbär
[-- Attachment #3: UTF-8.txt --]
[-- Type: text/plain, Size: 10 bytes --]
föøbär
^ permalink raw reply
* [PATCHv2 1/2] Bluetooth: Check sk is not owned before freeing l2cap_conn
From: Emeltchenko Andrei @ 2010-05-21 10:04 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Check that socket sk is not locked in user process before removing
l2cap connection handler.
krfcommd kernel thread may be preempted with l2cap tasklet which remove
l2cap_conn structure. If krfcommd is in process of sending of RFCOMM reply
(like "RFCOMM UA" reply to "RFCOMM DISC") then kernel crash happens.
...
[ 694.175933] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 694.184936] pgd = c0004000
[ 694.187683] [00000000] *pgd=00000000
[ 694.191711] Internal error: Oops: 5 [#1] PREEMPT
[ 694.196350] last sysfs file: /sys/devices/platform/hci_h4p/firmware/hci_h4p/loading
[ 694.260375] CPU: 0 Not tainted (2.6.32.10 #1)
[ 694.265106] PC is at l2cap_sock_sendmsg+0x43c/0x73c [l2cap]
[ 694.270721] LR is at 0xd7017303
...
[ 694.525085] Backtrace:
[ 694.527587] [<bf266be0>] (l2cap_sock_sendmsg+0x0/0x73c [l2cap]) from [<c02f2cc8>] (sock_sendmsg+0xb8/0xd8)
[ 694.537292] [<c02f2c10>] (sock_sendmsg+0x0/0xd8) from [<c02f3044>] (kernel_sendmsg+0x48/0x80)
...
Modified version after comments of Gustavo F. Padovan <gustavo@padovan.org>
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
---
net/bluetooth/l2cap.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index bb00015..11060d6 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -2927,6 +2927,13 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd
break;
default:
+ /* don't delete l2cap channel if sk is owned by user */
+ if (sock_owned_by_user(sk)) {
+ sk->sk_state = BT_DISCONN;
+ l2cap_sock_clear_timer(sk);
+ l2cap_sock_set_timer(sk, HZ);
+ break;
+ }
l2cap_chan_del(sk, ECONNREFUSED);
break;
}
@@ -3135,6 +3142,15 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn, struct l2cap_cmd
del_timer(&l2cap_pi(sk)->ack_timer);
}
+ /* don't delete l2cap channel if sk is owned by user */
+ if (sock_owned_by_user(sk)) {
+ sk->sk_state = BT_DISCONN;
+ l2cap_sock_clear_timer(sk);
+ l2cap_sock_set_timer(sk, HZ);
+ bh_unlock_sock(sk);
+ return 0;
+ }
+
l2cap_chan_del(sk, ECONNRESET);
bh_unlock_sock(sk);
@@ -3167,6 +3183,15 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, struct l2cap_cmd
del_timer(&l2cap_pi(sk)->ack_timer);
}
+ /* don't delete l2cap channel if sk is owned by user */
+ if (sock_owned_by_user(sk)) {
+ sk->sk_state = BT_DISCONN;
+ l2cap_sock_clear_timer(sk);
+ l2cap_sock_set_timer(sk, HZ);
+ bh_unlock_sock(sk);
+ return 0;
+ }
+
l2cap_chan_del(sk, 0);
bh_unlock_sock(sk);
--
1.7.0.4
^ permalink raw reply related
* [PATCHv2 2/2] Bluetooth: timer check sk is not owned before freeing
From: Emeltchenko Andrei @ 2010-05-21 10:04 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1274436293-15063-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
In timer context we might delete l2cap channel used by krfcommd.
The check makes sure that sk is not owned.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
---
net/bluetooth/l2cap.c | 32 ++++++++++++++++++++------------
1 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 11060d6..1a6c5bb 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -84,6 +84,18 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn,
u8 code, u8 ident, u16 dlen, void *data);
/* ---- L2CAP timers ---- */
+static void l2cap_sock_set_timer(struct sock *sk, long timeout)
+{
+ BT_DBG("sk %p state %d timeout %ld", sk, sk->sk_state, timeout);
+ sk_reset_timer(sk, &sk->sk_timer, jiffies + timeout);
+}
+
+static void l2cap_sock_clear_timer(struct sock *sk)
+{
+ BT_DBG("sock %p state %d", sk, sk->sk_state);
+ sk_stop_timer(sk, &sk->sk_timer);
+}
+
static void l2cap_sock_timeout(unsigned long arg)
{
struct sock *sk = (struct sock *) arg;
@@ -93,6 +105,14 @@ static void l2cap_sock_timeout(unsigned long arg)
bh_lock_sock(sk);
+ if (sock_owned_by_user(sk)) {
+ /* sk is owned by user. Try again later */
+ l2cap_sock_set_timer(sk, HZ * 2);
+ bh_unlock_sock(sk);
+ sock_put(sk);
+ return;
+ }
+
if (sk->sk_state == BT_CONNECTED || sk->sk_state == BT_CONFIG)
reason = ECONNREFUSED;
else if (sk->sk_state == BT_CONNECT &&
@@ -109,18 +129,6 @@ static void l2cap_sock_timeout(unsigned long arg)
sock_put(sk);
}
-static void l2cap_sock_set_timer(struct sock *sk, long timeout)
-{
- BT_DBG("sk %p state %d timeout %ld", sk, sk->sk_state, timeout);
- sk_reset_timer(sk, &sk->sk_timer, jiffies + timeout);
-}
-
-static void l2cap_sock_clear_timer(struct sock *sk)
-{
- BT_DBG("sock %p state %d", sk, sk->sk_state);
- sk_stop_timer(sk, &sk->sk_timer);
-}
-
/* ---- L2CAP channels ---- */
static struct sock *__l2cap_get_chan_by_dcid(struct l2cap_chan_list *l, u16 cid)
{
--
1.7.0.4
^ permalink raw reply related
* RE: How to use a2dp avrcp controls
From: John Frankish @ 2010-05-21 11:16 UTC (permalink / raw)
To: linux-bluetooth@vger.kernel.org
In-Reply-To: <6AC5A55546F64545AE996F8200E3AC4E0332AC0248@NL0105EXC01V01.eur.slb.com>
> > > -----Original Message-----
> > > From: John Frankish
> > > Sent: Thursday, 06 May, 2010 12:48
> > > To: 'linux-bluetooth-owner@vger.kernel.org'
> > > Subject: RE: How to use a2dp avrcp controls
> > >
> > > > >
> > > > > Although I can pair with and play music to a set of a2dp
> > > > > headphones without problems, I cannot figure out how to enable the "track skip"
> > > > > and similar remote controls on the headphones.
<snip>
> > > 1. compiling bluez-4.63 did not install /usr/local/etc/bluetooth/audio.conf
> > > - is this depreciated or is it required to get a2dp/avrcp working?
In my testing audio.conf is apparently not required.
Since I found the solution to my problem outside of "bluez space", it is not strictly relevant to this list, but I'm posting it here in case others find it of help.
After using "blueman" to pair with my Bluetooth headphones, setting them as trusted and setting them up as an a2dp sink, dmesg shows the following:
input: 00:1B:66:00:31:88 as /devices/virtual/input/input11
and..
$ sudo evtest /dev/input/event11
Input driver version is 1.0.0
Input device ID: bus 0x5 vendor 0x0 product 0x0 version 0x0
Input device name: "00:1B:66:00:31:88"
Supported events:
Event type 0 (Sync)
Event type 1 (Key)
Event code 163 (NextSong)
Event code 165 (PreviousSong)
Event code 166 (StopCD)
Event code 168 (Rewind)
Event code 200 (PlayCD)
Event code 201 (PauseCD)
Event code 208 (Fast Forward)
Event type 2 (Relative)
Event type 20 (Repeat)
Testing ... (interrupt to exit)
Event: time 1274200254.037702, type 1 (Key), code 163 (NextSong), value 1
Event: time 1274200254.037709, -------------- Report Sync ------------
Event: time 1274200254.092604, type 1 (Key), code 163 (NextSong), value 0
Event: time 1274200254.092608, -------------- Report Sync
But..
$ xev | sed -n 's/^.*keycode *\([0-9]\+\).*$/keycode \1 = /p' | uniq
...
keycode 144 =
So, using xev to make up an .Xmodmap that looks like this:
keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
keycode 164 = XF86AudioStop
keycode 168 = XF86AudioPlay
i.e. completely different to that reported by evtest...
and using xset to stop the AVRCP key press repeating at warp speed:
xset -r 144 -r 153 -r 164 -r 168
then the sequence is:
AVRCP signal -> bluetoothd -> uinput -> X -> Xmodmap -> rhythmbox
..and rhythmbox responds correctly to play, stop, next track and previous track when pressed on the remote Bluetooth headphones controls :)
^ permalink raw reply
* Re: [PATCH] Fix device_match_pattern function
From: Santiago Carot-Nemesio @ 2010-05-21 12:17 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: Santiago Carot-Nemesio, linux-bluetooth
In-Reply-To: <1274364281.2018.44.camel@mosquito>
Hi Luiz,
I would like to take up again this matter to discuss some estrange
behaviour that we observed when a driver is probed.
> At current moment only the
> first one is being provided when driver is probed.
Well, the comment in update_service function is clear when Service Class
Id list is checked:
/* Extract the first element and skip the remainning */
I guess that only the first entry is valid to you to get the profile and
add it to the profile list. We don't know very well why this decision
was taken. It will very helpul for us if you can provide a brief
explanation about that. Wouldn't a driver want to know if there are more
entries in that Service Class ID List when it is probed?. For example a
driver registering for two uuids and those uuids are present in the same
Service Class ID List. Please notice that it is may happen in HDP. In
this scenario only the first entry will appear in the profile list and
then one uuid is passed to the driver when it is probed, well this is
not true at all, see below for some abnormal behaviour with repeated
uuids in the list that is provided to the driver.
Let's suppose an SDP record like this:
*Service Class ID List
MDPSink
MDPSource
....aditional info not relevant for this example....
In that scenario, a driver is registered for next uuids:
00001400-0000-1000-8000-00805F9B34FB -> MDP (Health device profile)
00001401-0000-1000-8000-00805F9B34FB -> MDPSource
00001402-0000-1000-8000-00805F9B34FB -> MDPSink
which is perfectly valid for a HDP driver due that no extra logic is
required to manage both roles.
In current Bluez implementation only profile MDPSink is taken in count
due that it appear first in the service class ID list. In addition it
will have affect to the uuids list provided when driver is probed wich
will have repeated uuids due to an issue matching the uuid with the
profiles list: device_match_driver function.
First time that device_match_pattern is executed with uuid
00001400-0000-1000-8000-00805F9B34FB it will provide a list with the
uuid 00001402-0000-1000-8000-00805F9B34FB wich is in the profile list
(MDPSink) and that uuid will be inserted to the uuid list.
Next iteration it will check next uuid provided in the driver:
00001401-0000-1000-8000-00805F9B34FB and device_match_pattern will
return another time a list with 00001402-0000-1000-8000-00805F9B34FB
uuid wich will be inserted another time in the for loop. Please, notice
that now we have the same uuid inserted two times in the uuid list.
Next it will check last uuid provided in the driver:
00001402-0000-1000-8000-00805F9B34FB and skip it because it is already
inserted from before iteration.
You can review the code to check it.
Of course we always can get the necessary entries from the remote SDP
record, but at least the repeated uuids can be avoided by setting a
check before to insert anything in the uuid list that it will provided
when the driver is probed:
/* match pattern driver */
match = device_match_pattern(device, *uuid, profiles);
for (; match; match = match->next) {
+ if (!g_slist_find_custom(uuids, match->data,
+ (GCompareFunc) strcasecmp)) {
uuids = g_slist_append(uuids, match->data);
+ }
}
If you want we can prepare a patch.
Comments from you are welcome.
Thanks in advance.
Best regards.
^ permalink raw reply
* [PATCH 2/3] Move logging.{c,h} to log.{c,h}
From: Gustavo F. Padovan @ 2010-05-21 12:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: gustavo
In-Reply-To: <1274444776-14284-1-git-send-email-gustavo@padovan.org>
Try to make log stuff more similar to ConnMan and oFono.
---
Makefile.am | 2 +-
audio/a2dp.c | 2 +-
audio/avdtp.c | 2 +-
audio/control.c | 2 +-
audio/device.c | 2 +-
audio/gateway.c | 2 +-
audio/headset.c | 2 +-
audio/main.c | 2 +-
audio/manager.c | 2 +-
audio/sink.c | 2 +-
audio/source.c | 2 +-
audio/telephony-dummy.c | 2 +-
audio/telephony-maemo5.c | 2 +-
audio/telephony-maemo6.c | 2 +-
audio/telephony-ofono.c | 2 +-
audio/unix.c | 2 +-
input/device.c | 2 +-
input/fakehid.c | 2 +-
input/main.c | 2 +-
input/manager.c | 2 +-
input/server.c | 2 +-
network/bridge.c | 2 +-
network/common.c | 2 +-
network/connection.c | 2 +-
network/manager.c | 2 +-
network/server.c | 2 +-
plugins/echo.c | 2 +-
plugins/hal.c | 2 +-
plugins/hciops.c | 2 +-
plugins/netlink.c | 2 +-
plugins/pnat.c | 2 +-
plugins/service.c | 2 +-
plugins/storage.c | 2 +-
serial/manager.c | 2 +-
serial/port.c | 2 +-
serial/proxy.c | 2 +-
src/adapter.c | 2 +-
src/agent.c | 2 +-
src/dbus-common.c | 2 +-
src/dbus-hci.c | 2 +-
src/device.c | 2 +-
src/log.c | 133 ++++++++++++++++++++++++++++++++++++++++++++++
src/log.h | 60 +++++++++++++++++++++
src/logging.c | 133 ----------------------------------------------
src/logging.h | 60 ---------------------
src/main.c | 2 +-
src/manager.c | 2 +-
src/plugin.c | 2 +-
src/rfkill.c | 2 +-
src/sdpd-database.c | 2 +-
src/sdpd-request.c | 2 +-
src/sdpd-server.c | 2 +-
src/sdpd-service.c | 2 +-
src/security.c | 2 +-
54 files changed, 243 insertions(+), 243 deletions(-)
create mode 100644 src/log.c
create mode 100644 src/log.h
delete mode 100644 src/logging.c
delete mode 100644 src/logging.h
diff --git a/Makefile.am b/Makefile.am
index 93b499a..bb27a17 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -180,7 +180,7 @@ builtin_sources += plugins/storage.c
sbin_PROGRAMS += src/bluetoothd
src_bluetoothd_SOURCES = $(gdbus_sources) $(builtin_sources) \
- src/main.c src/logging.h src/logging.c \
+ src/main.c src/log.h src/log.c \
src/security.c src/rfkill.c src/hcid.h src/sdpd.h \
src/sdpd-server.c src/sdpd-request.c \
src/sdpd-service.c src/sdpd-database.c \
diff --git a/audio/a2dp.c b/audio/a2dp.c
index fd12fbe..6221c14 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -36,7 +36,7 @@
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
-#include "logging.h"
+#include "log.h"
#include "device.h"
#include "manager.h"
#include "avdtp.h"
diff --git a/audio/avdtp.c b/audio/avdtp.c
index 19a15a4..540bdf3 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -42,7 +42,7 @@
#include <glib.h>
#include <dbus/dbus.h>
-#include "logging.h"
+#include "log.h"
#include "../src/manager.h"
#include "../src/adapter.h"
diff --git a/audio/control.c b/audio/control.c
index da2bb5f..c8aba53 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -46,7 +46,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "error.h"
#include "uinput.h"
#include "adapter.h"
diff --git a/audio/device.c b/audio/device.c
index fceb7a1..b59be6a 100644
--- a/audio/device.c
+++ b/audio/device.c
@@ -43,7 +43,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "textfile.h"
#include "../src/adapter.h"
#include "../src/device.h"
diff --git a/audio/gateway.c b/audio/gateway.c
index 62b3f60..dfe7145 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -48,7 +48,7 @@
#include "glib-helper.h"
#include "device.h"
#include "gateway.h"
-#include "logging.h"
+#include "log.h"
#include "error.h"
#include "btio.h"
#include "dbus-common.h"
diff --git a/audio/headset.c b/audio/headset.c
index 7bcaa96..9a5d767 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -51,7 +51,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "device.h"
#include "manager.h"
#include "error.h"
diff --git a/audio/main.c b/audio/main.c
index 34b45a8..9d316ec 100644
--- a/audio/main.c
+++ b/audio/main.c
@@ -40,7 +40,7 @@
#include "glib-helper.h"
#include "btio.h"
#include "plugin.h"
-#include "logging.h"
+#include "log.h"
#include "device.h"
#include "unix.h"
#include "headset.h"
diff --git a/audio/manager.c b/audio/manager.c
index ec795e6..32b7d03 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -55,7 +55,7 @@
#include "../src/adapter.h"
#include "../src/device.h"
-#include "logging.h"
+#include "log.h"
#include "textfile.h"
#include "ipc.h"
#include "device.h"
diff --git a/audio/sink.c b/audio/sink.c
index 0ca0519..f4dce28 100644
--- a/audio/sink.c
+++ b/audio/sink.c
@@ -36,7 +36,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "device.h"
#include "avdtp.h"
diff --git a/audio/source.c b/audio/source.c
index ea4610f..35d8136 100644
--- a/audio/source.c
+++ b/audio/source.c
@@ -37,7 +37,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "device.h"
#include "avdtp.h"
diff --git a/audio/telephony-dummy.c b/audio/telephony-dummy.c
index f20aa79..06cb798 100644
--- a/audio/telephony-dummy.c
+++ b/audio/telephony-dummy.c
@@ -33,7 +33,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "telephony.h"
#define TELEPHONY_DUMMY_IFACE "org.bluez.TelephonyTest"
diff --git a/audio/telephony-maemo5.c b/audio/telephony-maemo5.c
index 910fa32..4d0134c 100644
--- a/audio/telephony-maemo5.c
+++ b/audio/telephony-maemo5.c
@@ -36,7 +36,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "telephony.h"
/* SSC D-Bus definitions */
diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index 14cd35d..41950be 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
@@ -36,7 +36,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "telephony.h"
/* SSC D-Bus definitions */
diff --git a/audio/telephony-ofono.c b/audio/telephony-ofono.c
index 4511ab6..e710ce8 100644
--- a/audio/telephony-ofono.c
+++ b/audio/telephony-ofono.c
@@ -35,7 +35,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "telephony.h"
enum net_registration_status {
diff --git a/audio/unix.c b/audio/unix.c
index 3fdf5c8..42c0d80 100644
--- a/audio/unix.c
+++ b/audio/unix.c
@@ -39,7 +39,7 @@
#include <dbus/dbus.h>
#include <glib.h>
-#include "logging.h"
+#include "log.h"
#include "ipc.h"
#include "device.h"
#include "manager.h"
diff --git a/input/device.c b/input/device.c
index 511ac95..8daf8b2 100644
--- a/input/device.c
+++ b/input/device.c
@@ -46,7 +46,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "textfile.h"
#include "uinput.h"
diff --git a/input/fakehid.c b/input/fakehid.c
index 69a9abb..ee1f77a 100644
--- a/input/fakehid.c
+++ b/input/fakehid.c
@@ -43,7 +43,7 @@
#include "../src/adapter.h"
#include "../src/device.h"
-#include "logging.h"
+#include "log.h"
#include "device.h"
#include "fakehid.h"
#include "uinput.h"
diff --git a/input/main.c b/input/main.c
index 7c058f2..e165ab4 100644
--- a/input/main.c
+++ b/input/main.c
@@ -32,7 +32,7 @@
#include <gdbus.h>
#include "plugin.h"
-#include "logging.h"
+#include "log.h"
#include "manager.h"
static GKeyFile *load_config_file(const char *file)
diff --git a/input/manager.c b/input/manager.c
index 30cdd3e..a98a080 100644
--- a/input/manager.c
+++ b/input/manager.c
@@ -34,7 +34,7 @@
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "../src/adapter.h"
#include "../src/device.h"
diff --git a/input/server.c b/input/server.c
index 1197379..d98018b 100644
--- a/input/server.c
+++ b/input/server.c
@@ -34,7 +34,7 @@
#include <glib.h>
#include <dbus/dbus.h>
-#include "logging.h"
+#include "log.h"
#include "glib-helper.h"
#include "btio.h"
diff --git a/network/bridge.c b/network/bridge.c
index f3528ad..9166975 100644
--- a/network/bridge.c
+++ b/network/bridge.c
@@ -38,7 +38,7 @@
#include <bluetooth/l2cap.h>
#include <bluetooth/bnep.h>
-#include "logging.h"
+#include "log.h"
#include "bridge.h"
#include "common.h"
diff --git a/network/common.c b/network/common.c
index 6340883..f5e0ee8 100644
--- a/network/common.c
+++ b/network/common.c
@@ -41,7 +41,7 @@
#include <glib.h>
-#include "logging.h"
+#include "log.h"
#include "common.h"
static int ctl;
diff --git a/network/connection.c b/network/connection.c
index 17c3396..01178d7 100644
--- a/network/connection.c
+++ b/network/connection.c
@@ -38,7 +38,7 @@
#include <glib.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "glib-helper.h"
#include "btio.h"
#include "dbus-common.h"
diff --git a/network/manager.c b/network/manager.c
index ee19c03..80a5ded 100644
--- a/network/manager.c
+++ b/network/manager.c
@@ -33,7 +33,7 @@
#include <glib.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "adapter.h"
#include "device.h"
diff --git a/network/server.c b/network/server.c
index 475f12c..a82d4ff 100644
--- a/network/server.c
+++ b/network/server.c
@@ -44,7 +44,7 @@
#include "../src/dbus-common.h"
#include "../src/adapter.h"
-#include "logging.h"
+#include "log.h"
#include "error.h"
#include "sdpd.h"
#include "btio.h"
diff --git a/plugins/echo.c b/plugins/echo.c
index d884d41..23f6e49 100644
--- a/plugins/echo.c
+++ b/plugins/echo.c
@@ -38,7 +38,7 @@
#include "plugin.h"
#include "adapter.h"
-#include "logging.h"
+#include "log.h"
static gboolean session_event(GIOChannel *chan,
GIOCondition cond, gpointer data)
diff --git a/plugins/hal.c b/plugins/hal.c
index 73355d5..f6121c5 100644
--- a/plugins/hal.c
+++ b/plugins/hal.c
@@ -34,7 +34,7 @@
#include "plugin.h"
#include "adapter.h"
-#include "logging.h"
+#include "log.h"
#include "dbus-hci.h"
static void formfactor_reply(DBusPendingCall *call, void *user_data)
diff --git a/plugins/hciops.c b/plugins/hciops.c
index 9190c80..da2e3d0 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -42,7 +42,7 @@
#include "sdpd.h"
#include "adapter.h"
#include "plugin.h"
-#include "logging.h"
+#include "log.h"
#include "manager.h"
static int child_pipe[2] = { -1, -1 };
diff --git a/plugins/netlink.c b/plugins/netlink.c
index 5b4915b..081ffa2 100644
--- a/plugins/netlink.c
+++ b/plugins/netlink.c
@@ -37,7 +37,7 @@
#include <glib.h>
#include "plugin.h"
-#include "logging.h"
+#include "log.h"
static struct nl_handle *handle;
static struct nl_cache *cache;
diff --git a/plugins/pnat.c b/plugins/pnat.c
index c50d543..f9136a4 100644
--- a/plugins/pnat.c
+++ b/plugins/pnat.c
@@ -48,7 +48,7 @@
#include "sdpd.h"
#include "btio.h"
#include "adapter.h"
-#include "logging.h"
+#include "log.h"
/* FIXME: This location should be build-time configurable */
#define PNATD "/usr/bin/phonet-at"
diff --git a/plugins/service.c b/plugins/service.c
index 182b829..96280bd 100644
--- a/plugins/service.c
+++ b/plugins/service.c
@@ -43,7 +43,7 @@
#include "plugin.h"
#include "adapter.h"
#include "error.h"
-#include "logging.h"
+#include "log.h"
#define SERVICE_INTERFACE "org.bluez.Service"
diff --git a/plugins/storage.c b/plugins/storage.c
index 6c1cd45..04a02c7 100644
--- a/plugins/storage.c
+++ b/plugins/storage.c
@@ -28,7 +28,7 @@
#include <bluetooth/bluetooth.h>
#include "plugin.h"
-#include "logging.h"
+#include "log.h"
static int storage_init(void)
{
diff --git a/serial/manager.c b/serial/manager.c
index d4ebf2e..a7deab1 100644
--- a/serial/manager.c
+++ b/serial/manager.c
@@ -55,7 +55,7 @@
#include "adapter.h"
#include "device.h"
-#include "logging.h"
+#include "log.h"
#include "textfile.h"
#include "error.h"
diff --git a/serial/port.c b/serial/port.c
index 7382cf3..48a60b4 100644
--- a/serial/port.c
+++ b/serial/port.c
@@ -47,7 +47,7 @@
#include "../src/dbus-common.h"
-#include "logging.h"
+#include "log.h"
#include "glib-helper.h"
#include "btio.h"
diff --git a/serial/proxy.c b/serial/proxy.c
index 442ce5d..80c1189 100644
--- a/serial/proxy.c
+++ b/serial/proxy.c
@@ -54,7 +54,7 @@
#include "../src/dbus-common.h"
#include "../src/adapter.h"
-#include "logging.h"
+#include "log.h"
#include "textfile.h"
#include "error.h"
diff --git a/src/adapter.c b/src/adapter.c
index 7bd965d..8935f04 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -43,7 +43,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "textfile.h"
#include "hcid.h"
diff --git a/src/agent.c b/src/agent.c
index 5ce0ec9..c7fdbd4 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -41,7 +41,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "hcid.h"
#include "adapter.h"
diff --git a/src/dbus-common.c b/src/dbus-common.c
index c6eedf9..1245b4f 100644
--- a/src/dbus-common.c
+++ b/src/dbus-common.c
@@ -42,7 +42,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "manager.h"
#include "adapter.h"
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index 9145c68..b4e91d3 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -45,7 +45,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "textfile.h"
#include "hcid.h"
diff --git a/src/device.c b/src/device.c
index 893594e..407611a 100644
--- a/src/device.c
+++ b/src/device.c
@@ -45,7 +45,7 @@
#include <dbus/dbus.h>
#include <gdbus.h>
-#include "logging.h"
+#include "log.h"
#include "textfile.h"
#include "hcid.h"
diff --git a/src/log.c b/src/log.c
new file mode 100644
index 0000000..29e2d7d
--- /dev/null
+++ b/src/log.c
@@ -0,0 +1,133 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <syslog.h>
+
+#include <glib.h>
+
+#include "log.h"
+
+static inline void vinfo(const char *format, va_list ap)
+{
+ vsyslog(LOG_INFO, format, ap);
+}
+
+void info(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+
+ vinfo(format, ap);
+
+ va_end(ap);
+}
+
+void error(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+
+ vsyslog(LOG_ERR, format, ap);
+
+ va_end(ap);
+}
+
+void debug(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+
+ vsyslog(LOG_DEBUG, format, ap);
+
+ va_end(ap);
+}
+
+extern struct btd_debug_desc __start___debug[];
+extern struct btd_debug_desc __stop___debug[];
+
+static gchar **enabled = NULL;
+
+static gboolean is_enabled(struct btd_debug_desc *desc)
+{
+ int i;
+
+ if (enabled == NULL)
+ return 0;
+
+ for (i = 0; enabled[i] != NULL; i++) {
+ if (desc->name != NULL && g_pattern_match_simple(enabled[i],
+ desc->name) == TRUE)
+ return 1;
+ if (desc->file != NULL && g_pattern_match_simple(enabled[i],
+ desc->file) == TRUE)
+ return 1;
+ }
+
+ return 0;
+}
+
+void __btd_log_init(const char *debug, int detach)
+{
+ int option = LOG_NDELAY | LOG_PID;
+ struct btd_debug_desc *desc;
+ const char *name = NULL, *file = NULL;
+
+ if (debug != NULL)
+ enabled = g_strsplit_set(debug, ":, ", 0);
+
+ for (desc = __start___debug; desc < __stop___debug; desc++) {
+ if (file != NULL || name != NULL) {
+ if (g_strcmp0(desc->file, file) == 0) {
+ if (desc->name == NULL)
+ desc->name = name;
+ } else
+ file = NULL;
+ }
+
+ if (is_enabled(desc))
+ desc->flags |= BTD_DEBUG_FLAG_PRINT;
+ }
+
+ if (!detach)
+ option |= LOG_PERROR;
+
+ openlog("bluetoothd", option, LOG_DAEMON);
+
+ syslog(LOG_INFO, "Bluetooth deamon %s", VERSION);
+}
+
+void __btd_log_cleanup(void)
+{
+ closelog();
+
+ g_strfreev(enabled);
+}
diff --git a/src/log.h b/src/log.h
new file mode 100644
index 0000000..9af51e7
--- /dev/null
+++ b/src/log.h
@@ -0,0 +1,60 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef __LOGGING_H
+#define __LOGGING_H
+
+void info(const char *format, ...) __attribute__((format(printf, 1, 2)));
+void error(const char *format, ...) __attribute__((format(printf, 1, 2)));
+void debug(const char *format, ...) __attribute__((format(printf, 1, 2)));
+
+void __btd_log_init(const char *debug, int detach);
+void __btd_log_cleanup(void);
+
+struct btd_debug_desc {
+ const char *name;
+ const char *file;
+#define BTD_DEBUG_FLAG_DEFAULT (0)
+#define BTD_DEBUG_FLAG_PRINT (1 << 0)
+ unsigned int flags;
+} __attribute__((aligned(8)));
+
+/**
+ * DBG:
+ * @fmt: format string
+ * @arg...: list of arguments
+ *
+ * Simple macro around debug() which also include the function
+ * name it is called in.
+ */
+#define DBG(fmt, arg...) do { \
+ static struct btd_debug_desc __btd_debug_desc \
+ __attribute__((used, section("__debug"), aligned(8))) = { \
+ .file = __FILE__, .flags = BTD_DEBUG_FLAG_DEFAULT, \
+ }; \
+ if (__btd_debug_desc.flags & BTD_DEBUG_FLAG_PRINT) \
+ debug("%s:%s() " fmt, \
+ __FILE__, __FUNCTION__ , ## arg); \
+} while (0)
+
+#endif /* __LOGGING_H */
diff --git a/src/logging.c b/src/logging.c
deleted file mode 100644
index 39a5142..0000000
--- a/src/logging.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- *
- * BlueZ - Bluetooth protocol stack for Linux
- *
- * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <syslog.h>
-
-#include <glib.h>
-
-#include "logging.h"
-
-static inline void vinfo(const char *format, va_list ap)
-{
- vsyslog(LOG_INFO, format, ap);
-}
-
-void info(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- vinfo(format, ap);
-
- va_end(ap);
-}
-
-void error(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- vsyslog(LOG_ERR, format, ap);
-
- va_end(ap);
-}
-
-void debug(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- vsyslog(LOG_DEBUG, format, ap);
-
- va_end(ap);
-}
-
-extern struct btd_debug_desc __start___debug[];
-extern struct btd_debug_desc __stop___debug[];
-
-static gchar **enabled = NULL;
-
-static gboolean is_enabled(struct btd_debug_desc *desc)
-{
- int i;
-
- if (enabled == NULL)
- return 0;
-
- for (i = 0; enabled[i] != NULL; i++) {
- if (desc->name != NULL && g_pattern_match_simple(enabled[i],
- desc->name) == TRUE)
- return 1;
- if (desc->file != NULL && g_pattern_match_simple(enabled[i],
- desc->file) == TRUE)
- return 1;
- }
-
- return 0;
-}
-
-void __btd_log_init(const char *debug, int detach)
-{
- int option = LOG_NDELAY | LOG_PID;
- struct btd_debug_desc *desc;
- const char *name = NULL, *file = NULL;
-
- if (debug != NULL)
- enabled = g_strsplit_set(debug, ":, ", 0);
-
- for (desc = __start___debug; desc < __stop___debug; desc++) {
- if (file != NULL || name != NULL) {
- if (g_strcmp0(desc->file, file) == 0) {
- if (desc->name == NULL)
- desc->name = name;
- } else
- file = NULL;
- }
-
- if (is_enabled(desc))
- desc->flags |= BTD_DEBUG_FLAG_PRINT;
- }
-
- if (!detach)
- option |= LOG_PERROR;
-
- openlog("bluetoothd", option, LOG_DAEMON);
-
- syslog(LOG_INFO, "Bluetooth deamon %s", VERSION);
-}
-
-void __btd_log_cleanup(void)
-{
- closelog();
-
- g_strfreev(enabled);
-}
diff --git a/src/logging.h b/src/logging.h
deleted file mode 100644
index 9af51e7..0000000
--- a/src/logging.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * BlueZ - Bluetooth protocol stack for Linux
- *
- * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef __LOGGING_H
-#define __LOGGING_H
-
-void info(const char *format, ...) __attribute__((format(printf, 1, 2)));
-void error(const char *format, ...) __attribute__((format(printf, 1, 2)));
-void debug(const char *format, ...) __attribute__((format(printf, 1, 2)));
-
-void __btd_log_init(const char *debug, int detach);
-void __btd_log_cleanup(void);
-
-struct btd_debug_desc {
- const char *name;
- const char *file;
-#define BTD_DEBUG_FLAG_DEFAULT (0)
-#define BTD_DEBUG_FLAG_PRINT (1 << 0)
- unsigned int flags;
-} __attribute__((aligned(8)));
-
-/**
- * DBG:
- * @fmt: format string
- * @arg...: list of arguments
- *
- * Simple macro around debug() which also include the function
- * name it is called in.
- */
-#define DBG(fmt, arg...) do { \
- static struct btd_debug_desc __btd_debug_desc \
- __attribute__((used, section("__debug"), aligned(8))) = { \
- .file = __FILE__, .flags = BTD_DEBUG_FLAG_DEFAULT, \
- }; \
- if (__btd_debug_desc.flags & BTD_DEBUG_FLAG_PRINT) \
- debug("%s:%s() " fmt, \
- __FILE__, __FUNCTION__ , ## arg); \
-} while (0)
-
-#endif /* __LOGGING_H */
diff --git a/src/main.c b/src/main.c
index 7a573bc..3118a34 100644
--- a/src/main.c
+++ b/src/main.c
@@ -46,7 +46,7 @@
#include <dbus/dbus.h>
-#include "logging.h"
+#include "log.h"
#include "hcid.h"
#include "sdpd.h"
diff --git a/src/manager.c b/src/manager.c
index 0c75ff7..ea1180a 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -45,7 +45,7 @@
#include "hcid.h"
#include "dbus-common.h"
-#include "logging.h"
+#include "log.h"
#include "adapter.h"
#include "error.h"
#include "manager.h"
diff --git a/src/plugin.c b/src/plugin.c
index 5bc2bb2..a63ce8e 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -35,7 +35,7 @@
#include <glib.h>
#include "plugin.h"
-#include "logging.h"
+#include "log.h"
#include "hcid.h"
#include "btio.h"
diff --git a/src/rfkill.c b/src/rfkill.c
index 2d0629b..7810846 100644
--- a/src/rfkill.c
+++ b/src/rfkill.c
@@ -35,7 +35,7 @@
#include <glib.h>
-#include "logging.h"
+#include "log.h"
#include "manager.h"
#include "adapter.h"
#include "hcid.h"
diff --git a/src/sdpd-database.c b/src/sdpd-database.c
index 263b16e..4c8acb7 100644
--- a/src/sdpd-database.c
+++ b/src/sdpd-database.c
@@ -39,7 +39,7 @@
#include <bluetooth/sdp_lib.h>
#include "sdpd.h"
-#include "logging.h"
+#include "log.h"
#include "adapter.h"
static sdp_list_t *service_db;
diff --git a/src/sdpd-request.c b/src/sdpd-request.c
index a8af8e4..8c88d6e 100644
--- a/src/sdpd-request.c
+++ b/src/sdpd-request.c
@@ -43,7 +43,7 @@
#include <netinet/in.h>
#include "sdpd.h"
-#include "logging.h"
+#include "log.h"
#define MIN(x, y) ((x) < (y)) ? (x): (y)
diff --git a/src/sdpd-server.c b/src/sdpd-server.c
index 207bd47..efd6fd0 100644
--- a/src/sdpd-server.c
+++ b/src/sdpd-server.c
@@ -45,7 +45,7 @@
#include <glib.h>
-#include "logging.h"
+#include "log.h"
#include "sdpd.h"
static GIOChannel *l2cap_io = NULL, *unix_io = NULL;
diff --git a/src/sdpd-service.c b/src/sdpd-service.c
index a1caa2c..cdbb4f4 100644
--- a/src/sdpd-service.c
+++ b/src/sdpd-service.c
@@ -45,7 +45,7 @@
#include <dbus/dbus.h>
#include "sdpd.h"
-#include "logging.h"
+#include "log.h"
#include "manager.h"
#include "adapter.h"
diff --git a/src/security.c b/src/security.c
index f2756c5..1d0da45 100644
--- a/src/security.c
+++ b/src/security.c
@@ -47,7 +47,7 @@
#include <dbus/dbus.h>
#include "hcid.h"
-#include "logging.h"
+#include "log.h"
#include "textfile.h"
#include "adapter.h"
--
1.7.1
^ permalink raw reply related
* [PATCH 3/3] Remove old defines from serial code
From: Gustavo F. Padovan @ 2010-05-21 12:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: gustavo
In-Reply-To: <1274444776-14284-2-git-send-email-gustavo@padovan.org>
---
serial/manager.c | 4 ----
serial/proxy.c | 6 ------
2 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/serial/manager.c b/serial/manager.c
index a7deab1..1b3f1d6 100644
--- a/serial/manager.c
+++ b/serial/manager.c
@@ -66,10 +66,6 @@
#include "sdpd.h"
#include "glib-helper.h"
-#define SERIAL_PORT_UUID "00001101-0000-1000-8000-00805F9B34FB"
-#define DIALUP_NET_UUID "00001103-0000-1000-8000-00805F9B34FB"
-#define OBJECT_PUSH_UUID "00001105-0000-1000-8000-00805F9B34FB"
-#define FILE_TRANSFER_UUID "00001106-0000-1000-8000-00805F9B34FB"
#define RFCOMM_UUID_STR "00000003-0000-1000-8000-00805F9B34FB"
static DBusConnection *connection = NULL;
diff --git a/serial/proxy.c b/serial/proxy.c
index 80c1189..6577fe2 100644
--- a/serial/proxy.c
+++ b/serial/proxy.c
@@ -63,12 +63,6 @@
#include "btio.h"
#include "proxy.h"
-#define SERIAL_PORT_NAME "spp"
-#define SERIAL_PORT_UUID "00001101-0000-1000-8000-00805F9B34FB"
-
-#define DIALUP_NET_NAME "dun"
-#define DIALUP_NET_UUID "00001103-0000-1000-8000-00805F9B34FB"
-
#define SERIAL_PROXY_INTERFACE "org.bluez.SerialProxy"
#define SERIAL_MANAGER_INTERFACE "org.bluez.SerialProxyManager"
#define BUF_SIZE 1024
--
1.7.1
^ permalink raw reply related
* Re: [PATCH 2/3] Move logging.{c,h} to log.{c,h}
From: Marcel Holtmann @ 2010-05-21 12:40 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1274444776-14284-2-git-send-email-gustavo@padovan.org>
Hi Gustavo,
> Try to make log stuff more similar to ConnMan and oFono.
patch has been applied. Thanks.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 3/3] Remove old defines from serial code
From: Marcel Holtmann @ 2010-05-21 12:40 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1274444776-14284-3-git-send-email-gustavo@padovan.org>
Hi Gustavo,
> ---
> serial/manager.c | 4 ----
> serial/proxy.c | 6 ------
> 2 files changed, 0 insertions(+), 10 deletions(-)
patch has been applied. Thanks.
Regards
Marcel
^ permalink raw reply
* [PATCH] Move debug() to DBG()
From: Gustavo F. Padovan @ 2010-05-21 15:54 UTC (permalink / raw)
To: linux-bluetooth; +Cc: gustavo, marcel
Use the new dynamic debug feature
---
audio/a2dp.c | 112 +++++++++++++++++++++++-----------------------
audio/avdtp.c | 98 ++++++++++++++++++++--------------------
audio/control.c | 36 +++++++-------
audio/device.c | 4 +-
audio/gateway.c | 14 +++---
audio/headset.c | 62 +++++++++++++-------------
audio/main.c | 6 +-
audio/manager.c | 46 +++++++++---------
audio/sink.c | 22 +++++-----
audio/source.c | 22 +++++-----
audio/telephony-dummy.c | 36 +++++++-------
audio/telephony-maemo5.c | 64 +++++++++++++-------------
audio/telephony-maemo6.c | 66 +++++++++++++-------------
audio/telephony-ofono.c | 74 +++++++++++++++---------------
audio/telephony.h | 4 +-
audio/unix.c | 30 ++++++------
input/device.c | 6 +-
input/manager.c | 2 +-
input/server.c | 2 +-
network/common.c | 4 +-
network/connection.c | 4 +-
network/manager.c | 18 ++++----
network/server.c | 8 ++--
plugins/echo.c | 4 +-
plugins/hal.c | 4 +-
plugins/hciops.c | 4 +-
plugins/netlink.c | 2 +-
plugins/pnat.c | 14 +++---
plugins/service.c | 16 +++---
serial/port.c | 8 ++--
serial/proxy.c | 16 +++---
src/adapter.c | 38 ++++++++--------
src/agent.c | 12 +++---
src/dbus-hci.c | 32 +++++++-------
src/device.c | 38 ++++++++--------
src/main.c | 36 +++++++-------
src/plugin.c | 8 ++--
src/rfkill.c | 4 +-
src/sdpd-service.c | 6 +-
src/security.c | 6 +-
40 files changed, 494 insertions(+), 494 deletions(-)
diff --git a/audio/a2dp.c b/audio/a2dp.c
index 78957f7..6221c14 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -112,14 +112,14 @@ static struct a2dp_setup *setup_ref(struct a2dp_setup *setup)
{
setup->ref++;
- debug("setup_ref(%p): ref=%d", setup, setup->ref);
+ DBG("setup_ref(%p): ref=%d", setup, setup->ref);
return setup;
}
static void setup_free(struct a2dp_setup *s)
{
- debug("setup_free(%p)", s);
+ DBG("setup_free(%p)", s);
setups = g_slist_remove(setups, s);
if (s->session)
avdtp_unref(s->session);
@@ -132,7 +132,7 @@ static void setup_unref(struct a2dp_setup *setup)
{
setup->ref--;
- debug("setup_unref(%p): ref=%d", setup, setup->ref);
+ DBG("setup_unref(%p): ref=%d", setup, setup->ref);
if (setup->ref <= 0)
setup_free(setup);
@@ -290,9 +290,9 @@ static gboolean sbc_setconf_ind(struct avdtp *session,
struct audio_device *dev;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Set_Configuration_Ind", sep);
+ DBG("Sink %p: Set_Configuration_Ind", sep);
else
- debug("Source %p: Set_Configuration_Ind", sep);
+ DBG("Source %p: Set_Configuration_Ind", sep);
dev = a2dp_get_dev(session);
if (!dev) {
@@ -353,9 +353,9 @@ static gboolean sbc_getcap_ind(struct avdtp *session, struct avdtp_local_sep *se
struct sbc_codec_cap sbc_cap;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Get_Capability_Ind", sep);
+ DBG("Sink %p: Get_Capability_Ind", sep);
else
- debug("Source %p: Get_Capability_Ind", sep);
+ DBG("Source %p: Get_Capability_Ind", sep);
*caps = NULL;
@@ -417,9 +417,9 @@ static gboolean mpeg_setconf_ind(struct avdtp *session,
struct audio_device *dev;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Set_Configuration_Ind", sep);
+ DBG("Sink %p: Set_Configuration_Ind", sep);
else
- debug("Source %p: Set_Configuration_Ind", sep);
+ DBG("Source %p: Set_Configuration_Ind", sep);
dev = a2dp_get_dev(session);
if (!dev) {
@@ -458,9 +458,9 @@ static gboolean mpeg_getcap_ind(struct avdtp *session,
struct mpeg_codec_cap mpeg_cap;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Get_Capability_Ind", sep);
+ DBG("Sink %p: Get_Capability_Ind", sep);
else
- debug("Source %p: Get_Capability_Ind", sep);
+ DBG("Source %p: Get_Capability_Ind", sep);
*caps = NULL;
@@ -515,9 +515,9 @@ static void setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
int ret;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Set_Configuration_Cfm", sep);
+ DBG("Sink %p: Set_Configuration_Cfm", sep);
else
- debug("Source %p: Set_Configuration_Cfm", sep);
+ DBG("Source %p: Set_Configuration_Cfm", sep);
setup = find_setup_by_session(session);
@@ -557,9 +557,9 @@ static gboolean getconf_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_sep *a2dp_sep = user_data;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Get_Configuration_Ind", sep);
+ DBG("Sink %p: Get_Configuration_Ind", sep);
else
- debug("Source %p: Get_Configuration_Ind", sep);
+ DBG("Source %p: Get_Configuration_Ind", sep);
return TRUE;
}
@@ -570,9 +570,9 @@ static void getconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_sep *a2dp_sep = user_data;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Set_Configuration_Cfm", sep);
+ DBG("Sink %p: Set_Configuration_Cfm", sep);
else
- debug("Source %p: Set_Configuration_Cfm", sep);
+ DBG("Source %p: Set_Configuration_Cfm", sep);
}
static gboolean open_ind(struct avdtp *session, struct avdtp_local_sep *sep,
@@ -582,9 +582,9 @@ static gboolean open_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_sep *a2dp_sep = user_data;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Open_Ind", sep);
+ DBG("Sink %p: Open_Ind", sep);
else
- debug("Source %p: Open_Ind", sep);
+ DBG("Source %p: Open_Ind", sep);
return TRUE;
}
@@ -596,9 +596,9 @@ static void open_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_setup *setup;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Open_Cfm", sep);
+ DBG("Sink %p: Open_Cfm", sep);
else
- debug("Source %p: Open_Cfm", sep);
+ DBG("Source %p: Open_Cfm", sep);
setup = find_setup_by_session(session);
if (!setup)
@@ -636,9 +636,9 @@ static gboolean start_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_setup *setup;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Start_Ind", sep);
+ DBG("Sink %p: Start_Ind", sep);
else
- debug("Source %p: Start_Ind", sep);
+ DBG("Source %p: Start_Ind", sep);
setup = find_setup_by_session(session);
if (setup)
@@ -662,9 +662,9 @@ static void start_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_setup *setup;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Start_Cfm", sep);
+ DBG("Sink %p: Start_Cfm", sep);
else
- debug("Source %p: Start_Cfm", sep);
+ DBG("Source %p: Start_Cfm", sep);
setup = find_setup_by_session(session);
if (!setup)
@@ -685,9 +685,9 @@ static gboolean suspend_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_sep *a2dp_sep = user_data;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Suspend_Ind", sep);
+ DBG("Sink %p: Suspend_Ind", sep);
else
- debug("Source %p: Suspend_Ind", sep);
+ DBG("Source %p: Suspend_Ind", sep);
if (a2dp_sep->suspend_timer) {
g_source_remove(a2dp_sep->suspend_timer);
@@ -708,9 +708,9 @@ static void suspend_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
gboolean start;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Suspend_Cfm", sep);
+ DBG("Sink %p: Suspend_Cfm", sep);
else
- debug("Source %p: Suspend_Cfm", sep);
+ DBG("Source %p: Suspend_Cfm", sep);
a2dp_sep->suspending = FALSE;
@@ -751,9 +751,9 @@ static gboolean close_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_sep *a2dp_sep = user_data;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Close_Ind", sep);
+ DBG("Sink %p: Close_Ind", sep);
else
- debug("Source %p: Close_Ind", sep);
+ DBG("Source %p: Close_Ind", sep);
return TRUE;
}
@@ -816,9 +816,9 @@ static void close_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_setup *setup;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Close_Cfm", sep);
+ DBG("Sink %p: Close_Cfm", sep);
else
- debug("Source %p: Close_Cfm", sep);
+ DBG("Source %p: Close_Cfm", sep);
setup = find_setup_by_session(session);
if (!setup)
@@ -842,9 +842,9 @@ static gboolean abort_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_sep *a2dp_sep = user_data;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Abort_Ind", sep);
+ DBG("Sink %p: Abort_Ind", sep);
else
- debug("Source %p: Abort_Ind", sep);
+ DBG("Source %p: Abort_Ind", sep);
a2dp_sep->stream = NULL;
@@ -859,9 +859,9 @@ static void abort_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_setup *setup;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: Abort_Cfm", sep);
+ DBG("Sink %p: Abort_Cfm", sep);
else
- debug("Source %p: Abort_Cfm", sep);
+ DBG("Source %p: Abort_Cfm", sep);
setup = find_setup_by_session(session);
if (!setup)
@@ -876,9 +876,9 @@ static gboolean reconf_ind(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_sep *a2dp_sep = user_data;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: ReConfigure_Ind", sep);
+ DBG("Sink %p: ReConfigure_Ind", sep);
else
- debug("Source %p: ReConfigure_Ind", sep);
+ DBG("Source %p: ReConfigure_Ind", sep);
return TRUE;
}
@@ -891,9 +891,9 @@ static gboolean delayreport_ind(struct avdtp *session,
struct audio_device *dev = a2dp_get_dev(session);
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: DelayReport_Ind", sep);
+ DBG("Sink %p: DelayReport_Ind", sep);
else
- debug("Source %p: DelayReport_Ind", sep);
+ DBG("Source %p: DelayReport_Ind", sep);
unix_delay_report(dev, rseid, delay);
@@ -908,9 +908,9 @@ static void reconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_setup *setup;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: ReConfigure_Cfm", sep);
+ DBG("Sink %p: ReConfigure_Cfm", sep);
else
- debug("Source %p: ReConfigure_Cfm", sep);
+ DBG("Source %p: ReConfigure_Cfm", sep);
setup = find_setup_by_session(session);
if (!setup)
@@ -931,9 +931,9 @@ static void delay_report_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_sep *a2dp_sep = user_data;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
- debug("Sink %p: DelayReport_Cfm", sep);
+ DBG("Sink %p: DelayReport_Cfm", sep);
else
- debug("Source %p: DelayReport_Cfm", sep);
+ DBG("Source %p: DelayReport_Cfm", sep);
}
static struct avdtp_sep_cfm cfm = {
@@ -1129,7 +1129,7 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
str = g_key_file_get_string(config, "General", "Enable", &err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else {
if (strstr(str, "Sink"))
@@ -1142,7 +1142,7 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
str = g_key_file_get_string(config, "General", "Disable", &err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else {
if (strstr(str, "Sink"))
@@ -1154,7 +1154,7 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
str = g_key_file_get_string(config, "A2DP", "SBCSources", &err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else {
sbc_srcs = atoi(str);
@@ -1163,7 +1163,7 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
str = g_key_file_get_string(config, "A2DP", "MPEG12Sources", &err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else {
mpeg12_srcs = atoi(str);
@@ -1172,7 +1172,7 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
str = g_key_file_get_string(config, "A2DP", "SBCSinks", &err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else {
sbc_sinks = atoi(str);
@@ -1181,7 +1181,7 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
str = g_key_file_get_string(config, "A2DP", "MPEG12Sinks", &err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else {
mpeg12_sinks = atoi(str);
@@ -1354,7 +1354,7 @@ unsigned int a2dp_config(struct avdtp *session, struct a2dp_sep *sep,
if (sep->codec != codec_cap->media_codec_type)
return 0;
- debug("a2dp_config: selected SEP %p", sep->sep);
+ DBG("a2dp_config: selected SEP %p", sep->sep);
cb_data = g_new0(struct a2dp_setup_cb, 1);
cb_data->config_cb = cb;
@@ -1419,7 +1419,7 @@ unsigned int a2dp_config(struct avdtp *session, struct a2dp_sep *sep,
case AVDTP_STATE_OPEN:
case AVDTP_STATE_STREAMING:
if (avdtp_stream_has_capabilities(setup->stream, caps)) {
- debug("Configuration match: resuming");
+ DBG("Configuration match: resuming");
g_idle_add((GSourceFunc) finalize_config, setup);
} else if (!setup->reconfigure) {
setup->reconfigure = TRUE;
@@ -1558,7 +1558,7 @@ gboolean a2dp_cancel(struct audio_device *dev, unsigned int id)
struct a2dp_setup *setup;
GSList *l;
- debug("a2dp_cancel()");
+ DBG("a2dp_cancel()");
setup = find_setup_by_dev(dev);
if (!setup)
@@ -1592,7 +1592,7 @@ gboolean a2dp_sep_lock(struct a2dp_sep *sep, struct avdtp *session)
if (sep->locked)
return FALSE;
- debug("SEP %p locked", sep->sep);
+ DBG("SEP %p locked", sep->sep);
sep->locked = TRUE;
return TRUE;
@@ -1606,7 +1606,7 @@ gboolean a2dp_sep_unlock(struct a2dp_sep *sep, struct avdtp *session)
sep->locked = FALSE;
- debug("SEP %p unlocked", sep->sep);
+ DBG("SEP %p unlocked", sep->sep);
if (!sep->stream || state == AVDTP_STATE_IDLE)
return TRUE;
diff --git a/audio/avdtp.c b/audio/avdtp.c
index b28a71d..540bdf3 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -541,7 +541,7 @@ static gboolean avdtp_send(struct avdtp *session, uint8_t transaction,
cont_fragments = (len - (session->omtu - sizeof(start))) /
(session->omtu - sizeof(cont)) + 1;
- debug("avdtp_send: %zu bytes split into %d fragments", len,
+ DBG("avdtp_send: %zu bytes split into %d fragments", len,
cont_fragments + 1);
/* Send the start packet */
@@ -559,7 +559,7 @@ static gboolean avdtp_send(struct avdtp *session, uint8_t transaction,
if (!try_send(sock, session->buf, session->omtu))
return FALSE;
- debug("avdtp_send: first packet with %zu bytes sent",
+ DBG("avdtp_send: first packet with %zu bytes sent",
session->omtu - sizeof(start));
sent = session->omtu - sizeof(start);
@@ -572,12 +572,12 @@ static gboolean avdtp_send(struct avdtp *session, uint8_t transaction,
if (left + sizeof(cont) > session->omtu) {
cont.packet_type = AVDTP_PKT_TYPE_CONTINUE;
to_copy = session->omtu - sizeof(cont);
- debug("avdtp_send: sending continue with %d bytes",
+ DBG("avdtp_send: sending continue with %d bytes",
to_copy);
} else {
cont.packet_type = AVDTP_PKT_TYPE_END;
to_copy = left;
- debug("avdtp_send: sending end with %d bytes",
+ DBG("avdtp_send: sending end with %d bytes",
to_copy);
}
@@ -625,7 +625,7 @@ static gboolean stream_close_timeout(gpointer user_data)
{
struct avdtp_stream *stream = user_data;
- debug("Timed out waiting for peer to close the transport channel");
+ DBG("Timed out waiting for peer to close the transport channel");
stream->timer = 0;
@@ -638,7 +638,7 @@ static gboolean stream_open_timeout(gpointer user_data)
{
struct avdtp_stream *stream = user_data;
- debug("Timed out waiting for peer to open the transport channel");
+ DBG("Timed out waiting for peer to open the transport channel");
stream->timer = 0;
@@ -908,7 +908,7 @@ static void handle_unanswered_req(struct avdtp *session,
if (session->req->signal_id == AVDTP_ABORT) {
/* Avoid freeing the Abort request here */
- debug("handle_unanswered_req: Abort req, returning");
+ DBG("handle_unanswered_req: Abort req, returning");
session->req->stream = NULL;
return;
}
@@ -977,11 +977,11 @@ static void avdtp_sep_set_state(struct avdtp *session,
if (sep->state == state) {
avdtp_error_init(&err, AVDTP_ERROR_ERRNO, EIO);
- debug("stream state change failed: %s", avdtp_strerror(&err));
+ DBG("stream state change failed: %s", avdtp_strerror(&err));
err_ptr = &err;
} else {
err_ptr = NULL;
- debug("stream state changed: %s -> %s",
+ DBG("stream state changed: %s -> %s",
avdtp_statestr(sep->state),
avdtp_statestr(state));
}
@@ -1069,7 +1069,7 @@ static void connection_lost(struct avdtp *session, int err)
struct audio_device *dev;
ba2str(&session->dst, address);
- debug("Disconnected from %s", address);
+ DBG("Disconnected from %s", address);
dev = manager_get_device(&session->server->src, &session->dst, FALSE);
@@ -1119,7 +1119,7 @@ void avdtp_unref(struct avdtp *session)
session->ref--;
- debug("avdtp_unref(%p): ref=%d", session, session->ref);
+ DBG("avdtp_unref(%p): ref=%d", session, session->ref);
if (session->ref == 1) {
if (session->state == AVDTP_SESSION_STATE_CONNECTING &&
@@ -1146,7 +1146,7 @@ void avdtp_unref(struct avdtp *session)
server = session->server;
- debug("avdtp_unref(%p): freeing session and removing from list",
+ DBG("avdtp_unref(%p): freeing session and removing from list",
session);
if (session->dc_timer)
@@ -1168,7 +1168,7 @@ void avdtp_unref(struct avdtp *session)
struct avdtp *avdtp_ref(struct avdtp *session)
{
session->ref++;
- debug("avdtp_ref(%p): ref=%d", session, session->ref);
+ DBG("avdtp_ref(%p): ref=%d", session, session->ref);
if (session->dc_timer)
remove_disconnect_timer(session);
return session;
@@ -1803,47 +1803,47 @@ static gboolean avdtp_parse_cmd(struct avdtp *session, uint8_t transaction,
{
switch (signal_id) {
case AVDTP_DISCOVER:
- debug("Received DISCOVER_CMD");
+ DBG("Received DISCOVER_CMD");
return avdtp_discover_cmd(session, transaction, buf, size);
case AVDTP_GET_CAPABILITIES:
- debug("Received GET_CAPABILITIES_CMD");
+ DBG("Received GET_CAPABILITIES_CMD");
return avdtp_getcap_cmd(session, transaction, buf, size,
FALSE);
case AVDTP_GET_ALL_CAPABILITIES:
- debug("Received GET_ALL_CAPABILITIES_CMD");
+ DBG("Received GET_ALL_CAPABILITIES_CMD");
return avdtp_getcap_cmd(session, transaction, buf, size, TRUE);
case AVDTP_SET_CONFIGURATION:
- debug("Received SET_CONFIGURATION_CMD");
+ DBG("Received SET_CONFIGURATION_CMD");
return avdtp_setconf_cmd(session, transaction, buf, size);
case AVDTP_GET_CONFIGURATION:
- debug("Received GET_CONFIGURATION_CMD");
+ DBG("Received GET_CONFIGURATION_CMD");
return avdtp_getconf_cmd(session, transaction, buf, size);
case AVDTP_RECONFIGURE:
- debug("Received RECONFIGURE_CMD");
+ DBG("Received RECONFIGURE_CMD");
return avdtp_reconf_cmd(session, transaction, buf, size);
case AVDTP_OPEN:
- debug("Received OPEN_CMD");
+ DBG("Received OPEN_CMD");
return avdtp_open_cmd(session, transaction, buf, size);
case AVDTP_START:
- debug("Received START_CMD");
+ DBG("Received START_CMD");
return avdtp_start_cmd(session, transaction, buf, size);
case AVDTP_CLOSE:
- debug("Received CLOSE_CMD");
+ DBG("Received CLOSE_CMD");
return avdtp_close_cmd(session, transaction, buf, size);
case AVDTP_SUSPEND:
- debug("Received SUSPEND_CMD");
+ DBG("Received SUSPEND_CMD");
return avdtp_suspend_cmd(session, transaction, buf, size);
case AVDTP_ABORT:
- debug("Received ABORT_CMD");
+ DBG("Received ABORT_CMD");
return avdtp_abort_cmd(session, transaction, buf, size);
case AVDTP_SECURITY_CONTROL:
- debug("Received SECURITY_CONTROL_CMD");
+ DBG("Received SECURITY_CONTROL_CMD");
return avdtp_secctl_cmd(session, transaction, buf, size);
case AVDTP_DELAY_REPORT:
- debug("Received DELAY_REPORT_CMD");
+ DBG("Received DELAY_REPORT_CMD");
return avdtp_delayreport_cmd(session, transaction, buf, size);
default:
- debug("Received unknown request id %u", signal_id);
+ DBG("Received unknown request id %u", signal_id);
return avdtp_unknown_cmd(session, transaction, signal_id);
}
}
@@ -1963,7 +1963,7 @@ static enum avdtp_parse_result avdtp_parse_data(struct avdtp *session,
if (session->in.no_of_packets > 1) {
session->in.no_of_packets--;
- debug("Received AVDTP fragment. %d to go",
+ DBG("Received AVDTP fragment. %d to go",
session->in.no_of_packets);
return PARSE_FRAGMENT;
}
@@ -1980,7 +1980,7 @@ static gboolean session_cb(GIOChannel *chan, GIOCondition cond,
struct avdtp_common_header *header;
gsize size;
- debug("session_cb");
+ DBG("session_cb");
if (cond & G_IO_NVAL)
return FALSE;
@@ -2218,12 +2218,12 @@ static void avdtp_connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
}
ba2str(&session->dst, address);
- debug("AVDTP: connected %s channel to %s",
+ DBG("AVDTP: connected %s channel to %s",
session->pending_open ? "transport" : "signaling",
address);
if (session->state == AVDTP_SESSION_STATE_CONNECTING) {
- debug("AVDTP imtu=%u, omtu=%u", session->imtu, session->omtu);
+ DBG("AVDTP imtu=%u, omtu=%u", session->imtu, session->omtu);
session->buf = g_malloc0(session->imtu);
avdtp_set_state(session, AVDTP_SESSION_STATE_CONNECTED);
@@ -2318,7 +2318,7 @@ static void avdtp_confirm_cb(GIOChannel *chan, gpointer data)
goto drop;
}
- debug("AVDTP: incoming connect from %s", address);
+ DBG("AVDTP: incoming connect from %s", address);
session = avdtp_get_internal(&src, &dst);
if (!session)
@@ -2331,7 +2331,7 @@ static void avdtp_confirm_cb(GIOChannel *chan, gpointer data)
* Abort the device's channel in favor of our own.
*/
if (session->state == AVDTP_SESSION_STATE_CONNECTING) {
- debug("avdtp_confirm_cb: connect already in progress"
+ DBG("avdtp_confirm_cb: connect already in progress"
" (XCASE connect:connect)");
goto drop;
}
@@ -2609,7 +2609,7 @@ static gboolean avdtp_discover_resp(struct avdtp *session,
struct seid_req req;
int ret;
- debug("seid %d type %d media %d in use %d",
+ DBG("seid %d type %d media %d in use %d",
resp->seps[i].seid, resp->seps[i].type,
resp->seps[i].media_type, resp->seps[i].inuse);
@@ -2665,7 +2665,7 @@ static gboolean avdtp_get_capabilities_resp(struct avdtp *session,
sep = find_remote_sep(session->seps, seid);
- debug("seid %d type %d media %d", sep->seid,
+ DBG("seid %d type %d media %d", sep->seid,
sep->type, sep->media_type);
if (sep->caps) {
@@ -2809,12 +2809,12 @@ static gboolean avdtp_parse_resp(struct avdtp *session,
switch (signal_id) {
case AVDTP_DISCOVER:
- debug("DISCOVER request succeeded");
+ DBG("DISCOVER request succeeded");
return avdtp_discover_resp(session, buf, size);
case AVDTP_GET_ALL_CAPABILITIES:
get_all = "ALL_";
case AVDTP_GET_CAPABILITIES:
- debug("GET_%sCAPABILITIES request succeeded", get_all);
+ DBG("GET_%sCAPABILITIES request succeeded", get_all);
if (!avdtp_get_capabilities_resp(session, buf, size))
return FALSE;
if (!(next && (next->signal_id == AVDTP_GET_CAPABILITIES ||
@@ -2826,35 +2826,35 @@ static gboolean avdtp_parse_resp(struct avdtp *session,
/* The remaining commands require an existing stream so bail out
* here if the stream got unexpectedly disconnected */
if (!stream) {
- debug("AVDTP: stream was closed while waiting for reply");
+ DBG("AVDTP: stream was closed while waiting for reply");
return TRUE;
}
switch (signal_id) {
case AVDTP_SET_CONFIGURATION:
- debug("SET_CONFIGURATION request succeeded");
+ DBG("SET_CONFIGURATION request succeeded");
return avdtp_set_configuration_resp(session, stream,
buf, size);
case AVDTP_RECONFIGURE:
- debug("RECONFIGURE request succeeded");
+ DBG("RECONFIGURE request succeeded");
return avdtp_reconfigure_resp(session, stream, buf, size);
case AVDTP_OPEN:
- debug("OPEN request succeeded");
+ DBG("OPEN request succeeded");
return avdtp_open_resp(session, stream, buf, size);
case AVDTP_SUSPEND:
- debug("SUSPEND request succeeded");
+ DBG("SUSPEND request succeeded");
return avdtp_suspend_resp(session, stream, buf, size);
case AVDTP_START:
- debug("START request succeeded");
+ DBG("START request succeeded");
return avdtp_start_resp(session, stream, buf, size);
case AVDTP_CLOSE:
- debug("CLOSE request succeeded");
+ DBG("CLOSE request succeeded");
return avdtp_close_resp(session, stream, buf, size);
case AVDTP_ABORT:
- debug("ABORT request succeeded");
+ DBG("ABORT request succeeded");
return avdtp_abort_resp(session, stream, buf, size);
case AVDTP_DELAY_REPORT:
- debug("DELAY_REPORT request succeeded");
+ DBG("DELAY_REPORT request succeeded");
return avdtp_delay_report_resp(session, stream, buf, size);
}
@@ -3347,7 +3347,7 @@ int avdtp_set_configuration(struct avdtp *session,
if (!(lsep && rsep))
return -EINVAL;
- debug("avdtp_set_configuration(%p): int_seid=%u, acp_seid=%u",
+ DBG("avdtp_set_configuration(%p): int_seid=%u, acp_seid=%u",
session, lsep->info.seid, rsep->seid);
new_stream = g_new0(struct avdtp_stream, 1);
@@ -3606,7 +3606,7 @@ struct avdtp_local_sep *avdtp_register_sep(const bdaddr_t *src, uint8_t type,
sep->server = server;
sep->delay_reporting = TRUE;
- debug("SEP %p registered: type:%d codec:%d seid:%d", sep,
+ DBG("SEP %p registered: type:%d codec:%d seid:%d", sep,
sep->info.type, sep->codec, sep->info.seid);
server->seps = g_slist_append(server->seps, sep);
@@ -3722,7 +3722,7 @@ int avdtp_init(const bdaddr_t *src, GKeyFile *config, uint16_t *version)
tmp = g_key_file_get_boolean(config, "General",
"Master", &err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else
master = tmp;
diff --git a/audio/control.c b/audio/control.c
index 1b53c8f..c8aba53 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -374,17 +374,17 @@ static void handle_panel_passthrough(struct control *control,
if ((operands[0] & 0x7F) != key_map[i].avrcp)
continue;
- debug("AVRCP: %s %s", key_map[i].name, status);
+ DBG("AVRCP: %s %s", key_map[i].name, status);
key_quirks = control->key_quirks[key_map[i].avrcp];
if (key_quirks & QUIRK_NO_RELEASE) {
if (!pressed) {
- debug("AVRCP: Ignoring release");
+ DBG("AVRCP: Ignoring release");
break;
}
- debug("AVRCP: treating key press as press + release");
+ DBG("AVRCP: treating key press as press + release");
send_key(control->uinput, key_map[i].uinput, 1);
send_key(control->uinput, key_map[i].uinput, 0);
break;
@@ -395,7 +395,7 @@ static void handle_panel_passthrough(struct control *control,
}
if (key_map[i].name == NULL)
- debug("AVRCP: unknown button 0x%02X %s",
+ DBG("AVRCP: unknown button 0x%02X %s",
operands[0] & 0x7F, status);
}
@@ -425,7 +425,7 @@ static void avctp_disconnected(struct audio_device *dev)
char address[18];
ba2str(&dev->dst, address);
- debug("AVRCP: closing uinput for %s", address);
+ DBG("AVRCP: closing uinput for %s", address);
ioctl(control->uinput, UI_DEV_DESTROY);
close(control->uinput);
@@ -442,7 +442,7 @@ static void avctp_set_state(struct control *control, avctp_state_t new_state)
switch (new_state) {
case AVCTP_STATE_DISCONNECTED:
- debug("AVCTP Disconnected");
+ DBG("AVCTP Disconnected");
avctp_disconnected(control->dev);
@@ -462,10 +462,10 @@ static void avctp_set_state(struct control *control, avctp_state_t new_state)
break;
case AVCTP_STATE_CONNECTING:
- debug("AVCTP Connecting");
+ DBG("AVCTP Connecting");
break;
case AVCTP_STATE_CONNECTED:
- debug("AVCTP Connected");
+ DBG("AVCTP Connected");
value = TRUE;
g_dbus_emit_signal(control->dev->conn, control->dev->path,
AUDIO_CONTROL_INTERFACE, "Connected",
@@ -505,7 +505,7 @@ static gboolean control_cb(GIOChannel *chan, GIOCondition cond,
if (ret <= 0)
goto failed;
- debug("Got %d bytes of data for AVCTP session %p", ret, control);
+ DBG("Got %d bytes of data for AVCTP session %p", ret, control);
if ((unsigned int) ret < sizeof(struct avctp_header)) {
error("Too small AVCTP packet");
@@ -516,7 +516,7 @@ static gboolean control_cb(GIOChannel *chan, GIOCondition cond,
avctp = (struct avctp_header *) buf;
- debug("AVCTP transaction %u, packet type %u, C/R %u, IPID %u, "
+ DBG("AVCTP transaction %u, packet type %u, C/R %u, IPID %u, "
"PID 0x%04X",
avctp->transaction, avctp->packet_type,
avctp->cr, avctp->ipid, ntohs(avctp->pid));
@@ -534,7 +534,7 @@ static gboolean control_cb(GIOChannel *chan, GIOCondition cond,
operands = buf + sizeof(struct avctp_header) + sizeof(struct avrcp_header);
operand_count = ret;
- debug("AVRCP %s 0x%01X, subunit_type 0x%02X, subunit_id 0x%01X, "
+ DBG("AVRCP %s 0x%01X, subunit_type 0x%02X, subunit_id 0x%01X, "
"opcode 0x%02X, %d operands",
avctp->cr ? "response" : "command",
avrcp->code, avrcp->subunit_type, avrcp->subunit_id,
@@ -568,7 +568,7 @@ static gboolean control_cb(GIOChannel *chan, GIOCondition cond,
operands[0] = 0x07;
if (operand_count >= 2)
operands[1] = SUBUNIT_PANEL << 3;
- debug("reply to %s", avrcp->opcode == OP_UNITINFO ?
+ DBG("reply to %s", avrcp->opcode == OP_UNITINFO ?
"OP_UNITINFO" : "OP_SUBUNITINFO");
} else {
avctp->cr = AVCTP_RESPONSE;
@@ -579,7 +579,7 @@ static gboolean control_cb(GIOChannel *chan, GIOCondition cond,
return TRUE;
failed:
- debug("AVCTP session %p got disconnected", control);
+ DBG("AVCTP session %p got disconnected", control);
avctp_set_state(control, AVCTP_STATE_DISCONNECTED);
return FALSE;
}
@@ -660,7 +660,7 @@ static void init_uinput(struct control *control)
if (control->uinput < 0)
error("AVRCP: failed to init uinput for %s", address);
else
- debug("AVRCP: uinput initialized for %s", address);
+ DBG("AVRCP: uinput initialized for %s", address);
}
static void avctp_connect_cb(GIOChannel *chan, GError *err, gpointer data)
@@ -687,7 +687,7 @@ static void avctp_connect_cb(GIOChannel *chan, GError *err, gpointer data)
return;
}
- debug("AVCTP: connected to %s", address);
+ DBG("AVCTP: connected to %s", address);
if (!control->io)
control->io = g_io_channel_ref(chan);
@@ -851,7 +851,7 @@ int avrcp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
tmp = g_key_file_get_boolean(config, "General",
"Master", &err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_error_free(err);
} else
master = tmp;
@@ -1112,7 +1112,7 @@ static void path_unregister(void *data)
struct audio_device *dev = data;
struct control *control = dev->control;
- debug("Unregistered interface %s on path %s",
+ DBG("Unregistered interface %s on path %s",
AUDIO_CONTROL_INTERFACE, dev->path);
if (control->state != AVCTP_STATE_DISCONNECTED)
@@ -1146,7 +1146,7 @@ struct control *control_init(struct audio_device *dev, uint16_t uuid16)
dev, path_unregister))
return NULL;
- debug("Registered interface %s on path %s",
+ DBG("Registered interface %s on path %s",
AUDIO_CONTROL_INTERFACE, dev->path);
control = g_new0(struct control, 1);
diff --git a/audio/device.c b/audio/device.c
index 2beeb04..b59be6a 100644
--- a/audio/device.c
+++ b/audio/device.c
@@ -157,7 +157,7 @@ static void device_set_state(struct audio_device *dev, audio_state_t new_state)
priv->authorized = FALSE;
if (dev->priv->state == new_state) {
- debug("state change attempted from %s to %s",
+ DBG("state change attempted from %s to %s",
state_str, state_str);
return;
}
@@ -605,7 +605,7 @@ struct audio_device *audio_device_register(DBusConnection *conn,
return NULL;
}
- debug("Registered interface %s on path %s", AUDIO_INTERFACE,
+ DBG("Registered interface %s on path %s", AUDIO_INTERFACE,
dev->path);
if (sink_callback_id == 0)
diff --git a/audio/gateway.c b/audio/gateway.c
index 57e2977..dfe7145 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -158,7 +158,7 @@ static gboolean sco_io_cb(GIOChannel *chan, GIOCondition cond,
return FALSE;
if (cond & (G_IO_ERR | G_IO_HUP)) {
- debug("sco connection is released");
+ DBG("sco connection is released");
g_io_channel_shutdown(gw->sco, TRUE, NULL);
g_io_channel_unref(gw->sco);
gw->sco = NULL;
@@ -174,7 +174,7 @@ static void sco_connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
struct audio_device *dev = (struct audio_device *) user_data;
struct gateway *gw = dev->gateway;
- debug("at the begin of sco_connect_cb() in gateway.c");
+ DBG("at the begin of sco_connect_cb() in gateway.c");
gw->sco = g_io_channel_ref(chan);
@@ -198,18 +198,18 @@ static void newconnection_reply(DBusPendingCall *call, void *data)
DBusError derr;
if (!dev->gateway->rfcomm) {
- debug("RFCOMM disconnected from server before agent reply");
+ DBG("RFCOMM disconnected from server before agent reply");
goto done;
}
dbus_error_init(&derr);
if (!dbus_set_error_from_message(&derr, reply)) {
- debug("Agent reply: file descriptor passed successfuly");
+ DBG("Agent reply: file descriptor passed successfuly");
change_state(dev, GATEWAY_STATE_CONNECTED);
goto done;
}
- debug("Agent reply: %s", derr.message);
+ DBG("Agent reply: %s", derr.message);
dbus_error_free(&derr);
gateway_close(dev);
@@ -432,7 +432,7 @@ static DBusMessage *ag_disconnect(DBusConnection *conn, DBusMessage *msg,
gateway_close(device);
ba2str(&device->dst, gw_addr);
- debug("Disconnected from %s, %s", gw_addr, device->path);
+ DBG("Disconnected from %s, %s", gw_addr, device->path);
return reply;
}
@@ -442,7 +442,7 @@ static void agent_exited(DBusConnection *conn, void *data)
struct gateway *gateway = data;
struct hf_agent *agent = gateway->agent;
- debug("Agent %s exited", agent->name);
+ DBG("Agent %s exited", agent->name);
agent_free(agent);
gateway->agent = NULL;
diff --git a/audio/headset.c b/audio/headset.c
index 9ce813b..9a5d767 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -212,7 +212,7 @@ static void print_ag_features(uint32_t features)
char *str;
if (features == 0) {
- debug("HFP AG features: (none)");
+ DBG("HFP AG features: (none)");
return;
}
@@ -239,7 +239,7 @@ static void print_ag_features(uint32_t features)
str = g_string_free(gstr, FALSE);
- debug("%s", str);
+ DBG("%s", str);
g_free(str);
}
@@ -250,7 +250,7 @@ static void print_hf_features(uint32_t features)
char *str;
if (features == 0) {
- debug("HFP HF features: (none)");
+ DBG("HFP HF features: (none)");
return;
}
@@ -273,7 +273,7 @@ static void print_hf_features(uint32_t features)
str = g_string_free(gstr, FALSE);
- debug("%s", str);
+ DBG("%s", str);
g_free(str);
}
@@ -591,11 +591,11 @@ static void sco_connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
return;
}
- debug("SCO socket opened for headset %s", dev->path);
+ DBG("SCO socket opened for headset %s", dev->path);
sk = g_io_channel_unix_get_fd(chan);
- debug("SCO fd=%d", sk);
+ DBG("SCO fd=%d", sk);
if (p) {
p->io = NULL;
@@ -670,7 +670,7 @@ static void hfp_slc_complete(struct audio_device *dev)
struct headset *hs = dev->headset;
struct pending_connect *p = hs->pending;
- debug("HFP Service Level Connection established");
+ DBG("HFP Service Level Connection established");
headset_set_state(dev, HEADSET_STATE_CONNECTED);
@@ -754,7 +754,7 @@ static int event_reporting(struct audio_device *dev, const char *buf)
g_strfreev(tokens);
tokens = NULL;
- debug("Event reporting (CMER): mode=%d, ind=%d",
+ DBG("Event reporting (CMER): mode=%d, ind=%d",
ag.er_mode, ag.er_ind);
switch (ag.er_ind) {
@@ -938,7 +938,7 @@ static int dial_number(struct audio_device *device, const char *buf)
buf_len = strlen(buf);
if (buf[buf_len - 1] != ';') {
- debug("Rejecting non-voice call dial request");
+ DBG("Rejecting non-voice call dial request");
return -EINVAL;
}
@@ -1054,10 +1054,10 @@ static int extended_errors(struct audio_device *device, const char *buf)
if (buf[8] == '1') {
slc->cme_enabled = TRUE;
- debug("CME errors enabled for headset %p", hs);
+ DBG("CME errors enabled for headset %p", hs);
} else {
slc->cme_enabled = FALSE;
- debug("CME errors disabled for headset %p", hs);
+ DBG("CME errors disabled for headset %p", hs);
}
return headset_send(hs, "\r\nOK\r\n");
@@ -1073,10 +1073,10 @@ static int call_waiting_notify(struct audio_device *device, const char *buf)
if (buf[8] == '1') {
slc->cwa_enabled = TRUE;
- debug("Call waiting notification enabled for headset %p", hs);
+ DBG("Call waiting notification enabled for headset %p", hs);
} else {
slc->cwa_enabled = FALSE;
- debug("Call waiting notification disabled for headset %p", hs);
+ DBG("Call waiting notification disabled for headset %p", hs);
}
return headset_send(hs, "\r\nOK\r\n");
@@ -1203,7 +1203,7 @@ static int handle_event(struct audio_device *device, const char *buf)
{
struct event *ev;
- debug("Received %s", buf);
+ DBG("Received %s", buf);
for (ev = event_callbacks; ev->cmd; ev++) {
if (!strncmp(buf, ev->cmd, strlen(ev->cmd)))
@@ -1247,7 +1247,7 @@ static gboolean rfcomm_io_cb(GIOChannel *chan, GIOCondition cond,
slc = hs->slc;
if (cond & (G_IO_ERR | G_IO_HUP)) {
- debug("ERR or HUP on RFCOMM socket");
+ DBG("ERR or HUP on RFCOMM socket");
goto failed;
}
@@ -1359,7 +1359,7 @@ void headset_connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
g_io_add_watch(chan, G_IO_IN | G_IO_ERR | G_IO_HUP| G_IO_NVAL,
(GIOFunc) rfcomm_io_cb, dev);
- debug("%s: Connected to %s", dev->path, hs_address);
+ DBG("%s: Connected to %s", dev->path, hs_address);
hs->slc = g_new0(struct headset_slc, 1);
hs->slc->nrec = TRUE;
@@ -1421,10 +1421,10 @@ static int headset_set_channel(struct headset *headset,
if (svc == HANDSFREE_SVCLASS_ID) {
headset->hfp_handle = record->handle;
- debug("Discovered Handsfree service on channel %d", ch);
+ DBG("Discovered Handsfree service on channel %d", ch);
} else {
headset->hsp_handle = record->handle;
- debug("Discovered Headset service on channel %d", ch);
+ DBG("Discovered Headset service on channel %d", ch);
}
return 0;
@@ -1570,7 +1570,7 @@ static int rfcomm_connect(struct audio_device *dev, headset_stream_cb_t cb,
ba2str(&dev->dst, address);
- debug("%s: Connecting to %s channel %d", dev->path, address,
+ DBG("%s: Connecting to %s channel %d", dev->path, address,
hs->rfcomm_ch);
hs->tmp_rfcomm = bt_io_connect(BT_IO_RFCOMM, headset_connect_cb, dev,
@@ -1740,7 +1740,7 @@ static DBusMessage *hs_ring(DBusConnection *conn, DBusMessage *msg,
return NULL;
if (ag.ring_timer) {
- debug("IndicateCall received when already indicating");
+ DBG("IndicateCall received when already indicating");
goto done;
}
@@ -1780,7 +1780,7 @@ static DBusMessage *hs_cancel_call(DBusConnection *conn,
g_source_remove(ag.ring_timer);
ag.ring_timer = 0;
} else
- debug("Got CancelCall method call but no call is active");
+ DBG("Got CancelCall method call but no call is active");
return reply;
}
@@ -2133,7 +2133,7 @@ void headset_update(struct audio_device *dev, uint16_t svc,
break;
default:
- debug("Invalid record passed to headset_update");
+ DBG("Invalid record passed to headset_update");
return;
}
}
@@ -2182,11 +2182,11 @@ static void path_unregister(void *data)
struct headset *hs = dev->headset;
if (hs->state > HEADSET_STATE_DISCONNECTED) {
- debug("Headset unregistered while device was connected!");
+ DBG("Headset unregistered while device was connected!");
headset_shutdown(dev);
}
- debug("Unregistered interface %s on path %s",
+ DBG("Unregistered interface %s on path %s",
AUDIO_HEADSET_INTERFACE, dev->path);
headset_free(dev);
@@ -2222,7 +2222,7 @@ struct headset *headset_init(struct audio_device *dev, uint16_t svc,
break;
default:
- debug("Invalid record passed to headset_init");
+ DBG("Invalid record passed to headset_init");
g_free(hs);
return NULL;
}
@@ -2236,7 +2236,7 @@ register_iface:
return NULL;
}
- debug("Registered interface %s on path %s",
+ DBG("Registered interface %s on path %s",
AUDIO_HEADSET_INTERFACE, dev->path);
return hs;
@@ -2254,7 +2254,7 @@ uint32_t headset_config_init(GKeyFile *config)
str = g_key_file_get_string(config, "General", "SCORouting",
&err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else {
if (strcmp(str, "PCM") == 0)
@@ -2582,7 +2582,7 @@ void headset_set_state(struct audio_device *dev, headset_state_t state)
hs->state = state;
- debug("State changed %s: %s -> %s", dev->path, str_state[old_state],
+ DBG("State changed %s: %s -> %s", dev->path, str_state[old_state],
str_state[state]);
for (l = headset_callbacks; l != NULL; l = l->next) {
@@ -2713,7 +2713,7 @@ int telephony_event_ind(int index)
return -ENODEV;
if (!ag.er_ind) {
- debug("telephony_report_event called but events are disabled");
+ DBG("telephony_report_event called but events are disabled");
return -EINVAL;
}
@@ -2756,7 +2756,7 @@ int telephony_incoming_call_ind(const char *number, int type)
slc = hs->slc;
if (ag.ring_timer) {
- debug("telephony_incoming_call_ind: already calling");
+ DBG("telephony_incoming_call_ind: already calling");
return -EBUSY;
}
@@ -2815,7 +2815,7 @@ int telephony_ready_ind(uint32_t features,
ag.rh = rh;
ag.chld = g_strdup(chld);
- debug("Telephony plugin initialized");
+ DBG("Telephony plugin initialized");
print_ag_features(ag.features);
diff --git a/audio/main.c b/audio/main.c
index 60b1f15..9d316ec 100644
--- a/audio/main.c
+++ b/audio/main.c
@@ -102,7 +102,7 @@ static void sco_server_cb(GIOChannel *chan, GError *err, gpointer data)
if (device->headset) {
if (headset_get_state(device) < HEADSET_STATE_CONNECTED) {
- debug("Refusing SCO from non-connected headset");
+ DBG("Refusing SCO from non-connected headset");
goto drop;
}
@@ -118,7 +118,7 @@ static void sco_server_cb(GIOChannel *chan, GError *err, gpointer data)
headset_set_state(device, HEADSET_STATE_PLAYING);
} else if (device->gateway) {
if (!gateway_is_connected(device)) {
- debug("Refusing SCO from non-connected AG");
+ DBG("Refusing SCO from non-connected AG");
goto drop;
}
@@ -130,7 +130,7 @@ static void sco_server_cb(GIOChannel *chan, GError *err, gpointer data)
sk = g_io_channel_unix_get_fd(chan);
fcntl(sk, F_SETFL, 0);
- debug("Accepted SCO connection from %s", addr);
+ DBG("Accepted SCO connection from %s", addr);
return;
diff --git a/audio/manager.c b/audio/manager.c
index a4b873c..32b7d03 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -171,14 +171,14 @@ static void handle_uuid(const char *uuidstr, struct audio_device *device)
uuid16 = uuid.value.uuid16;
if (!server_is_enabled(&device->src, uuid16)) {
- debug("audio handle_uuid: server not enabled for %s (0x%04x)",
+ DBG("audio handle_uuid: server not enabled for %s (0x%04x)",
uuidstr, uuid16);
return;
}
switch (uuid16) {
case HEADSET_SVCLASS_ID:
- debug("Found Headset record");
+ DBG("Found Headset record");
if (device->headset)
headset_update(device, uuid16, uuidstr);
else
@@ -186,10 +186,10 @@ static void handle_uuid(const char *uuidstr, struct audio_device *device)
uuidstr);
break;
case HEADSET_AGW_SVCLASS_ID:
- debug("Found Headset AG record");
+ DBG("Found Headset AG record");
break;
case HANDSFREE_SVCLASS_ID:
- debug("Found Handsfree record");
+ DBG("Found Handsfree record");
if (device->headset)
headset_update(device, uuid16, uuidstr);
else
@@ -197,23 +197,23 @@ static void handle_uuid(const char *uuidstr, struct audio_device *device)
uuidstr);
break;
case HANDSFREE_AGW_SVCLASS_ID:
- debug("Found Handsfree AG record");
+ DBG("Found Handsfree AG record");
if (enabled.gateway && (device->gateway == NULL))
device->gateway = gateway_init(device);
break;
case AUDIO_SINK_SVCLASS_ID:
- debug("Found Audio Sink");
+ DBG("Found Audio Sink");
if (device->sink == NULL)
device->sink = sink_init(device);
break;
case AUDIO_SOURCE_SVCLASS_ID:
- debug("Found Audio Source");
+ DBG("Found Audio Source");
if (device->source == NULL)
device->source = source_init(device);
break;
case AV_REMOTE_SVCLASS_ID:
case AV_REMOTE_TARGET_SVCLASS_ID:
- debug("Found AV %s", uuid16 == AV_REMOTE_SVCLASS_ID ?
+ DBG("Found AV %s", uuid16 == AV_REMOTE_SVCLASS_ID ?
"Remote" : "Target");
if (device->control)
control_update(device, uuid16);
@@ -223,7 +223,7 @@ static void handle_uuid(const char *uuidstr, struct audio_device *device)
avrcp_connect(device);
break;
default:
- debug("Unrecognized UUID: 0x%04X", uuid16);
+ DBG("Unrecognized UUID: 0x%04X", uuid16);
break;
}
}
@@ -437,7 +437,7 @@ static gboolean hs_preauth_cb(GIOChannel *chan, GIOCondition cond,
{
struct audio_device *device = user_data;
- debug("Headset disconnected during authorization");
+ DBG("Headset disconnected during authorization");
audio_device_cancel_authorization(device, headset_auth_cb, device);
@@ -484,7 +484,7 @@ static void ag_confirm(GIOChannel *chan, gpointer data)
goto drop;
if (!manager_allow_headset_connection(device)) {
- debug("Refusing headset: too many existing connections");
+ DBG("Refusing headset: too many existing connections");
goto drop;
}
@@ -495,7 +495,7 @@ static void ag_confirm(GIOChannel *chan, gpointer data)
}
if (headset_get_state(device) > HEADSET_STATE_DISCONNECTED) {
- debug("Refusing new connection since one already exists");
+ DBG("Refusing new connection since one already exists");
goto drop;
}
@@ -511,7 +511,7 @@ static void ag_confirm(GIOChannel *chan, gpointer data)
perr = audio_device_request_authorization(device, server_uuid,
headset_auth_cb, device);
if (perr < 0) {
- debug("Authorization denied: %s", strerror(-perr));
+ DBG("Authorization denied: %s", strerror(-perr));
headset_set_state(device, HEADSET_STATE_DISCONNECTED);
return;
}
@@ -538,7 +538,7 @@ static void gateway_auth_cb(DBusError *derr, void *user_data)
char ag_address[18];
ba2str(&device->dst, ag_address);
- debug("Accepted AG connection from %s for %s",
+ DBG("Accepted AG connection from %s for %s",
ag_address, device->path);
gateway_start_service(device);
@@ -582,7 +582,7 @@ static void hf_io_cb(GIOChannel *chan, gpointer data)
}
if (gateway_is_connected(device)) {
- debug("Refusing new connection since one already exists");
+ DBG("Refusing new connection since one already exists");
goto drop;
}
@@ -594,7 +594,7 @@ static void hf_io_cb(GIOChannel *chan, gpointer data)
perr = audio_device_request_authorization(device, server_uuid,
gateway_auth_cb, device);
if (perr < 0) {
- debug("Authorization denied!");
+ DBG("Authorization denied!");
goto drop;
}
@@ -622,7 +622,7 @@ static int headset_server_init(struct audio_adapter *adapter)
tmp = g_key_file_get_boolean(config, "General", "Master",
&err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else
master = tmp;
@@ -720,7 +720,7 @@ static int gateway_server_init(struct audio_adapter *adapter)
tmp = g_key_file_get_boolean(config, "General", "Master",
&err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else
master = tmp;
@@ -771,7 +771,7 @@ static int audio_probe(struct btd_device *device, GSList *uuids)
audio_dev = manager_get_device(&src, &dst, TRUE);
if (!audio_dev) {
- debug("audio_probe: unable to get a device object");
+ DBG("audio_probe: unable to get a device object");
return -1;
}
@@ -801,7 +801,7 @@ static struct audio_adapter *audio_adapter_ref(struct audio_adapter *adp)
{
adp->ref++;
- debug("audio_adapter_ref(%p): ref=%d", adp, adp->ref);
+ DBG("audio_adapter_ref(%p): ref=%d", adp, adp->ref);
return adp;
}
@@ -810,7 +810,7 @@ static void audio_adapter_unref(struct audio_adapter *adp)
{
adp->ref--;
- debug("audio_adapter_unref(%p): ref=%d", adp, adp->ref);
+ DBG("audio_adapter_unref(%p): ref=%d", adp, adp->ref);
if (adp->ref > 0)
return;
@@ -1095,7 +1095,7 @@ int audio_manager_init(DBusConnection *conn, GKeyFile *conf,
b = g_key_file_get_boolean(config, "General", "AutoConnect", &err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else
auto_connect = b;
@@ -1111,7 +1111,7 @@ int audio_manager_init(DBusConnection *conn, GKeyFile *conf,
i = g_key_file_get_integer(config, "Headset", "MaxConnected",
&err);
if (err) {
- debug("audio.conf: %s", err->message);
+ DBG("audio.conf: %s", err->message);
g_clear_error(&err);
} else
max_connected_headsets = i;
diff --git a/audio/sink.c b/audio/sink.c
index e589b14..f4dce28 100644
--- a/audio/sink.c
+++ b/audio/sink.c
@@ -176,7 +176,7 @@ static void disconnect_cb(struct btd_device *btd_dev, gboolean removal,
struct audio_device *device = user_data;
struct sink *sink = device->sink;
- debug("Sink: disconnect %s", device->path);
+ DBG("Sink: disconnect %s", device->path);
avdtp_close(sink->session, sink->stream, TRUE);
}
@@ -282,14 +282,14 @@ static gboolean stream_setup_retry(gpointer user_data)
sink->retry_id = 0;
if (sink->stream_state >= AVDTP_STATE_OPEN) {
- debug("Stream successfully created, after XCASE connect:connect");
+ DBG("Stream successfully created, after XCASE connect:connect");
if (pending->msg) {
DBusMessage *reply;
reply = dbus_message_new_method_return(pending->msg);
g_dbus_send_message(pending->conn, reply);
}
} else {
- debug("Stream setup failed, after XCASE connect:connect");
+ DBG("Stream setup failed, after XCASE connect:connect");
if (pending->msg)
error_failed(pending->conn, pending->msg, "Stream setup failed");
}
@@ -312,7 +312,7 @@ static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep,
pending->id = 0;
if (stream) {
- debug("Stream successfully created");
+ DBG("Stream successfully created");
if (pending->msg) {
DBusMessage *reply;
@@ -330,7 +330,7 @@ static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep,
sink->session = NULL;
if (avdtp_error_type(err) == AVDTP_ERROR_ERRNO
&& avdtp_error_posix_errno(err) != EHOSTDOWN) {
- debug("connect:connect XCASE detected");
+ DBG("connect:connect XCASE detected");
sink->retry_id = g_timeout_add_seconds(STREAM_SETUP_RETRY_TIMER,
stream_setup_retry,
sink);
@@ -339,7 +339,7 @@ static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep,
error_failed(pending->conn, pending->msg, "Stream setup failed");
sink->connect = NULL;
pending_request_free(sink->dev, pending);
- debug("Stream setup failed : %s", avdtp_strerror(err));
+ DBG("Stream setup failed : %s", avdtp_strerror(err));
}
}
@@ -503,7 +503,7 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp
sink->session = NULL;
if (avdtp_error_type(err) == AVDTP_ERROR_ERRNO
&& avdtp_error_posix_errno(err) != EHOSTDOWN) {
- debug("connect:connect XCASE detected");
+ DBG("connect:connect XCASE detected");
sink->retry_id =
g_timeout_add_seconds(STREAM_SETUP_RETRY_TIMER,
stream_setup_retry,
@@ -513,7 +513,7 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp
return;
}
- debug("Discovery complete");
+ DBG("Discovery complete");
if (avdtp_get_seps(session, AVDTP_SEP_TYPE_SINK, AVDTP_MEDIA_TYPE_AUDIO,
A2DP_CODEC_SBC, &lsep, &rsep) < 0) {
@@ -603,7 +603,7 @@ static DBusMessage *sink_connect(DBusConnection *conn,
pending->conn = dbus_connection_ref(conn);
pending->msg = dbus_message_ref(msg);
- debug("stream creation in progress");
+ DBG("stream creation in progress");
return NULL;
}
@@ -759,7 +759,7 @@ static void path_unregister(void *data)
{
struct audio_device *dev = data;
- debug("Unregistered interface %s on path %s",
+ DBG("Unregistered interface %s on path %s",
AUDIO_SINK_INTERFACE, dev->path);
sink_free(dev);
@@ -781,7 +781,7 @@ struct sink *sink_init(struct audio_device *dev)
dev, path_unregister))
return NULL;
- debug("Registered interface %s on path %s",
+ DBG("Registered interface %s on path %s",
AUDIO_SINK_INTERFACE, dev->path);
if (avdtp_callback_id == 0)
diff --git a/audio/source.c b/audio/source.c
index 633ed54..35d8136 100644
--- a/audio/source.c
+++ b/audio/source.c
@@ -169,7 +169,7 @@ static void disconnect_cb(struct btd_device *btd_dev, gboolean removal,
struct audio_device *device = user_data;
struct source *source = device->source;
- debug("Source: disconnect %s", device->path);
+ DBG("Source: disconnect %s", device->path);
avdtp_close(source->session, source->stream, TRUE);
}
@@ -249,14 +249,14 @@ static gboolean stream_setup_retry(gpointer user_data)
source->retry_id = 0;
if (source->stream_state >= AVDTP_STATE_OPEN) {
- debug("Stream successfully created, after XCASE connect:connect");
+ DBG("Stream successfully created, after XCASE connect:connect");
if (pending->msg) {
DBusMessage *reply;
reply = dbus_message_new_method_return(pending->msg);
g_dbus_send_message(pending->conn, reply);
}
} else {
- debug("Stream setup failed, after XCASE connect:connect");
+ DBG("Stream setup failed, after XCASE connect:connect");
if (pending->msg)
error_failed(pending->conn, pending->msg, "Stream setup failed");
}
@@ -279,7 +279,7 @@ static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep,
pending->id = 0;
if (stream) {
- debug("Stream successfully created");
+ DBG("Stream successfully created");
if (pending->msg) {
DBusMessage *reply;
@@ -297,7 +297,7 @@ static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep,
source->session = NULL;
if (avdtp_error_type(err) == AVDTP_ERROR_ERRNO
&& avdtp_error_posix_errno(err) != EHOSTDOWN) {
- debug("connect:connect XCASE detected");
+ DBG("connect:connect XCASE detected");
source->retry_id = g_timeout_add_seconds(STREAM_SETUP_RETRY_TIMER,
stream_setup_retry,
source);
@@ -306,7 +306,7 @@ static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep,
error_failed(pending->conn, pending->msg, "Stream setup failed");
source->connect = NULL;
pending_request_free(source->dev, pending);
- debug("Stream setup failed : %s", avdtp_strerror(err));
+ DBG("Stream setup failed : %s", avdtp_strerror(err));
}
}
@@ -464,7 +464,7 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp
source->session = NULL;
if (avdtp_error_type(err) == AVDTP_ERROR_ERRNO
&& avdtp_error_posix_errno(err) != EHOSTDOWN) {
- debug("connect:connect XCASE detected");
+ DBG("connect:connect XCASE detected");
source->retry_id =
g_timeout_add_seconds(STREAM_SETUP_RETRY_TIMER,
stream_setup_retry,
@@ -474,7 +474,7 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp
return;
}
- debug("Discovery complete");
+ DBG("Discovery complete");
if (avdtp_get_seps(session, AVDTP_SEP_TYPE_SOURCE, AVDTP_MEDIA_TYPE_AUDIO,
A2DP_CODEC_SBC, &lsep, &rsep) < 0) {
@@ -565,7 +565,7 @@ static DBusMessage *source_connect(DBusConnection *conn,
pending->conn = dbus_connection_ref(conn);
pending->msg = dbus_message_ref(msg);
- debug("stream creation in progress");
+ DBG("stream creation in progress");
return NULL;
}
@@ -685,7 +685,7 @@ static void path_unregister(void *data)
{
struct audio_device *dev = data;
- debug("Unregistered interface %s on path %s",
+ DBG("Unregistered interface %s on path %s",
AUDIO_SOURCE_INTERFACE, dev->path);
source_free(dev);
@@ -707,7 +707,7 @@ struct source *source_init(struct audio_device *dev)
dev, path_unregister))
return NULL;
- debug("Registered interface %s on path %s",
+ DBG("Registered interface %s on path %s",
AUDIO_SOURCE_INTERFACE, dev->path);
if (avdtp_callback_id == 0)
diff --git a/audio/telephony-dummy.c b/audio/telephony-dummy.c
index 85a6ef3..06cb798 100644
--- a/audio/telephony-dummy.c
+++ b/audio/telephony-dummy.c
@@ -77,12 +77,12 @@ static inline DBusMessage *invalid_args(DBusMessage *msg)
void telephony_device_connected(void *telephony_device)
{
- debug("telephony-dummy: device %p connected", telephony_device);
+ DBG("telephony-dummy: device %p connected", telephony_device);
}
void telephony_device_disconnected(void *telephony_device)
{
- debug("telephony-dummy: device %p disconnected", telephony_device);
+ DBG("telephony-dummy: device %p disconnected", telephony_device);
events_enabled = FALSE;
}
@@ -147,7 +147,7 @@ void telephony_dial_number_req(void *telephony_device, const char *number)
g_free(active_call_number);
active_call_number = g_strdup(number);
- debug("telephony-dummy: dial request to %s", active_call_number);
+ DBG("telephony-dummy: dial request to %s", active_call_number);
telephony_dial_number_rsp(telephony_device, CME_ERROR_NONE);
@@ -163,13 +163,13 @@ void telephony_dial_number_req(void *telephony_device, const char *number)
void telephony_transmit_dtmf_req(void *telephony_device, char tone)
{
- debug("telephony-dummy: transmit dtmf: %c", tone);
+ DBG("telephony-dummy: transmit dtmf: %c", tone);
telephony_transmit_dtmf_rsp(telephony_device, CME_ERROR_NONE);
}
void telephony_subscriber_number_req(void *telephony_device)
{
- debug("telephony-dummy: subscriber number request");
+ DBG("telephony-dummy: subscriber number request");
if (subscriber_number)
telephony_subscriber_number_ind(subscriber_number,
NUMBER_TYPE_TELEPHONY,
@@ -179,7 +179,7 @@ void telephony_subscriber_number_req(void *telephony_device)
void telephony_list_current_calls_req(void *telephony_device)
{
- debug("telephony-dummy: list current calls request");
+ DBG("telephony-dummy: list current calls request");
if (active_call_number)
telephony_list_current_call_ind(1, active_call_dir,
active_call_status,
@@ -198,13 +198,13 @@ void telephony_operator_selection_req(void *telephony_device)
void telephony_call_hold_req(void *telephony_device, const char *cmd)
{
- debug("telephony-dymmy: got call hold request %s", cmd);
+ DBG("telephony-dymmy: got call hold request %s", cmd);
telephony_call_hold_rsp(telephony_device, CME_ERROR_NONE);
}
void telephony_nr_and_ec_req(void *telephony_device, gboolean enable)
{
- debug("telephony-dummy: got %s NR and EC request",
+ DBG("telephony-dummy: got %s NR and EC request",
enable ? "enable" : "disable");
telephony_nr_and_ec_rsp(telephony_device, CME_ERROR_NONE);
@@ -212,7 +212,7 @@ void telephony_nr_and_ec_req(void *telephony_device, gboolean enable)
void telephony_voice_dial_req(void *telephony_device, gboolean enable)
{
- debug("telephony-dummy: got %s voice dial request",
+ DBG("telephony-dummy: got %s voice dial request",
enable ? "enable" : "disable");
g_dbus_emit_signal(connection, TELEPHONY_DUMMY_PATH,
@@ -224,7 +224,7 @@ void telephony_voice_dial_req(void *telephony_device, gboolean enable)
void telephony_key_press_req(void *telephony_device, const char *keys)
{
- debug("telephony-dummy: got key press request for %s", keys);
+ DBG("telephony-dummy: got key press request for %s", keys);
telephony_key_press_rsp(telephony_device, CME_ERROR_NONE);
}
@@ -238,7 +238,7 @@ static DBusMessage *outgoing_call(DBusConnection *conn, DBusMessage *msg,
DBUS_TYPE_INVALID))
return invalid_args(msg);
- debug("telephony-dummy: outgoing call to %s", number);
+ DBG("telephony-dummy: outgoing call to %s", number);
g_free(active_call_number);
active_call_number = g_strdup(number);
@@ -263,7 +263,7 @@ static DBusMessage *incoming_call(DBusConnection *conn, DBusMessage *msg,
DBUS_TYPE_INVALID))
return invalid_args(msg);
- debug("telephony-dummy: incoming call to %s", number);
+ DBG("telephony-dummy: incoming call to %s", number);
g_free(active_call_number);
active_call_number = g_strdup(number);
@@ -282,7 +282,7 @@ static DBusMessage *incoming_call(DBusConnection *conn, DBusMessage *msg,
static DBusMessage *cancel_call(DBusConnection *conn, DBusMessage *msg,
void *data)
{
- debug("telephony-dummy: cancel call");
+ DBG("telephony-dummy: cancel call");
g_free(active_call_number);
active_call_number = NULL;
@@ -314,7 +314,7 @@ static DBusMessage *signal_strength(DBusConnection *conn, DBusMessage *msg,
telephony_update_indicator(dummy_indicators, "signal", strength);
- debug("telephony-dummy: signal strength set to %u", strength);
+ DBG("telephony-dummy: signal strength set to %u", strength);
return dbus_message_new_method_return(msg);
}
@@ -333,7 +333,7 @@ static DBusMessage *battery_level(DBusConnection *conn, DBusMessage *msg,
telephony_update_indicator(dummy_indicators, "battchg", level);
- debug("telephony-dummy: battery level set to %u", level);
+ DBG("telephony-dummy: battery level set to %u", level);
return dbus_message_new_method_return(msg);
}
@@ -352,7 +352,7 @@ static DBusMessage *roaming_status(DBusConnection *conn, DBusMessage *msg,
telephony_update_indicator(dummy_indicators, "roam", val);
- debug("telephony-dummy: roaming status set to %d", val);
+ DBG("telephony-dummy: roaming status set to %d", val);
return dbus_message_new_method_return(msg);
}
@@ -371,7 +371,7 @@ static DBusMessage *registration_status(DBusConnection *conn, DBusMessage *msg,
telephony_update_indicator(dummy_indicators, "service", val);
- debug("telephony-dummy: registration status set to %d", val);
+ DBG("telephony-dummy: registration status set to %d", val);
return dbus_message_new_method_return(msg);
}
@@ -389,7 +389,7 @@ static DBusMessage *set_subscriber_number(DBusConnection *conn,
g_free(subscriber_number);
subscriber_number = g_strdup(number);
- debug("telephony-dummy: subscriber number set to %s", number);
+ DBG("telephony-dummy: subscriber number set to %s", number);
return dbus_message_new_method_return(msg);
}
diff --git a/audio/telephony-maemo5.c b/audio/telephony-maemo5.c
index e6aa0e4..4d0134c 100644
--- a/audio/telephony-maemo5.c
+++ b/audio/telephony-maemo5.c
@@ -318,7 +318,7 @@ static int release_conference(void)
{
DBusMessage *msg;
- debug("telephony-maemo: releasing conference call");
+ DBG("telephony-maemo: releasing conference call");
msg = dbus_message_new_method_call(CSD_CALL_BUS_NAME,
CSD_CALL_CONFERENCE_PATH,
@@ -488,7 +488,7 @@ void telephony_device_connected(void *telephony_device)
{
struct csd_call *coming;
- debug("telephony-maemo: device %p connected", telephony_device);
+ DBG("telephony-maemo: device %p connected", telephony_device);
coming = find_call_with_status(CSD_CALL_STATUS_MT_ALERTING);
if (coming) {
@@ -503,7 +503,7 @@ void telephony_device_connected(void *telephony_device)
void telephony_device_disconnected(void *telephony_device)
{
- debug("telephony-maemo: device %p disconnected", telephony_device);
+ DBG("telephony-maemo: device %p disconnected", telephony_device);
events_enabled = FALSE;
}
@@ -525,7 +525,7 @@ void telephony_response_and_hold_req(void *telephony_device, int rh)
void telephony_last_dialed_number_req(void *telephony_device)
{
- debug("telephony-maemo: last dialed number request");
+ DBG("telephony-maemo: last dialed number request");
if (last_dialed_number)
telephony_dial_number_req(telephony_device,
@@ -646,7 +646,7 @@ void telephony_dial_number_req(void *telephony_device, const char *number)
uint32_t flags = callerid;
int ret;
- debug("telephony-maemo: dial request to %s", number);
+ DBG("telephony-maemo: dial request to %s", number);
if (strncmp(number, "*31#", 4) == 0) {
number += 4;
@@ -686,7 +686,7 @@ void telephony_transmit_dtmf_req(void *telephony_device, char tone)
int ret;
char buf[2] = { tone, '\0' }, *buf_ptr = buf;
- debug("telephony-maemo: transmit dtmf: %s", buf);
+ DBG("telephony-maemo: transmit dtmf: %s", buf);
ret = send_method_call(CSD_CALL_BUS_NAME, CSD_CALL_PATH,
CSD_CALL_INTERFACE, "SendDTMF",
@@ -704,7 +704,7 @@ void telephony_transmit_dtmf_req(void *telephony_device, char tone)
void telephony_subscriber_number_req(void *telephony_device)
{
- debug("telephony-maemo: subscriber number request");
+ DBG("telephony-maemo: subscriber number request");
if (msisdn)
telephony_subscriber_number_ind(msisdn,
number_type(msisdn),
@@ -755,7 +755,7 @@ void telephony_list_current_calls_req(void *telephony_device)
GSList *l;
int i;
- debug("telephony-maemo: list current calls request");
+ DBG("telephony-maemo: list current calls request");
for (l = calls, i = 1; l != NULL; l = l->next, i++) {
struct csd_call *call = l->data;
@@ -806,7 +806,7 @@ void telephony_call_hold_req(void *telephony_device, const char *cmd)
struct csd_call *call;
int err = 0;
- debug("telephony-maemo: got call hold request %s", cmd);
+ DBG("telephony-maemo: got call hold request %s", cmd);
if (strlen(cmd) > 1)
idx = &cmd[1];
@@ -867,7 +867,7 @@ void telephony_call_hold_req(void *telephony_device, const char *cmd)
err = call_transfer();
break;
default:
- debug("Unknown call hold request");
+ DBG("Unknown call hold request");
break;
}
@@ -880,7 +880,7 @@ void telephony_call_hold_req(void *telephony_device, const char *cmd)
void telephony_nr_and_ec_req(void *telephony_device, gboolean enable)
{
- debug("telephony-maemo: got %s NR and EC request",
+ DBG("telephony-maemo: got %s NR and EC request",
enable ? "enable" : "disable");
telephony_nr_and_ec_rsp(telephony_device, CME_ERROR_NONE);
}
@@ -890,7 +890,7 @@ void telephony_key_press_req(void *telephony_device, const char *keys)
struct csd_call *active, *waiting;
int err;
- debug("telephony-maemo: got key press request for %s", keys);
+ DBG("telephony-maemo: got key press request for %s", keys);
waiting = find_call_with_status(CSD_CALL_STATUS_COMING);
if (!waiting)
@@ -916,7 +916,7 @@ void telephony_key_press_req(void *telephony_device, const char *keys)
void telephony_voice_dial_req(void *telephony_device, gboolean enable)
{
- debug("telephony-maemo: got %s voice dial request",
+ DBG("telephony-maemo: got %s voice dial request",
enable ? "enable" : "disable");
telephony_voice_dial_rsp(telephony_device, CME_ERROR_NOT_SUPPORTED);
@@ -942,7 +942,7 @@ static void handle_incoming_call(DBusMessage *msg)
return;
}
- debug("Incoming call to %s from number %s", call_path, number);
+ DBG("Incoming call to %s from number %s", call_path, number);
g_free(call->number);
call->number = g_strdup(number);
@@ -978,7 +978,7 @@ static void handle_outgoing_call(DBusMessage *msg)
return;
}
- debug("Outgoing call from %s to number %s", call_path, number);
+ DBG("Outgoing call from %s to number %s", call_path, number);
g_free(call->number);
call->number = g_strdup(number);
@@ -1002,7 +1002,7 @@ static gboolean create_timeout(gpointer user_data)
static void handle_create_requested(DBusMessage *msg)
{
- debug("Call.CreateRequested()");
+ DBG("Call.CreateRequested()");
if (create_request_timer)
g_source_remove(create_request_timer);
@@ -1040,11 +1040,11 @@ static void handle_call_status(DBusMessage *msg, const char *call_path)
return;
}
- debug("Call %s changed from %s to %s", call_path,
+ DBG("Call %s changed from %s to %s", call_path,
call_status_str[call->status], call_status_str[status]);
if (call->status == (int) status) {
- debug("Ignoring CSD Call state change to existing state");
+ DBG("Ignoring CSD Call state change to existing state");
return;
}
@@ -1182,7 +1182,7 @@ static void handle_conference(DBusMessage *msg, gboolean joined)
return;
}
- debug("Call %s %s the conference", path, joined ? "joined" : "left");
+ DBG("Call %s %s the conference", path, joined ? "joined" : "left");
call->conference = joined;
}
@@ -1227,7 +1227,7 @@ static void get_operator_name_reply(DBusPendingCall *pending_call,
g_free(net.operator_name);
net.operator_name = g_strdup(name);
- debug("telephony-maemo: operator name updated: %s", name);
+ DBG("telephony-maemo: operator name updated: %s", name);
done:
dbus_message_unref(reply);
@@ -1335,7 +1335,7 @@ static void update_signal_strength(uint8_t signals_bar)
int signal;
if (signals_bar > 100) {
- debug("signals_bar greater than expected: %u", signals_bar);
+ DBG("signals_bar greater than expected: %u", signals_bar);
signals_bar = 100;
}
@@ -1349,7 +1349,7 @@ static void update_signal_strength(uint8_t signals_bar)
net.signals_bar = signals_bar;
- debug("Signal strength updated: %u/100, %d/5", signals_bar, signal);
+ DBG("Signal strength updated: %u/100, %d/5", signals_bar, signal);
}
static void handle_signal_strength_change(DBusMessage *msg)
@@ -1425,13 +1425,13 @@ static void hal_battery_level_reply(DBusPendingCall *call, void *user_data)
*value = (int) level;
if (value == &battchg_last)
- debug("telephony-maemo: battery.charge_level.last_full is %d",
+ DBG("telephony-maemo: battery.charge_level.last_full is %d",
*value);
else if (value == &battchg_design)
- debug("telephony-maemo: battery.charge_level.design is %d",
+ DBG("telephony-maemo: battery.charge_level.design is %d",
*value);
else
- debug("telephony-maemo: battery.charge_level.current is %d",
+ DBG("telephony-maemo: battery.charge_level.current is %d",
*value);
if ((battchg_design > 0 || battchg_last > 0) && battchg_cur >= 0) {
@@ -1559,7 +1559,7 @@ static void parse_call_list(DBusMessageIter *iter)
call->object_path = g_strdup(object_path);
call->status = (int) status;
calls = g_slist_append(calls, call);
- debug("telephony-maemo: new csd call instance at %s",
+ DBG("telephony-maemo: new csd call instance at %s",
object_path);
}
@@ -1762,7 +1762,7 @@ static void hal_find_device_reply(DBusPendingCall *call, void *user_data)
dbus_message_iter_get_basic(&sub, &path);
- debug("telephony-maemo: found battery device at %s", path);
+ DBG("telephony-maemo: found battery device at %s", path);
snprintf(match_string, sizeof(match_string),
"type='signal',"
@@ -1820,11 +1820,11 @@ static void phonebook_read_reply(DBusPendingCall *call, void *user_data)
if (number_type == &msisdn) {
g_free(msisdn);
msisdn = g_strdup(number);
- debug("Got MSISDN %s (%s)", number, name);
+ DBG("Got MSISDN %s (%s)", number, name);
} else {
g_free(vmbx);
vmbx = g_strdup(number);
- debug("Got voice mailbox number %s (%s)", number, name);
+ DBG("Got voice mailbox number %s (%s)", number, name);
}
done:
@@ -1957,7 +1957,7 @@ static DBusMessage *set_callerid(DBusConnection *conn, DBusMessage *msg,
g_str_equal(callerid_setting, "none")) {
save_callerid_to_file(callerid_setting);
callerid = get_callflag(callerid_setting);
- debug("telephony-maemo setting callerid flag: %s",
+ DBG("telephony-maemo setting callerid flag: %s",
callerid_setting);
return dbus_message_new_method_return(msg);
}
@@ -1983,7 +1983,7 @@ static void handle_modem_state(DBusMessage *msg)
return;
}
- debug("SSC modem state: %s", state);
+ DBG("SSC modem state: %s", state);
if (calls != NULL || get_calls_active)
return;
@@ -2088,7 +2088,7 @@ int telephony_init(void)
TELEPHONY_MAEMO_INTERFACE, TELEPHONY_MAEMO_PATH);
}
- debug("telephony-maemo registering %s interface on path %s",
+ DBG("telephony-maemo registering %s interface on path %s",
TELEPHONY_MAEMO_INTERFACE, TELEPHONY_MAEMO_PATH);
telephony_ready_ind(features, maemo_indicators, response_and_hold,
diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index 3fc2015..41950be 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
@@ -274,7 +274,7 @@ static int release_conference(void)
{
DBusMessage *msg;
- debug("telephony-maemo6: releasing conference call");
+ DBG("telephony-maemo6: releasing conference call");
msg = dbus_message_new_method_call(CSD_CALL_BUS_NAME,
CSD_CALL_CONFERENCE_PATH,
@@ -444,7 +444,7 @@ void telephony_device_connected(void *telephony_device)
{
struct csd_call *coming;
- debug("telephony-maemo6: device %p connected", telephony_device);
+ DBG("telephony-maemo6: device %p connected", telephony_device);
coming = find_call_with_status(CSD_CALL_STATUS_MT_ALERTING);
if (coming) {
@@ -459,7 +459,7 @@ void telephony_device_connected(void *telephony_device)
void telephony_device_disconnected(void *telephony_device)
{
- debug("telephony-maemo6: device %p disconnected", telephony_device);
+ DBG("telephony-maemo6: device %p disconnected", telephony_device);
events_enabled = FALSE;
}
@@ -481,7 +481,7 @@ void telephony_response_and_hold_req(void *telephony_device, int rh)
void telephony_last_dialed_number_req(void *telephony_device)
{
- debug("telephony-maemo6: last dialed number request");
+ DBG("telephony-maemo6: last dialed number request");
if (last_dialed_number)
telephony_dial_number_req(telephony_device,
@@ -602,7 +602,7 @@ void telephony_dial_number_req(void *telephony_device, const char *number)
uint32_t flags = callerid;
int ret;
- debug("telephony-maemo6: dial request to %s", number);
+ DBG("telephony-maemo6: dial request to %s", number);
if (strncmp(number, "*31#", 4) == 0) {
number += 4;
@@ -642,7 +642,7 @@ void telephony_transmit_dtmf_req(void *telephony_device, char tone)
int ret;
char buf[2] = { tone, '\0' }, *buf_ptr = buf;
- debug("telephony-maemo6: transmit dtmf: %s", buf);
+ DBG("telephony-maemo6: transmit dtmf: %s", buf);
ret = send_method_call(CSD_CALL_BUS_NAME, CSD_CALL_PATH,
CSD_CALL_INTERFACE, "SendDTMF",
@@ -660,7 +660,7 @@ void telephony_transmit_dtmf_req(void *telephony_device, char tone)
void telephony_subscriber_number_req(void *telephony_device)
{
- debug("telephony-maemo6: subscriber number request");
+ DBG("telephony-maemo6: subscriber number request");
if (msisdn)
telephony_subscriber_number_ind(msisdn,
number_type(msisdn),
@@ -711,7 +711,7 @@ void telephony_list_current_calls_req(void *telephony_device)
GSList *l;
int i;
- debug("telephony-maemo6: list current calls request");
+ DBG("telephony-maemo6: list current calls request");
for (l = calls, i = 1; l != NULL; l = l->next, i++) {
struct csd_call *call = l->data;
@@ -762,7 +762,7 @@ void telephony_call_hold_req(void *telephony_device, const char *cmd)
struct csd_call *call;
int err = 0;
- debug("telephony-maemo6: got call hold request %s", cmd);
+ DBG("telephony-maemo6: got call hold request %s", cmd);
if (strlen(cmd) > 1)
idx = &cmd[1];
@@ -823,7 +823,7 @@ void telephony_call_hold_req(void *telephony_device, const char *cmd)
err = call_transfer();
break;
default:
- debug("Unknown call hold request");
+ DBG("Unknown call hold request");
break;
}
@@ -836,7 +836,7 @@ void telephony_call_hold_req(void *telephony_device, const char *cmd)
void telephony_nr_and_ec_req(void *telephony_device, gboolean enable)
{
- debug("telephony-maemo6: got %s NR and EC request",
+ DBG("telephony-maemo6: got %s NR and EC request",
enable ? "enable" : "disable");
telephony_nr_and_ec_rsp(telephony_device, CME_ERROR_NONE);
}
@@ -846,7 +846,7 @@ void telephony_key_press_req(void *telephony_device, const char *keys)
struct csd_call *active, *waiting;
int err;
- debug("telephony-maemo6: got key press request for %s", keys);
+ DBG("telephony-maemo6: got key press request for %s", keys);
waiting = find_call_with_status(CSD_CALL_STATUS_COMING);
if (!waiting)
@@ -872,7 +872,7 @@ void telephony_key_press_req(void *telephony_device, const char *keys)
void telephony_voice_dial_req(void *telephony_device, gboolean enable)
{
- debug("telephony-maemo6: got %s voice dial request",
+ DBG("telephony-maemo6: got %s voice dial request",
enable ? "enable" : "disable");
telephony_voice_dial_rsp(telephony_device, CME_ERROR_NOT_SUPPORTED);
@@ -898,7 +898,7 @@ static void handle_incoming_call(DBusMessage *msg)
return;
}
- debug("Incoming call to %s from number %s", call_path, number);
+ DBG("Incoming call to %s from number %s", call_path, number);
g_free(call->number);
call->number = g_strdup(number);
@@ -934,7 +934,7 @@ static void handle_outgoing_call(DBusMessage *msg)
return;
}
- debug("Outgoing call from %s to number %s", call_path, number);
+ DBG("Outgoing call from %s to number %s", call_path, number);
g_free(call->number);
call->number = g_strdup(number);
@@ -958,7 +958,7 @@ static gboolean create_timeout(gpointer user_data)
static void handle_create_requested(DBusMessage *msg)
{
- debug("Call.CreateRequested()");
+ DBG("Call.CreateRequested()");
if (create_request_timer)
g_source_remove(create_request_timer);
@@ -996,11 +996,11 @@ static void handle_call_status(DBusMessage *msg, const char *call_path)
return;
}
- debug("Call %s changed from %s to %s", call_path,
+ DBG("Call %s changed from %s to %s", call_path,
call_status_str[call->status], call_status_str[status]);
if (call->status == (int) status) {
- debug("Ignoring CSD Call state change to existing state");
+ DBG("Ignoring CSD Call state change to existing state");
return;
}
@@ -1138,7 +1138,7 @@ static void handle_conference(DBusMessage *msg, gboolean joined)
return;
}
- debug("Call %s %s the conference", path, joined ? "joined" : "left");
+ DBG("Call %s %s the conference", path, joined ? "joined" : "left");
call->conference = joined;
}
@@ -1210,7 +1210,7 @@ static void update_registration_status(const char *status)
net.status = new_status;
- debug("telephony-maemo6: registration status changed: %s", status);
+ DBG("telephony-maemo6: registration status changed: %s", status);
}
static void handle_registration_changed(DBusMessage *msg)
@@ -1234,7 +1234,7 @@ static void update_signal_strength(int32_t signals_bar)
if (signals_bar < 0)
signals_bar = 0;
else if (signals_bar > 100) {
- debug("signals_bar greater than expected: %u", signals_bar);
+ DBG("signals_bar greater than expected: %u", signals_bar);
signals_bar = 100;
}
@@ -1248,7 +1248,7 @@ static void update_signal_strength(int32_t signals_bar)
net.signals_bar = signals_bar;
- debug("telephony-maemo6: signal strength updated: %u/100, %d/5", signals_bar, signal);
+ DBG("telephony-maemo6: signal strength updated: %u/100, %d/5", signals_bar, signal);
}
static void handle_signal_strength_changed(DBusMessage *msg)
@@ -1318,13 +1318,13 @@ static void hal_battery_level_reply(DBusPendingCall *call, void *user_data)
*value = (int) level;
if (value == &battchg_last)
- debug("telephony-maemo6: battery.charge_level.last_full is %d",
+ DBG("telephony-maemo6: battery.charge_level.last_full is %d",
*value);
else if (value == &battchg_design)
- debug("telephony-maemo6: battery.charge_level.design is %d",
+ DBG("telephony-maemo6: battery.charge_level.design is %d",
*value);
else
- debug("telephony-maemo6: battery.charge_level.current is %d",
+ DBG("telephony-maemo6: battery.charge_level.current is %d",
*value);
if ((battchg_design > 0 || battchg_last > 0) && battchg_cur >= 0) {
@@ -1452,7 +1452,7 @@ static void parse_call_list(DBusMessageIter *iter)
call->object_path = g_strdup(object_path);
call->status = (int) status;
calls = g_slist_append(calls, call);
- debug("telephony-maemo6: new csd call instance at %s",
+ DBG("telephony-maemo6: new csd call instance at %s",
object_path);
}
@@ -1484,7 +1484,7 @@ static void update_operator_name(const char *name)
g_free(net.operator_name);
net.operator_name = g_strdup(name);
- debug("telephony-maemo6: operator name updated: %s", name);
+ DBG("telephony-maemo6: operator name updated: %s", name);
}
static void get_property_reply(DBusPendingCall *call, void *user_data)
@@ -1634,7 +1634,7 @@ static void hal_find_device_reply(DBusPendingCall *call, void *user_data)
dbus_message_iter_get_basic(&sub, &path);
- debug("telephony-maemo6: found battery device at %s", path);
+ DBG("telephony-maemo6: found battery device at %s", path);
snprintf(match_string, sizeof(match_string),
"type='signal',"
@@ -1689,11 +1689,11 @@ static void phonebook_read_reply(DBusPendingCall *call, void *user_data)
if (number_type == &msisdn) {
g_free(msisdn);
msisdn = g_strdup(number);
- debug("Got MSISDN %s (%s)", number, name);
+ DBG("Got MSISDN %s (%s)", number, name);
} else {
g_free(vmbx);
vmbx = g_strdup(number);
- debug("Got voice mailbox number %s (%s)", number, name);
+ DBG("Got voice mailbox number %s (%s)", number, name);
}
done:
@@ -1818,7 +1818,7 @@ static DBusMessage *set_callerid(DBusConnection *conn, DBusMessage *msg,
g_str_equal(callerid_setting, "none")) {
save_callerid_to_file(callerid_setting);
callerid = get_callflag(callerid_setting);
- debug("telephony-maemo6 setting callerid flag: %s",
+ DBG("telephony-maemo6 setting callerid flag: %s",
callerid_setting);
return dbus_message_new_method_return(msg);
}
@@ -1844,7 +1844,7 @@ static void handle_modem_state(DBusMessage *msg)
return;
}
- debug("SSC modem state: %s", state);
+ DBG("SSC modem state: %s", state);
if (calls != NULL || get_calls_active)
return;
@@ -1959,7 +1959,7 @@ int telephony_init(void)
TELEPHONY_MAEMO_INTERFACE, TELEPHONY_MAEMO_PATH);
}
- debug("telephony-maemo6 registering %s interface on path %s",
+ DBG("telephony-maemo6 registering %s interface on path %s",
TELEPHONY_MAEMO_INTERFACE, TELEPHONY_MAEMO_PATH);
telephony_ready_ind(features, maemo_indicators, response_and_hold,
diff --git a/audio/telephony-ofono.c b/audio/telephony-ofono.c
index 20d002c..e710ce8 100644
--- a/audio/telephony-ofono.c
+++ b/audio/telephony-ofono.c
@@ -138,12 +138,12 @@ static struct voice_call *find_vc_with_status(int status)
void telephony_device_connected(void *telephony_device)
{
- debug("telephony-ofono: device %p connected", telephony_device);
+ DBG("telephony-ofono: device %p connected", telephony_device);
}
void telephony_device_disconnected(void *telephony_device)
{
- debug("telephony-ofono: device %p disconnected", telephony_device);
+ DBG("telephony-ofono: device %p disconnected", telephony_device);
events_enabled = FALSE;
}
@@ -165,7 +165,7 @@ void telephony_response_and_hold_req(void *telephony_device, int rh)
void telephony_last_dialed_number_req(void *telephony_device)
{
- debug("telephony-ofono: last dialed number request");
+ DBG("telephony-ofono: last dialed number request");
if (last_dialed_number)
telephony_dial_number_req(telephony_device, last_dialed_number);
@@ -279,7 +279,7 @@ void telephony_dial_number_req(void *telephony_device, const char *number)
const char *clir;
int ret;
- debug("telephony-ofono: dial request to %s", number);
+ DBG("telephony-ofono: dial request to %s", number);
if (!modem_obj_path) {
telephony_dial_number_rsp(telephony_device,
@@ -315,7 +315,7 @@ void telephony_transmit_dtmf_req(void *telephony_device, char tone)
char *tone_string;
int ret;
- debug("telephony-ofono: transmit dtmf: %c", tone);
+ DBG("telephony-ofono: transmit dtmf: %c", tone);
if (!modem_obj_path) {
telephony_transmit_dtmf_rsp(telephony_device,
@@ -340,7 +340,7 @@ void telephony_transmit_dtmf_req(void *telephony_device, char tone)
void telephony_subscriber_number_req(void *telephony_device)
{
- debug("telephony-ofono: subscriber number request");
+ DBG("telephony-ofono: subscriber number request");
if (subscriber_number)
telephony_subscriber_number_ind(subscriber_number,
@@ -354,7 +354,7 @@ void telephony_list_current_calls_req(void *telephony_device)
GSList *l;
int i;
- debug("telephony-ofono: list current calls request");
+ DBG("telephony-ofono: list current calls request");
for (l = calls, i = 1; l != NULL; l = l->next, i++) {
struct voice_call *vc = l->data;
@@ -372,7 +372,7 @@ void telephony_list_current_calls_req(void *telephony_device)
void telephony_operator_selection_req(void *telephony_device)
{
- debug("telephony-ofono: operator selection request");
+ DBG("telephony-ofono: operator selection request");
telephony_operator_selection_ind(OPERATOR_MODE_AUTO,
net.operator_name ? net.operator_name : "");
@@ -381,13 +381,13 @@ void telephony_operator_selection_req(void *telephony_device)
void telephony_call_hold_req(void *telephony_device, const char *cmd)
{
- debug("telephony-ofono: got call hold request %s", cmd);
+ DBG("telephony-ofono: got call hold request %s", cmd);
telephony_call_hold_rsp(telephony_device, CME_ERROR_NONE);
}
void telephony_nr_and_ec_req(void *telephony_device, gboolean enable)
{
- debug("telephony-ofono: got %s NR and EC request",
+ DBG("telephony-ofono: got %s NR and EC request",
enable ? "enable" : "disable");
telephony_nr_and_ec_rsp(telephony_device, CME_ERROR_NONE);
@@ -395,13 +395,13 @@ void telephony_nr_and_ec_req(void *telephony_device, gboolean enable)
void telephony_key_press_req(void *telephony_device, const char *keys)
{
- debug("telephony-ofono: got key press request for %s", keys);
+ DBG("telephony-ofono: got key press request for %s", keys);
telephony_key_press_rsp(telephony_device, CME_ERROR_NONE);
}
void telephony_voice_dial_req(void *telephony_device, gboolean enable)
{
- debug("telephony-ofono: got %s voice dial request",
+ DBG("telephony-ofono: got %s voice dial request",
enable ? "enable" : "disable");
telephony_voice_dial_rsp(telephony_device, CME_ERROR_NOT_SUPPORTED);
@@ -442,7 +442,7 @@ static void handle_registration_property(const char *property, DBusMessageIter s
if (g_str_equal(property, "Status")) {
dbus_message_iter_get_basic(&sub, &status);
- debug("Status is %s", status);
+ DBG("Status is %s", status);
if (g_str_equal(status, "registered")) {
net.status = NETWORK_REG_STATUS_HOME;
telephony_update_indicator(ofono_indicators,
@@ -464,12 +464,12 @@ static void handle_registration_property(const char *property, DBusMessageIter s
}
} else if (g_str_equal(property, "Operator")) {
dbus_message_iter_get_basic(&sub, &operator);
- debug("Operator is %s", operator);
+ DBG("Operator is %s", operator);
g_free(net.operator_name);
net.operator_name = g_strdup(operator);
} else if (g_str_equal(property, "SignalStrength")) {
dbus_message_iter_get_basic(&sub, &signals_bar);
- debug("SignalStrength is %d", signals_bar);
+ DBG("SignalStrength is %d", signals_bar);
net.signals_bar = signals_bar;
telephony_update_indicator(ofono_indicators, "signal",
(signals_bar + 20) / 21);
@@ -560,7 +560,7 @@ static void list_modem_reply(DBusPendingCall *call, void *user_data)
char *property, *modem_obj_path_local;
int ret;
- debug("list_modem_reply is called\n");
+ DBG("list_modem_reply is called\n");
reply = dbus_pending_call_steal_reply(call);
dbus_error_init(&err);
@@ -598,7 +598,7 @@ static void list_modem_reply(DBusPendingCall *call, void *user_data)
dbus_message_iter_get_basic(&sub, &modem_obj_path_local);
modem_obj_path = g_strdup(modem_obj_path_local);
- debug("modem_obj_path is %p, %s\n", modem_obj_path,
+ DBG("modem_obj_path is %p, %s\n", modem_obj_path,
modem_obj_path);
dbus_message_iter_next(&sub);
}
@@ -624,7 +624,7 @@ static gboolean handle_registration_property_changed(DBusConnection *conn,
return TRUE;
}
dbus_message_iter_get_basic(&iter, &property);
- debug("in handle_registration_property_changed(),"
+ DBG("in handle_registration_property_changed(),"
" the property is %s", property);
dbus_message_iter_next(&iter);
@@ -643,7 +643,7 @@ static void vc_getproperties_reply(DBusPendingCall *call, void *user_data)
const char *path = user_data;
struct voice_call *vc;
- debug("in vc_getproperties_reply");
+ DBG("in vc_getproperties_reply");
reply = dbus_pending_call_steal_reply(call);
dbus_error_init(&err);
@@ -694,11 +694,11 @@ static void vc_getproperties_reply(DBusPendingCall *call, void *user_data)
dbus_message_iter_recurse(&iter_property, &sub);
if (g_str_equal(property, "LineIdentification")) {
dbus_message_iter_get_basic(&sub, &cli);
- debug("in vc_getproperties_reply(), cli is %s", cli);
+ DBG("in vc_getproperties_reply(), cli is %s", cli);
vc->number = g_strdup(cli);
} else if (g_str_equal(property, "State")) {
dbus_message_iter_get_basic(&sub, &state);
- debug("in vc_getproperties_reply(),"
+ DBG("in vc_getproperties_reply(),"
" state is %s", state);
if (g_str_equal(state, "incoming"))
vc->status = CALL_STATUS_INCOMING;
@@ -738,7 +738,7 @@ static void vc_getproperties_reply(DBusPendingCall *call, void *user_data)
EV_CALLSETUP_ALERTING);
break;
case CALL_STATUS_WAITING:
- debug("in CALL_STATUS_WAITING: case");
+ DBG("in CALL_STATUS_WAITING: case");
vc->originating = FALSE;
telephony_update_indicator(ofono_indicators, "callsetup",
EV_CALLSETUP_INCOMING);
@@ -768,7 +768,7 @@ static gboolean handle_vc_property_changed(DBusConnection *conn,
DBusMessageIter iter, sub;
const char *property, *state;
- debug("in handle_vc_property_changed, obj_path is %s", obj_path);
+ DBG("in handle_vc_property_changed, obj_path is %s", obj_path);
dbus_message_iter_init(msg, &iter);
@@ -778,13 +778,13 @@ static gboolean handle_vc_property_changed(DBusConnection *conn,
}
dbus_message_iter_get_basic(&iter, &property);
- debug("in handle_vc_property_changed(), the property is %s", property);
+ DBG("in handle_vc_property_changed(), the property is %s", property);
dbus_message_iter_next(&iter);
dbus_message_iter_recurse(&iter, &sub);
if (g_str_equal(property, "State")) {
dbus_message_iter_get_basic(&sub, &state);
- debug("in handle_vc_property_changed(), State is %s", state);
+ DBG("in handle_vc_property_changed(), State is %s", state);
if (g_str_equal(state, "disconnected")) {
printf("in disconnected case\n");
if (vc->status == CALL_STATUS_ACTIVE)
@@ -806,12 +806,12 @@ static gboolean handle_vc_property_changed(DBusConnection *conn,
if (vc->status == CALL_STATUS_INCOMING)
telephony_calling_stopped_ind();
vc->status = CALL_STATUS_ACTIVE;
- debug("vc status is CALL_STATUS_ACTIVE");
+ DBG("vc status is CALL_STATUS_ACTIVE");
} else if (g_str_equal(state, "alerting")) {
telephony_update_indicator(ofono_indicators,
"callsetup", EV_CALLSETUP_ALERTING);
vc->status = CALL_STATUS_ALERTING;
- debug("vc status is CALL_STATUS_ALERTING");
+ DBG("vc status is CALL_STATUS_ALERTING");
} else if (g_str_equal(state, "incoming")) {
/* state change from waiting to incoming */
telephony_update_indicator(ofono_indicators,
@@ -819,7 +819,7 @@ static gboolean handle_vc_property_changed(DBusConnection *conn,
telephony_incoming_call_ind(vc->number,
NUMBER_TYPE_TELEPHONY);
vc->status = CALL_STATUS_INCOMING;
- debug("vc status is CALL_STATUS_INCOMING");
+ DBG("vc status is CALL_STATUS_INCOMING");
}
}
@@ -833,7 +833,7 @@ static gboolean handle_vcmanager_property_changed(DBusConnection *conn,
const char *property, *vc_obj_path = NULL;
struct voice_call *vc, *vc_new = NULL;
- debug("in handle_vcmanager_property_changed");
+ DBG("in handle_vcmanager_property_changed");
dbus_message_iter_init(msg, &iter);
@@ -844,7 +844,7 @@ static gboolean handle_vcmanager_property_changed(DBusConnection *conn,
}
dbus_message_iter_get_basic(&iter, &property);
- debug("in handle_vcmanager_property_changed(),"
+ DBG("in handle_vcmanager_property_changed(),"
" the property is %s", property);
dbus_message_iter_next(&iter);
@@ -859,7 +859,7 @@ static gboolean handle_vcmanager_property_changed(DBusConnection *conn,
dbus_message_iter_get_basic(&array, &vc_obj_path);
vc = find_vc(vc_obj_path);
if (vc) {
- debug("in handle_vcmanager_property_changed,"
+ DBG("in handle_vcmanager_property_changed,"
" found an existing vc");
} else {
vc_new = g_new0(struct voice_call, 1);
@@ -916,13 +916,13 @@ static void hal_battery_level_reply(DBusPendingCall *call, void *user_data)
*value = (int) level;
if (value == &battchg_last)
- debug("telephony-ofono: battery.charge_level.last_full"
+ DBG("telephony-ofono: battery.charge_level.last_full"
" is %d", *value);
else if (value == &battchg_design)
- debug("telephony-ofono: battery.charge_level.design"
+ DBG("telephony-ofono: battery.charge_level.design"
" is %d", *value);
else
- debug("telephony-ofono: battery.charge_level.current"
+ DBG("telephony-ofono: battery.charge_level.current"
" is %d", *value);
if ((battchg_design > 0 || battchg_last > 0) && battchg_cur >= 0) {
@@ -1014,7 +1014,7 @@ static void hal_find_device_reply(DBusPendingCall *call, void *user_data)
int type;
const char *path;
- debug("begin of hal_find_device_reply()");
+ DBG("begin of hal_find_device_reply()");
reply = dbus_pending_call_steal_reply(call);
dbus_error_init(&err);
@@ -1044,7 +1044,7 @@ static void hal_find_device_reply(DBusPendingCall *call, void *user_data)
dbus_message_iter_get_basic(&sub, &path);
- debug("telephony-ofono: found battery device at %s", path);
+ DBG("telephony-ofono: found battery device at %s", path);
device_watch = g_dbus_add_signal_watch(connection, NULL, path,
"org.freedesktop.Hal.Device",
@@ -1094,7 +1094,7 @@ int telephony_init(void)
if (ret < 0)
return ret;
- debug("telephony_init() successfully");
+ DBG("telephony_init() successfully");
return ret;
}
diff --git a/audio/telephony.h b/audio/telephony.h
index 0bc4769..5343e8c 100644
--- a/audio/telephony.h
+++ b/audio/telephony.h
@@ -207,10 +207,10 @@ static inline int telephony_update_indicator(struct indicator *indicators,
if (!ind)
return -ENOENT;
- debug("Telephony indicator \"%s\" %d->%d", desc, ind->val, new_val);
+ DBG("Telephony indicator \"%s\" %d->%d", desc, ind->val, new_val);
if (ind->ignore_redundant && ind->val == new_val) {
- debug("Ignoring no-change indication");
+ DBG("Ignoring no-change indication");
return 0;
}
diff --git a/audio/unix.c b/audio/unix.c
index d44e77a..42c0d80 100644
--- a/audio/unix.c
+++ b/audio/unix.c
@@ -97,7 +97,7 @@ static int unix_sock = -1;
static void client_free(struct unix_client *client)
{
- debug("client_free(%p)", client);
+ DBG("client_free(%p)", client);
if (client->cancel && client->dev && client->req_id > 0)
client->cancel(client->dev, client->req_id);
@@ -147,7 +147,7 @@ static void unix_ipc_sendmsg(struct unix_client *client,
const char *type = bt_audio_strtype(msg->type);
const char *name = bt_audio_strname(msg->name);
- debug("Audio API: %s -> %s", type, name);
+ DBG("Audio API: %s -> %s", type, name);
if (send(client->sock, msg, msg->length, 0) < 0)
error("Error %s(%d)", strerror(errno), errno);
@@ -168,7 +168,7 @@ static void unix_ipc_error(struct unix_client *client, uint8_t name, int err)
rsp->posix_errno = err;
- debug("sending error %s(%d)", strerror(err), err);
+ DBG("sending error %s(%d)", strerror(err), err);
unix_ipc_sendmsg(client, &rsp->h);
}
@@ -448,7 +448,7 @@ failed:
static void print_mpeg12(struct mpeg_codec_cap *mpeg)
{
- debug("Media Codec: MPEG12"
+ DBG("Media Codec: MPEG12"
" Channel Modes: %s%s%s%s"
" Frequencies: %s%s%s%s%s%s"
" Layers: %s%s%s"
@@ -473,7 +473,7 @@ static void print_mpeg12(struct mpeg_codec_cap *mpeg)
static void print_sbc(struct sbc_codec_cap *sbc)
{
- debug("Media Codec: SBC"
+ DBG("Media Codec: SBC"
" Channel Modes: %s%s%s%s"
" Frequencies: %s%s%s%s"
" Subbands: %s%s"
@@ -593,7 +593,7 @@ static int a2dp_append_codec(struct bt_get_capabilities_rsp *rsp,
codec->lock = lock;
rsp->h.length += codec->length;
- debug("Append %s seid %d - length %d - total %d",
+ DBG("Append %s seid %d - length %d - total %d",
configured ? "configured" : "", seid, codec->length,
rsp->h.length);
@@ -611,7 +611,7 @@ static void a2dp_discovery_complete(struct avdtp *session, GSList *seps,
GSList *l;
if (!g_slist_find(clients, client)) {
- debug("Client disconnected during discovery");
+ DBG("Client disconnected during discovery");
return;
}
@@ -1361,7 +1361,7 @@ static int handle_sco_open(struct unix_client *client, struct bt_open_req *req)
!g_str_equal(client->interface, AUDIO_GATEWAY_INTERFACE))
return -EIO;
- debug("open sco - object=%s source=%s destination=%s lock=%s%s",
+ DBG("open sco - object=%s source=%s destination=%s lock=%s%s",
strcmp(req->object, "") ? req->object : "ANY",
strcmp(req->source, "") ? req->source : "ANY",
strcmp(req->destination, "") ? req->destination : "ANY",
@@ -1380,7 +1380,7 @@ static int handle_a2dp_open(struct unix_client *client, struct bt_open_req *req)
!g_str_equal(client->interface, AUDIO_SOURCE_INTERFACE))
return -EIO;
- debug("open a2dp - object=%s source=%s destination=%s lock=%s%s",
+ DBG("open a2dp - object=%s source=%s destination=%s lock=%s%s",
strcmp(req->object, "") ? req->object : "ANY",
strcmp(req->source, "") ? req->source : "ANY",
strcmp(req->destination, "") ? req->destination : "ANY",
@@ -1688,7 +1688,7 @@ static gboolean client_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
return FALSE;
if (cond & (G_IO_HUP | G_IO_ERR)) {
- debug("Unix client disconnected (fd=%d)", client->sock);
+ DBG("Unix client disconnected (fd=%d)", client->sock);
goto failed;
}
@@ -1704,7 +1704,7 @@ static gboolean client_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
type = bt_audio_strtype(msghdr->type);
name = bt_audio_strname(msghdr->name);
- debug("Audio API: %s <- %s", type, name);
+ DBG("Audio API: %s <- %s", type, name);
if (msghdr->length != len) {
error("Invalid message: length mismatch");
@@ -1785,7 +1785,7 @@ static gboolean server_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
return TRUE;
}
- debug("Accepted new client connection on unix socket (fd=%d)", cli_sk);
+ DBG("Accepted new client connection on unix socket (fd=%d)", cli_sk);
set_nonblocking(cli_sk);
client = g_new0(struct unix_client, 1);
@@ -1804,7 +1804,7 @@ void unix_device_removed(struct audio_device *dev)
{
GSList *l;
- debug("unix_device_removed(%p)", dev);
+ DBG("unix_device_removed(%p)", dev);
l = clients;
while (l) {
@@ -1825,7 +1825,7 @@ void unix_delay_report(struct audio_device *dev, uint8_t seid, uint16_t delay)
GSList *l;
struct bt_delay_report_ind ind;
- debug("unix_delay_report(%p): %u.%ums", dev, delay / 10, delay % 10);
+ DBG("unix_delay_report(%p): %u.%ums", dev, delay / 10, delay % 10);
memset(&ind, 0, sizeof(ind));
ind.h.type = BT_INDICATION;
@@ -1882,7 +1882,7 @@ int unix_init(void)
server_cb, NULL);
g_io_channel_unref(io);
- debug("Unix socket created: %d", sk);
+ DBG("Unix socket created: %d", sk);
return 0;
}
diff --git a/input/device.c b/input/device.c
index 9b18d28..8daf8b2 100644
--- a/input/device.c
+++ b/input/device.c
@@ -298,7 +298,7 @@ static gboolean rfcomm_io_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
goto failed;
}
- debug("Received: %s", buf);
+ DBG("Received: %s", buf);
if (g_io_channel_write(chan, ok, 6, &bwritten) != G_IO_ERROR_NONE) {
error("IO Channel write error");
@@ -1004,7 +1004,7 @@ static void device_unregister(void *data)
{
struct input_device *idev = data;
- debug("Unregistered interface %s on path %s", INPUT_DEVICE_INTERFACE,
+ DBG("Unregistered interface %s on path %s", INPUT_DEVICE_INTERFACE,
idev->path);
devices = g_slist_remove(devices, idev);
@@ -1091,7 +1091,7 @@ static struct input_device *input_device_new(DBusConnection *conn,
return NULL;
}
- debug("Registered interface %s on path %s",
+ DBG("Registered interface %s on path %s",
INPUT_DEVICE_INTERFACE, idev->path);
return idev;
diff --git a/input/manager.c b/input/manager.c
index 1dd2308..a98a080 100644
--- a/input/manager.c
+++ b/input/manager.c
@@ -179,7 +179,7 @@ int input_manager_init(DBusConnection *conn, GKeyFile *config)
idle_timeout = g_key_file_get_integer(config, "General",
"IdleTimeout", &err);
if (err) {
- debug("input.conf: %s", err->message);
+ DBG("input.conf: %s", err->message);
g_error_free(err);
}
}
diff --git a/input/server.c b/input/server.c
index 12a4d31..d98018b 100644
--- a/input/server.c
+++ b/input/server.c
@@ -82,7 +82,7 @@ static void connect_event_cb(GIOChannel *chan, GError *err, gpointer data)
return;
}
- debug("Incoming connection on PSM %d", psm);
+ DBG("Incoming connection on PSM %d", psm);
ret = input_device_set_channel(&src, &dst, psm, chan);
if (ret == 0)
diff --git a/network/common.c b/network/common.c
index 722794d..f5e0ee8 100644
--- a/network/common.c
+++ b/network/common.c
@@ -79,9 +79,9 @@ static gint find_devname(gconstpointer a, gconstpointer b)
static void script_exited(GPid pid, gint status, gpointer data)
{
if (WIFEXITED(status))
- debug("%d exited with status %d", pid, WEXITSTATUS(status));
+ DBG("%d exited with status %d", pid, WEXITSTATUS(status));
else
- debug("%d was killed by signal %d", pid, WTERMSIG(status));
+ DBG("%d was killed by signal %d", pid, WTERMSIG(status));
g_spawn_close_pid(pid);
}
diff --git a/network/connection.c b/network/connection.c
index ce6d831..01178d7 100644
--- a/network/connection.c
+++ b/network/connection.c
@@ -539,7 +539,7 @@ static void path_unregister(void *data)
{
struct network_peer *peer = data;
- debug("Unregistered interface %s on path %s",
+ DBG("Unregistered interface %s on path %s",
NETWORK_PEER_INTERFACE, peer->path);
peers = g_slist_remove(peers, peer);
@@ -603,7 +603,7 @@ static struct network_peer *create_peer(struct btd_device *device,
return NULL;
}
- debug("Registered interface %s on path %s",
+ DBG("Registered interface %s on path %s",
NETWORK_PEER_INTERFACE, path);
return peer;
diff --git a/network/manager.c b/network/manager.c
index 8216f6f..80a5ded 100644
--- a/network/manager.c
+++ b/network/manager.c
@@ -102,7 +102,7 @@ static void read_config(const char *file)
disabled = g_key_file_get_string_list(keyfile, "General",
"Disable", NULL, &err);
if (err) {
- debug("%s: %s", file, err->message);
+ DBG("%s: %s", file, err->message);
g_clear_error(&err);
} else {
int i;
@@ -118,7 +118,7 @@ static void read_config(const char *file)
conf.security = !g_key_file_get_boolean(keyfile, "General",
"DisableSecurity", &err);
if (err) {
- debug("%s: %s", file, err->message);
+ DBG("%s: %s", file, err->message);
g_clear_error(&err);
}
@@ -126,21 +126,21 @@ static void read_config(const char *file)
conf.panu_script = g_key_file_get_string(keyfile, "PANU Role",
"Script", &err);
if (err) {
- debug("%s: %s", file, err->message);
+ DBG("%s: %s", file, err->message);
g_clear_error(&err);
}
conf.gn_script = g_key_file_get_string(keyfile, "GN Role",
"Script", &err);
if (err) {
- debug("%s: %s", file, err->message);
+ DBG("%s: %s", file, err->message);
g_clear_error(&err);
}
conf.nap_script = g_key_file_get_string(keyfile, "NAP Role",
"Script", &err);
if (err) {
- debug("%s: %s", file, err->message);
+ DBG("%s: %s", file, err->message);
g_clear_error(&err);
}
#endif
@@ -148,21 +148,21 @@ static void read_config(const char *file)
conf.iface_prefix = g_key_file_get_string(keyfile, "PANU Role",
"Interface", &err);
if (err) {
- debug("%s: %s", file, err->message);
+ DBG("%s: %s", file, err->message);
g_clear_error(&err);
}
conf.gn_iface = g_key_file_get_string(keyfile, "GN Role",
"Interface", &err);
if (err) {
- debug("%s: %s", file, err->message);
+ DBG("%s: %s", file, err->message);
g_clear_error(&err);
}
conf.nap_iface = g_key_file_get_string(keyfile, "NAP Role",
"Interface", &err);
if (err) {
- debug("%s: %s", file, err->message);
+ DBG("%s: %s", file, err->message);
g_clear_error(&err);
}
@@ -177,7 +177,7 @@ done:
if (!conf.nap_iface)
conf.nap_iface = g_strdup(NAP_IFACE);
- debug("Config options: InterfacePrefix=%s, PANU_Script=%s, "
+ DBG("Config options: InterfacePrefix=%s, PANU_Script=%s, "
"GN_Script=%s, NAP_Script=%s, GN_Interface=%s, "
"NAP_Interface=%s, Security=%s",
conf.iface_prefix, conf.panu_script, conf.gn_script,
diff --git a/network/server.c b/network/server.c
index a4a807f..a82d4ff 100644
--- a/network/server.c
+++ b/network/server.c
@@ -500,7 +500,7 @@ static void confirm_event(GIOChannel *chan, gpointer user_data)
goto drop;
}
- debug("BNEP: incoming connect from %s", address);
+ DBG("BNEP: incoming connect from %s", address);
if (na->setup) {
error("Refusing connect from %s: setup in progress", address);
@@ -564,7 +564,7 @@ static uint32_t register_server_record(struct network_server *ns)
return 0;
}
- debug("register_server_record: got record id 0x%x", record->handle);
+ DBG("register_server_record: got record id 0x%x", record->handle);
return record->handle;
}
@@ -786,7 +786,7 @@ static void path_unregister(void *data)
struct network_server *ns = data;
struct network_adapter *na = ns->na;
- debug("Unregistered interface %s on path %s",
+ DBG("Unregistered interface %s on path %s",
ns->iface, adapter_get_path(na->adapter));
na->servers = g_slist_remove(na->servers, ns);
@@ -893,7 +893,7 @@ int server_register(struct btd_adapter *adapter, uint16_t id)
ns->enable = TRUE;
na->servers = g_slist_append(na->servers, ns);
- debug("Registered interface %s on path %s", ns->iface, path);
+ DBG("Registered interface %s on path %s", ns->iface, path);
return 0;
}
diff --git a/plugins/echo.c b/plugins/echo.c
index 4108f92..23f6e49 100644
--- a/plugins/echo.c
+++ b/plugins/echo.c
@@ -151,14 +151,14 @@ static struct btd_adapter_driver echo_server = {
static int echo_init(void)
{
- debug("Setup echo plugin");
+ DBG("Setup echo plugin");
return btd_register_adapter_driver(&echo_server);
}
static void echo_exit(void)
{
- debug("Cleanup echo plugin");
+ DBG("Cleanup echo plugin");
btd_unregister_adapter_driver(&echo_server);
}
diff --git a/plugins/hal.c b/plugins/hal.c
index db11a38..f6121c5 100644
--- a/plugins/hal.c
+++ b/plugins/hal.c
@@ -59,7 +59,7 @@ static void formfactor_reply(DBusPendingCall *call, void *user_data)
return;
}
- debug("Computer is classified as %s", formfactor);
+ DBG("Computer is classified as %s", formfactor);
if (formfactor != NULL) {
if (g_str_equal(formfactor, "laptop") == TRUE)
@@ -75,7 +75,7 @@ static void formfactor_reply(DBusPendingCall *call, void *user_data)
dbus_message_unref(reply);
/* Computer major class */
- debug("Setting 0x%06x for major/minor device class", (1 << 8) | minor);
+ DBG("Setting 0x%06x for major/minor device class", (1 << 8) | minor);
btd_adapter_set_class(adapter, 0x01, minor);
}
diff --git a/plugins/hciops.c b/plugins/hciops.c
index a9f38f3..da2e3d0 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -63,7 +63,7 @@ static gboolean child_exit(GIOChannel *io, GIOCondition cond, void *user_data)
if (waitpid(child_pid, &status, 0) != child_pid)
error("waitpid(%d) failed", child_pid);
else
- debug("child %d exited", child_pid);
+ DBG("child %d exited", child_pid);
return TRUE;
}
@@ -131,7 +131,7 @@ static void init_device(int index)
error("Fork failed. Can't init device hci%d: %s (%d)",
index, strerror(err), err);
default:
- debug("child %d forked", pid);
+ DBG("child %d forked", pid);
return;
}
diff --git a/plugins/netlink.c b/plugins/netlink.c
index e57e46f..081ffa2 100644
--- a/plugins/netlink.c
+++ b/plugins/netlink.c
@@ -53,7 +53,7 @@ static gboolean channel_callback(GIOChannel *chan,
if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL))
return FALSE;
- debug("Message available on netlink channel");
+ DBG("Message available on netlink channel");
err = nl_recvmsgs_default(handle);
diff --git a/plugins/pnat.c b/plugins/pnat.c
index 7ec4345..f9136a4 100644
--- a/plugins/pnat.c
+++ b/plugins/pnat.c
@@ -143,7 +143,7 @@ static gboolean client_event(GIOChannel *chan,
ba2str(&client->bda, addr);
- debug("Disconnected DUN from %s (%s)", addr, client->tty_name);
+ DBG("Disconnected DUN from %s (%s)", addr, client->tty_name);
client->io_watch = 0;
disconnect(server);
@@ -157,10 +157,10 @@ static void pnatd_exit(GPid pid, gint status, gpointer user_data)
struct dun_client *client = &server->client;
if (WIFEXITED(status))
- debug("pnatd (%d) exited with status %d", pid,
+ DBG("pnatd (%d) exited with status %d", pid,
WEXITSTATUS(status));
else
- debug("pnatd (%d) was killed by signal %d", pid,
+ DBG("pnatd (%d) was killed by signal %d", pid,
WTERMSIG(status));
client->pnatd_watch = 0;
@@ -183,7 +183,7 @@ static gboolean start_pnatd(struct dun_server *server)
return FALSE;
}
- debug("pnatd started for %s with pid %d", client->tty_name, pid);
+ DBG("pnatd started for %s with pid %d", client->tty_name, pid);
client->pnatd_pid = pid;
client->pnatd_watch = g_child_watch_add(pid, pnatd_exit, server);
@@ -210,7 +210,7 @@ static gboolean tty_try_open(gpointer user_data)
return TRUE;
}
- debug("%s created for DUN", client->tty_name);
+ DBG("%s created for DUN", client->tty_name);
client->tty_open = TRUE;
client->tty_timer = 0;
@@ -505,14 +505,14 @@ static struct btd_adapter_driver pnat_server = {
static int pnat_init(void)
{
- debug("Setup Phonet AT (DUN) plugin");
+ DBG("Setup Phonet AT (DUN) plugin");
return btd_register_adapter_driver(&pnat_server);
}
static void pnat_exit(void)
{
- debug("Cleanup Phonet AT (DUN) plugin");
+ DBG("Cleanup Phonet AT (DUN) plugin");
btd_unregister_adapter_driver(&pnat_server);
}
diff --git a/plugins/service.c b/plugins/service.c
index e5d03b3..96280bd 100644
--- a/plugins/service.c
+++ b/plugins/service.c
@@ -107,7 +107,7 @@ static void element_start(GMarkupParseContext *context,
break;
}
}
- debug("New attribute 0x%04x", ctx_data->attr_id);
+ DBG("New attribute 0x%04x", ctx_data->attr_id);
return;
}
@@ -174,13 +174,13 @@ static void element_end(GMarkupParseContext *context,
int ret = sdp_attr_add(ctx_data->record, ctx_data->attr_id,
ctx_data->stack_head->data);
if (ret == -1)
- debug("Trouble adding attribute\n");
+ DBG("Trouble adding attribute\n");
ctx_data->stack_head->data = NULL;
sdp_xml_data_free(ctx_data->stack_head);
ctx_data->stack_head = NULL;
} else {
- debug("No data for attribute 0x%04x\n", ctx_data->attr_id);
+ DBG("No data for attribute 0x%04x\n", ctx_data->attr_id);
}
return;
}
@@ -321,7 +321,7 @@ static void exit_callback(DBusConnection *conn, void *user_data)
struct service_adapter *serv_adapter = user_record->serv_adapter;
struct pending_auth *auth;
- debug("remove record");
+ DBG("remove record");
serv_adapter->records = g_slist_remove(serv_adapter->records,
user_record);
@@ -409,7 +409,7 @@ static int add_xml_record(DBusConnection *conn, const char *sender,
serv_adapter->records = g_slist_append(serv_adapter->records,
user_record);
- debug("listener_id %d", user_record->listener_id);
+ DBG("listener_id %d", user_record->listener_id);
*handle = user_record->handle;
@@ -493,13 +493,13 @@ static int remove_record(DBusConnection *conn, const char *sender,
{
struct record_data *user_record;
- debug("remove record 0x%x", handle);
+ DBG("remove record 0x%x", handle);
user_record = find_record(serv_adapter, handle, sender);
if (!user_record)
return -1;
- debug("listner_id %d", user_record->listener_id);
+ DBG("listner_id %d", user_record->listener_id);
g_dbus_remove_watch(conn, user_record->listener_id);
@@ -789,7 +789,7 @@ static int register_interface(const char *path, struct btd_adapter *adapter)
return -EIO;
}
- debug("Registered interface %s on path %s", SERVICE_INTERFACE, path);
+ DBG("Registered interface %s on path %s", SERVICE_INTERFACE, path);
if (serv_adapter->adapter == NULL)
serv_adapter_any = serv_adapter;
diff --git a/serial/port.c b/serial/port.c
index 0f30e3f..48a60b4 100644
--- a/serial/port.c
+++ b/serial/port.c
@@ -155,7 +155,7 @@ static int port_release(struct serial_port *port)
return 0;
}
- debug("Serial port %s released", port->dev);
+ DBG("Serial port %s released", port->dev);
rfcomm_ctl = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_RFCOMM);
if (rfcomm_ctl < 0)
@@ -223,7 +223,7 @@ static void path_unregister(void *data)
{
struct serial_device *device = data;
- debug("Unregistered interface %s on path %s", SERIAL_PORT_INTERFACE,
+ DBG("Unregistered interface %s on path %s", SERIAL_PORT_INTERFACE,
device->path);
devices = g_slist_remove(devices, device);
@@ -358,7 +358,7 @@ static void rfcomm_connect_cb(GIOChannel *chan, GError *conn_err,
port->dev = g_strdup_printf("/dev/rfcomm%d", port->id);
- debug("Serial port %s created", port->dev);
+ DBG("Serial port %s created", port->dev);
g_io_channel_shutdown(chan, TRUE, NULL);
@@ -592,7 +592,7 @@ static struct serial_device *create_serial_device(DBusConnection *conn,
return NULL;
}
- debug("Registered interface %s on path %s",
+ DBG("Registered interface %s on path %s",
SERIAL_PORT_INTERFACE, path);
return device;
diff --git a/serial/proxy.c b/serial/proxy.c
index 731f157..6577fe2 100644
--- a/serial/proxy.c
+++ b/serial/proxy.c
@@ -487,7 +487,7 @@ static void confirm_event_cb(GIOChannel *chan, gpointer user_data)
goto drop;
}
- debug("Serial Proxy: incoming connect from %s", address);
+ DBG("Serial Proxy: incoming connect from %s", address);
prx->rfcomm = g_io_channel_ref(chan);
@@ -533,7 +533,7 @@ static int enable_proxy(struct serial_proxy *prx)
goto failed;
}
- debug("Allocated channel %d", prx->channel);
+ DBG("Allocated channel %d", prx->channel);
g_io_channel_set_close_on_unref(prx->io, TRUE);
@@ -788,7 +788,7 @@ static void proxy_path_unregister(gpointer data)
struct serial_proxy *prx = data;
int sk;
- debug("Unregistered proxy: %s", prx->address);
+ DBG("Unregistered proxy: %s", prx->address);
if (prx->type != TTY_PROXY)
goto done;
@@ -823,7 +823,7 @@ static int register_proxy_object(struct serial_proxy *prx)
prx->path = g_strdup(path);
adapter->proxies = g_slist_append(adapter->proxies, prx);
- debug("Registered proxy: %s", path);
+ DBG("Registered proxy: %s", path);
return 0;
}
@@ -1219,7 +1219,7 @@ static void serial_proxy_init(struct serial_adapter *adapter)
uuid_str = g_key_file_get_string(config, group_str, "UUID",
&gerr);
if (gerr) {
- debug("%s: %s", file, gerr->message);
+ DBG("%s: %s", file, gerr->message);
g_error_free(gerr);
g_key_file_free(config);
g_strfreev(group_list);
@@ -1229,7 +1229,7 @@ static void serial_proxy_init(struct serial_adapter *adapter)
address = g_key_file_get_string(config, group_str, "Address",
&gerr);
if (gerr) {
- debug("%s: %s", file, gerr->message);
+ DBG("%s: %s", file, gerr->message);
g_error_free(gerr);
g_key_file_free(config);
g_free(uuid_str);
@@ -1241,7 +1241,7 @@ static void serial_proxy_init(struct serial_adapter *adapter)
if (err == -EINVAL)
error("Invalid address.");
else if (err == -EALREADY)
- debug("Proxy already exists.");
+ DBG("Proxy already exists.");
else if (err < 0)
error("Proxy creation failed (%s)", strerror(-err));
else {
@@ -1285,7 +1285,7 @@ int proxy_register(DBusConnection *conn, struct btd_adapter *btd_adapter)
adapters = g_slist_append(adapters, adapter);
- debug("Registered interface %s on path %s",
+ DBG("Registered interface %s on path %s",
SERIAL_MANAGER_INTERFACE, path);
serial_proxy_init(adapter);
diff --git a/src/adapter.c b/src/adapter.c
index c0bc1ad..8935f04 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -220,7 +220,7 @@ static int adapter_set_service_classes(struct btd_adapter *adapter, uint8_t valu
adapter->cache_enable || adapter->pending_cod)
return 0;
- debug("Changing service classes to 0x%06x", adapter->wanted_cod);
+ DBG("Changing service classes to 0x%06x", adapter->wanted_cod);
err = adapter_ops->set_class(adapter->dev_id, adapter->wanted_cod);
if (err < 0)
@@ -246,7 +246,7 @@ int btd_adapter_set_class(struct btd_adapter *adapter, uint8_t major,
adapter->cache_enable || adapter->pending_cod)
return 0;
- debug("Changing Major/Minor class to 0x%06x", adapter->wanted_cod);
+ DBG("Changing Major/Minor class to 0x%06x", adapter->wanted_cod);
err = adapter_ops->set_class(adapter->dev_id, adapter->wanted_cod);
if (err < 0)
@@ -616,7 +616,7 @@ static void session_remove(struct session_req *req)
if (mode == adapter->mode)
return;
- debug("Switching to '%s' mode", mode2str(mode));
+ DBG("Switching to '%s' mode", mode2str(mode));
set_mode(adapter, mode);
} else {
@@ -626,7 +626,7 @@ static void session_remove(struct session_req *req)
if (adapter->disc_sessions)
return;
- debug("Stopping discovery");
+ DBG("Stopping discovery");
pending_remote_name_cancel(adapter);
@@ -646,7 +646,7 @@ static void session_remove(struct session_req *req)
static void session_free(struct session_req *req)
{
- debug("%s session %p with %s deactivated",
+ DBG("%s session %p with %s deactivated",
req->mode ? "Mode" : "Discovery", req, req->owner);
if (req->id)
@@ -675,7 +675,7 @@ static struct session_req *session_ref(struct session_req *req)
{
req->refcount++;
- debug("session_ref(%p): ref=%d", req, req->refcount);
+ DBG("session_ref(%p): ref=%d", req, req->refcount);
return req;
}
@@ -684,7 +684,7 @@ static void session_unref(struct session_req *req)
{
req->refcount--;
- debug("session_unref(%p): ref=%d", req, req->refcount);
+ DBG("session_unref(%p): ref=%d", req, req->refcount);
if (req->refcount)
return;
@@ -894,7 +894,7 @@ void adapter_update_tx_power(bdaddr_t *bdaddr, uint8_t status, void *ptr)
adapter->tx_power = *((int8_t *) ptr);
- debug("inquiry respone tx power level is %d", adapter->tx_power);
+ DBG("inquiry respone tx power level is %d", adapter->tx_power);
update_ext_inquiry_response(adapter);
}
@@ -1116,7 +1116,7 @@ struct btd_device *adapter_create_device(DBusConnection *conn,
struct btd_device *device;
const char *path;
- debug("adapter_create_device(%s)", address);
+ DBG("adapter_create_device(%s)", address);
device = device_create(conn, adapter, address);
if (!device)
@@ -1177,7 +1177,7 @@ struct btd_device *adapter_get_device(DBusConnection *conn,
{
struct btd_device *device;
- debug("adapter_get_device(%s)", address);
+ DBG("adapter_get_device(%s)", address);
if (!adapter)
return NULL;
@@ -1593,7 +1593,7 @@ static DBusMessage *create_device(DBusConnection *conn,
ERROR_INTERFACE ".AlreadyExists",
"Device already exists");
- debug("create_device(%s)", address);
+ DBG("create_device(%s)", address);
device = adapter_create_device(conn, adapter, address);
if (!device)
@@ -1772,7 +1772,7 @@ static DBusMessage *register_agent(DBusConnection *conn,
adapter->agent = agent;
- debug("Agent registered for hci%d at %s:%s", adapter->dev_id, name,
+ DBG("Agent registered for hci%d at %s:%s", adapter->dev_id, name,
path);
return dbus_message_new_method_return(msg);
@@ -2288,7 +2288,7 @@ int adapter_start(struct btd_adapter *adapter)
if (!bacmp(&di.bdaddr, BDADDR_ANY)) {
int err;
- debug("Adapter %s without an address", adapter->path);
+ DBG("Adapter %s without an address", adapter->path);
err = adapter_read_bdaddr(adapter->dev_id, &di.bdaddr);
if (err < 0)
@@ -2366,7 +2366,7 @@ setup:
adapter_setup(adapter, mode);
if (!adapter->initialized && adapter->already_up) {
- debug("Stopping Inquiry at adapter startup");
+ DBG("Stopping Inquiry at adapter startup");
adapter_ops->stop_discovery(adapter->dev_id);
}
@@ -2504,7 +2504,7 @@ static void adapter_free(gpointer user_data)
agent_free(adapter->agent);
adapter->agent = NULL;
- debug("adapter_free(%p)", adapter);
+ DBG("adapter_free(%p)", adapter);
if (adapter->auth_idle_id)
g_source_remove(adapter->auth_idle_id);
@@ -2517,7 +2517,7 @@ struct btd_adapter *btd_adapter_ref(struct btd_adapter *adapter)
{
adapter->ref++;
- debug("btd_adapter_ref(%p): ref=%d", adapter, adapter->ref);
+ DBG("btd_adapter_ref(%p): ref=%d", adapter, adapter->ref);
return adapter;
}
@@ -2528,7 +2528,7 @@ void btd_adapter_unref(struct btd_adapter *adapter)
adapter->ref--;
- debug("btd_adapter_unref(%p): ref=%d", adapter, adapter->ref);
+ DBG("btd_adapter_unref(%p): ref=%d", adapter, adapter->ref);
if (adapter->ref > 0)
return;
@@ -2581,7 +2581,7 @@ void adapter_remove(struct btd_adapter *adapter)
{
GSList *l;
- debug("Removing adapter %s", adapter->path);
+ DBG("Removing adapter %s", adapter->path);
for (l = adapter->devices; l; l = l->next)
device_remove(l->data, FALSE);
@@ -2959,7 +2959,7 @@ void adapter_remove_connection(struct btd_adapter *adapter,
if (device_is_temporary(device)) {
const char *path = device_get_path(device);
- debug("Removing temporary device %s", path);
+ DBG("Removing temporary device %s", path);
adapter_remove_device(connection, adapter, device, TRUE);
}
}
diff --git a/src/agent.c b/src/agent.c
index 09a6d58..c7fdbd4 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -89,7 +89,7 @@ static void agent_release(struct agent *agent)
{
DBusMessage *message;
- debug("Releasing agent %s, %s", agent->name, agent->path);
+ DBG("Releasing agent %s, %s", agent->name, agent->path);
if (agent->request)
agent_cancel(agent);
@@ -137,7 +137,7 @@ static void agent_exited(DBusConnection *conn, void *user_data)
{
struct agent *agent = user_data;
- debug("Agent exited without calling Unregister");
+ DBG("Agent exited without calling Unregister");
agent->exited = TRUE;
@@ -349,7 +349,7 @@ int agent_authorize(struct agent *agent,
agent->request = req;
- debug("authorize request was sent for %s", path);
+ DBG("authorize request was sent for %s", path);
return 0;
}
@@ -512,7 +512,7 @@ int agent_confirm_mode_change(struct agent *agent, const char *new_mode,
if (agent->request)
return -EBUSY;
- debug("Calling Agent.ConfirmModeChange: name=%s, path=%s, mode=%s",
+ DBG("Calling Agent.ConfirmModeChange: name=%s, path=%s, mode=%s",
agent->name, agent->path, new_mode);
req = agent_request_new(agent, AGENT_REQUEST_CONFIRM_MODE,
@@ -617,7 +617,7 @@ int agent_request_passkey(struct agent *agent, struct btd_device *device,
if (agent->request)
return -EBUSY;
- debug("Calling Agent.RequestPasskey: name=%s, path=%s",
+ DBG("Calling Agent.RequestPasskey: name=%s, path=%s",
agent->name, agent->path);
req = agent_request_new(agent, AGENT_REQUEST_PASSKEY, cb,
@@ -676,7 +676,7 @@ int agent_request_confirmation(struct agent *agent, struct btd_device *device,
if (agent->request)
return -EBUSY;
- debug("Calling Agent.RequestConfirmation: name=%s, path=%s, passkey=%06u",
+ DBG("Calling Agent.RequestConfirmation: name=%s, path=%s, passkey=%06u",
agent->name, agent->path, passkey);
req = agent_request_new(agent, AGENT_REQUEST_CONFIRMATION, cb,
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index 155a190..b4e91d3 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -299,7 +299,7 @@ static int get_auth_requirements(bdaddr_t *local, bdaddr_t *remote,
err = ioctl(dd, HCIGETAUTHINFO, (unsigned long) &req);
if (err < 0) {
- debug("HCIGETAUTHINFO failed: %s (%d)",
+ DBG("HCIGETAUTHINFO failed: %s (%d)",
strerror(errno), errno);
hci_close_dev(dd);
return err;
@@ -342,13 +342,13 @@ int hcid_dbus_user_confirm(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
return 0;
}
- debug("confirm authentication requirement is 0x%02x", type);
+ DBG("confirm authentication requirement is 0x%02x", type);
remcap = device_get_cap(device);
remauth = device_get_auth(device);
- debug("remote IO capabilities are 0x%02x", remcap);
- debug("remote authentication requirement is 0x%02x", remauth);
+ DBG("remote IO capabilities are 0x%02x", remcap);
+ DBG("remote authentication requirement is 0x%02x", remauth);
/* If no side requires MITM protection; auto-accept */
if (!(remauth & 0x01) &&
@@ -369,7 +369,7 @@ int hcid_dbus_user_confirm(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
hci_close_dev(dd);
- debug("auto accept of confirmation");
+ DBG("auto accept of confirmation");
return device_request_authentication(device,
AUTH_TYPE_AUTO, 0, NULL);
@@ -409,7 +409,7 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer,
struct btd_adapter *adapter;
struct btd_device *device;
- debug("hcid_dbus_bonding_process_complete: status=%02x", status);
+ DBG("hcid_dbus_bonding_process_complete: status=%02x", status);
if (!get_adapter_and_device(local, peer, &adapter, &device, TRUE))
return;
@@ -418,7 +418,7 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer,
/* This means that there was no pending PIN or SSP token
* request from the controller, i.e. this is not a new
* pairing */
- debug("hcid_dbus_bonding_process_complete: no pending auth request");
+ DBG("hcid_dbus_bonding_process_complete: no pending auth request");
return;
}
@@ -433,7 +433,7 @@ void hcid_dbus_simple_pairing_complete(bdaddr_t *local, bdaddr_t *peer,
struct btd_adapter *adapter;
struct btd_device *device;
- debug("hcid_dbus_simple_pairing_complete: status=%02x", status);
+ DBG("hcid_dbus_simple_pairing_complete: status=%02x", status);
if (!get_adapter_and_device(local, peer, &adapter, &device, TRUE))
return;
@@ -674,7 +674,7 @@ int hcid_dbus_link_key_notify(bdaddr_t *local, bdaddr_t *peer,
remote_auth = device_get_auth(device);
bonding = device_is_bonding(device, NULL);
- debug("local auth 0x%02x and remote auth 0x%02x",
+ DBG("local auth 0x%02x and remote auth 0x%02x",
local_auth, remote_auth);
/* Only store the link key if one of the following is true:
@@ -692,7 +692,7 @@ int hcid_dbus_link_key_notify(bdaddr_t *local, bdaddr_t *peer,
(remote_auth == 0x02 || remote_auth == 0x03)) {
int err;
- debug("storing link key of type 0x%02x", key_type);
+ DBG("storing link key of type 0x%02x", key_type);
err = write_link_key(local, peer, key, new_key_type,
pin_length);
@@ -766,7 +766,7 @@ void hcid_dbus_disconn_complete(bdaddr_t *local, uint8_t status,
device = adapter_find_connection(adapter, handle);
if (!device) {
- debug("No matching connection found for handle %u", handle);
+ DBG("No matching connection found for handle %u", handle);
return;
}
@@ -886,7 +886,7 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote,
if (get_auth_requirements(local, remote, auth) < 0)
return -1;
- debug("initial authentication requirement is 0x%02x", *auth);
+ DBG("initial authentication requirement is 0x%02x", *auth);
if (*auth == 0xff)
*auth = device_get_auth(device);
@@ -896,7 +896,7 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote,
if (!adapter_is_pairable(adapter) &&
!device_is_bonding(device, NULL)) {
if (device_get_auth(device) < 0x02) {
- debug("Allowing no bonding in non-bondable mode");
+ DBG("Allowing no bonding in non-bondable mode");
/* No input, no output */
*cap = 0x03;
/* Kernel defaults to general bonding and so
@@ -916,13 +916,13 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote,
if (!agent) {
/* This is the non bondable mode case */
if (device_get_auth(device) > 0x01) {
- debug("Bonding request, but no agent present");
+ DBG("Bonding request, but no agent present");
return -1;
}
/* No agent available, and no bonding case */
if (*auth == 0x00 || *auth == 0x04) {
- debug("Allowing no bonding without agent");
+ DBG("Allowing no bonding without agent");
/* No input, no output */
*cap = 0x03;
/* If kernel defaults to general bonding, set it
@@ -966,7 +966,7 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote,
*cap = agent_get_io_capability(agent);
done:
- debug("final authentication requirement is 0x%02x", *auth);
+ DBG("final authentication requirement is 0x%02x", *auth);
return 0;
}
diff --git a/src/device.c b/src/device.c
index e9ada93..407611a 100644
--- a/src/device.c
+++ b/src/device.c
@@ -248,7 +248,7 @@ static void device_free(gpointer user_data)
if (device->discov_timer)
g_source_remove(device->discov_timer);
- debug("device_free(%p)", device);
+ DBG("device_free(%p)", device);
g_free(device->authr);
g_free(device->path);
@@ -640,7 +640,7 @@ static void discover_services_req_exit(DBusConnection *conn, void *user_data)
{
struct browse_req *req = user_data;
- debug("DiscoverServices requestor exited");
+ DBG("DiscoverServices requestor exited");
browse_request_cancel(req);
}
@@ -1018,7 +1018,7 @@ struct btd_device *device_create(DBusConnection *conn,
g_strdelimit(device->path, ":", '_');
g_free(address_up);
- debug("Creating device %s", device->path);
+ DBG("Creating device %s", device->path);
if (g_dbus_register_interface(conn, device->path, DEVICE_INTERFACE,
device_methods, device_signals, NULL,
@@ -1120,7 +1120,7 @@ static void device_remove_stored(struct btd_device *device)
void device_remove(struct btd_device *device, gboolean remove_stored)
{
- debug("Removing device %s", device->path);
+ DBG("Removing device %s", device->path);
if (device->bonding)
device_cancel_bonding(device, HCI_OE_USER_ENDED_CONNECTION);
@@ -1232,11 +1232,11 @@ void device_probe_drivers(struct btd_device *device, GSList *profiles)
int err;
if (device->blocked) {
- debug("Skipping drivers for blocked device %s", device->path);
+ DBG("Skipping drivers for blocked device %s", device->path);
goto add_uuids;
}
- debug("Probe drivers for %s", device->path);
+ DBG("Probe drivers for %s", device->path);
for (list = device_drivers; list; list = list->next) {
struct btd_device_driver *driver = list->data;
@@ -1298,7 +1298,7 @@ static void device_remove_drivers(struct btd_device *device, GSList *uuids)
records = read_records(&src, &device->bdaddr);
- debug("Remove drivers for %s", device->path);
+ DBG("Remove drivers for %s", device->path);
for (list = device->drivers; list; list = next) {
struct btd_driver_data *driver_data = list->data;
@@ -1312,7 +1312,7 @@ static void device_remove_drivers(struct btd_device *device, GSList *uuids)
(GCompareFunc) strcasecmp))
continue;
- debug("UUID %s was removed from device %s",
+ DBG("UUID %s was removed from device %s",
*uuid, dstaddr);
driver->remove(device);
@@ -1395,7 +1395,7 @@ static void update_services(struct browse_req *req, sdp_list_t *recs)
/* Check for empty service classes list */
if (svcclass == NULL) {
- debug("Skipping record with no service classes");
+ DBG("Skipping record with no service classes");
continue;
}
@@ -1510,7 +1510,7 @@ static void search_cb(sdp_list_t *recs, int err, gpointer user_data)
}
if (!req->profiles_added && !req->profiles_removed) {
- debug("%s: No service update", device->path);
+ DBG("%s: No service update", device->path);
goto send_reply;
}
@@ -1877,7 +1877,7 @@ static struct bonding_req *bonding_request_new(DBusConnection *conn,
const char *name = dbus_message_get_sender(msg);
struct agent *agent;
- debug("%s: requesting bonding", device->path);
+ DBG("%s: requesting bonding", device->path);
if (!agent_path)
goto proceed;
@@ -1893,7 +1893,7 @@ static struct bonding_req *bonding_request_new(DBusConnection *conn,
device->agent = agent;
- debug("Temporary agent registered for %s at %s:%s",
+ DBG("Temporary agent registered for %s at %s:%s",
device->path, name, agent_path);
proceed:
@@ -2016,7 +2016,7 @@ static void create_bond_req_exit(DBusConnection *conn, void *user_data)
{
struct btd_device *device = user_data;
- debug("%s: requestor exited before bonding was completed", device->path);
+ DBG("%s: requestor exited before bonding was completed", device->path);
if (device->authr)
device_cancel_authentication(device, FALSE);
@@ -2148,7 +2148,7 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)
/* If we are not initiators and there is no currently
* active discovery or discovery timer, set discovery
* timer */
- debug("setting timer for reverse service discovery");
+ DBG("setting timer for reverse service discovery");
device->discov_timer = g_timeout_add_seconds(
DISCOVERY_TIMER,
start_discovery,
@@ -2208,7 +2208,7 @@ void device_cancel_bonding(struct btd_device *device, uint8_t status)
if (!bonding)
return;
- debug("%s: canceling bonding request", device->path);
+ DBG("%s: canceling bonding request", device->path);
if (device->authr)
device_cancel_authentication(device, FALSE);
@@ -2274,7 +2274,7 @@ int device_request_authentication(struct btd_device *device, auth_type_t type,
struct agent *agent;
int ret;
- debug("%s: requesting agent authentication", device->path);
+ DBG("%s: requesting agent authentication", device->path);
agent = device->agent;
@@ -2367,7 +2367,7 @@ void device_cancel_authentication(struct btd_device *device, gboolean aborted)
if (!auth)
return;
- debug("%s: canceling authentication request", device->path);
+ DBG("%s: canceling authentication request", device->path);
if (auth->agent)
agent_cancel(auth->agent);
@@ -2453,7 +2453,7 @@ struct btd_device *btd_device_ref(struct btd_device *device)
{
device->ref++;
- debug("btd_device_ref(%p): ref=%d", device, device->ref);
+ DBG("btd_device_ref(%p): ref=%d", device, device->ref);
return device;
}
@@ -2465,7 +2465,7 @@ void btd_device_unref(struct btd_device *device)
device->ref--;
- debug("btd_device_unref(%p): ref=%d", device, device->ref);
+ DBG("btd_device_unref(%p): ref=%d", device, device->ref);
if (device->ref > 0)
return;
diff --git a/src/main.c b/src/main.c
index 014c381..3118a34 100644
--- a/src/main.c
+++ b/src/main.c
@@ -93,15 +93,15 @@ static void parse_config(GKeyFile *config)
if (!config)
return;
- debug("parsing main.conf");
+ DBG("parsing main.conf");
val = g_key_file_get_integer(config, "General",
"DiscoverableTimeout", &err);
if (err) {
- debug("%s", err->message);
+ DBG("%s", err->message);
g_clear_error(&err);
} else {
- debug("discovto=%d", val);
+ DBG("discovto=%d", val);
main_opts.discovto = val;
main_opts.flags |= 1 << HCID_SET_DISCOVTO;
}
@@ -109,29 +109,29 @@ static void parse_config(GKeyFile *config)
val = g_key_file_get_integer(config, "General",
"PairableTimeout", &err);
if (err) {
- debug("%s", err->message);
+ DBG("%s", err->message);
g_clear_error(&err);
} else {
- debug("pairto=%d", val);
+ DBG("pairto=%d", val);
main_opts.pairto = val;
}
val = g_key_file_get_integer(config, "General", "PageTimeout", &err);
if (err) {
- debug("%s", err->message);
+ DBG("%s", err->message);
g_clear_error(&err);
} else {
- debug("pageto=%d", val);
+ DBG("pageto=%d", val);
main_opts.pageto = val;
main_opts.flags |= 1 << HCID_SET_PAGETO;
}
str = g_key_file_get_string(config, "General", "Name", &err);
if (err) {
- debug("%s", err->message);
+ DBG("%s", err->message);
g_clear_error(&err);
} else {
- debug("name=%s", str);
+ DBG("name=%s", str);
g_free(main_opts.name);
main_opts.name = g_strdup(str);
main_opts.flags |= 1 << HCID_SET_NAME;
@@ -140,10 +140,10 @@ static void parse_config(GKeyFile *config)
str = g_key_file_get_string(config, "General", "Class", &err);
if (err) {
- debug("%s", err->message);
+ DBG("%s", err->message);
g_clear_error(&err);
} else {
- debug("class=%s", str);
+ DBG("class=%s", str);
main_opts.class = strtol(str, NULL, 16);
main_opts.flags |= 1 << HCID_SET_CLASS;
g_free(str);
@@ -152,17 +152,17 @@ static void parse_config(GKeyFile *config)
val = g_key_file_get_integer(config, "General",
"DiscoverSchedulerInterval", &err);
if (err) {
- debug("%s", err->message);
+ DBG("%s", err->message);
g_clear_error(&err);
} else {
- debug("discov_interval=%d", val);
+ DBG("discov_interval=%d", val);
main_opts.discov_interval = val;
}
boolean = g_key_file_get_boolean(config, "General",
"InitiallyPowered", &err);
if (err) {
- debug("%s", err->message);
+ DBG("%s", err->message);
g_clear_error(&err);
} else if (boolean == FALSE)
main_opts.mode = MODE_OFF;
@@ -170,17 +170,17 @@ static void parse_config(GKeyFile *config)
boolean = g_key_file_get_boolean(config, "General",
"RememberPowered", &err);
if (err) {
- debug("%s", err->message);
+ DBG("%s", err->message);
g_clear_error(&err);
} else
main_opts.remember_powered = boolean;
str = g_key_file_get_string(config, "General", "DeviceID", &err);
if (err) {
- debug("%s", err->message);
+ DBG("%s", err->message);
g_clear_error(&err);
} else {
- debug("deviceid=%s", str);
+ DBG("deviceid=%s", str);
strncpy(main_opts.deviceid, str,
sizeof(main_opts.deviceid) - 1);
g_free(str);
@@ -189,7 +189,7 @@ static void parse_config(GKeyFile *config)
boolean = g_key_file_get_boolean(config, "General",
"ReverseServiceDiscovery", &err);
if (err) {
- debug("%s", err->message);
+ DBG("%s", err->message);
g_clear_error(&err);
} else
main_opts.reverse_sdp = boolean;
diff --git a/src/plugin.c b/src/plugin.c
index 28b9cce..a63ce8e 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -67,7 +67,7 @@ static gboolean add_plugin(void *handle, struct bluetooth_plugin_desc *desc)
return FALSE;
}
- debug("Loading %s plugin", desc->name);
+ DBG("Loading %s plugin", desc->name);
plugin = g_try_new0(struct bluetooth_plugin, 1);
if (plugin == NULL)
@@ -130,7 +130,7 @@ gboolean plugin_init(GKeyFile *config)
else
disabled = NULL;
- debug("Loading builtin plugins");
+ DBG("Loading builtin plugins");
for (i = 0; __bluetooth_builtin[i]; i++) {
if (is_disabled(__bluetooth_builtin[i]->name, disabled))
@@ -144,7 +144,7 @@ gboolean plugin_init(GKeyFile *config)
goto start;
}
- debug("Loading plugins %s", PLUGINDIR);
+ DBG("Loading plugins %s", PLUGINDIR);
dir = g_dir_open(PLUGINDIR, 0, NULL);
if (!dir) {
@@ -210,7 +210,7 @@ void plugin_cleanup(void)
{
GSList *list;
- debug("Cleanup plugins");
+ DBG("Cleanup plugins");
for (list = plugins; list; list = list->next) {
struct bluetooth_plugin *plugin = list->data;
diff --git a/src/rfkill.c b/src/rfkill.c
index 0888776..7810846 100644
--- a/src/rfkill.c
+++ b/src/rfkill.c
@@ -90,7 +90,7 @@ static gboolean rfkill_event(GIOChannel *chan,
if (len != sizeof(struct rfkill_event))
return TRUE;
- debug("RFKILL event idx %u type %u op %u soft %u hard %u",
+ DBG("RFKILL event idx %u type %u op %u soft %u hard %u",
event->idx, event->type, event->op,
event->soft, event->hard);
@@ -131,7 +131,7 @@ static gboolean rfkill_event(GIOChannel *chan,
if (!adapter)
return TRUE;
- debug("RFKILL unblock for hci%d", id);
+ DBG("RFKILL unblock for hci%d", id);
btd_adapter_restore_powered(adapter);
diff --git a/src/sdpd-service.c b/src/sdpd-service.c
index 98260d0..cdbb4f4 100644
--- a/src/sdpd-service.c
+++ b/src/sdpd-service.c
@@ -415,7 +415,7 @@ int add_record_to_server(const bdaddr_t *src, sdp_record_t *rec)
return -1;
}
- debug("Adding record with handle 0x%05x", rec->handle);
+ DBG("Adding record with handle 0x%05x", rec->handle);
sdp_record_add(src, rec);
@@ -435,7 +435,7 @@ int add_record_to_server(const bdaddr_t *src, sdp_record_t *rec)
continue;
sdp_uuid2strn((uuid_t *) pattern->data, uuid, sizeof(uuid));
- debug("Record pattern UUID %s", uuid);
+ DBG("Record pattern UUID %s", uuid);
}
update_db_timestamp();
@@ -448,7 +448,7 @@ int remove_record_from_server(uint32_t handle)
{
sdp_record_t *rec;
- debug("Removing record with handle 0x%05x", handle);
+ DBG("Removing record with handle 0x%05x", handle);
rec = sdp_record_find(handle);
if (!rec)
diff --git a/src/security.c b/src/security.c
index 43b9365..1d0da45 100644
--- a/src/security.c
+++ b/src/security.c
@@ -314,12 +314,12 @@ static void link_key_request(int dev, bdaddr_t *sba, bdaddr_t *dba)
err = ioctl(dev, HCIGETAUTHINFO, (unsigned long) &req);
if (err < 0) {
if (errno != EINVAL)
- debug("HCIGETAUTHINFO failed %s (%d)",
+ DBG("HCIGETAUTHINFO failed %s (%d)",
strerror(errno), errno);
req.type = 0x00;
}
- debug("kernel auth requirements = 0x%02x", req.type);
+ DBG("kernel auth requirements = 0x%02x", req.type);
err = read_link_key(sba, dba, key, &type);
if (err < 0) {
@@ -331,7 +331,7 @@ static void link_key_request(int dev, bdaddr_t *sba, bdaddr_t *dba)
memcpy(lr.link_key, key, 16);
bacpy(&lr.bdaddr, dba);
- debug("stored link key type = 0x%02x", type);
+ DBG("stored link key type = 0x%02x", type);
/* Don't use debug link keys (0x03) and also don't use
* unauthenticated combination keys if MITM is required */
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] Move debug() to DBG()
From: Marcel Holtmann @ 2010-05-21 16:22 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1274457294-16232-1-git-send-email-gustavo@padovan.org>
Hi Gustavo,
> Use the new dynamic debug feature
all patches have been applied. Thanks.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] Fix device_match_pattern function
From: Luiz Augusto von Dentz @ 2010-05-22 8:45 UTC (permalink / raw)
To: Santiago Carot-Nemesio; +Cc: Santiago Carot-Nemesio, linux-bluetooth
In-Reply-To: <1274444229.2051.118.camel@mosquito>
Hi,
On Fri, May 21, 2010 at 2:17 PM, Santiago Carot-Nemesio
<scarot@libresoft.es> wrote:
> Hi Luiz,
>
> I would like to take up again this matter to discuss some estrange
> behaviour that we observed when a driver is probed.
>
>> At current moment only the
>> first one is being provided when driver is probed.
>
> Well, the comment in update_service function is clear when Service Class
> Id list is checked:
>
> /* Extract the first element and skip the remainning */
>
> I guess that only the first entry is valid to you to get the profile and
> add it to the profile list. We don't know very well why this decision
> was taken. It will very helpul for us if you can provide a brief
> explanation about that. Wouldn't a driver want to know if there are more
> entries in that Service Class ID List when it is probed?. For example a
> driver registering for two uuids and those uuids are present in the same
> Service Class ID List. Please notice that it is may happen in HDP. In
> this scenario only the first entry will appear in the profile list and
> then one uuid is passed to the driver when it is probed, well this is
> not true at all, see below for some abnormal behaviour with repeated
> uuids in the list that is provided to the driver.
>
> Let's suppose an SDP record like this:
> *Service Class ID List
> MDPSink
> MDPSource
> ....aditional info not relevant for this example....
>
> In that scenario, a driver is registered for next uuids:
> 00001400-0000-1000-8000-00805F9B34FB -> MDP (Health device profile)
> 00001401-0000-1000-8000-00805F9B34FB -> MDPSource
> 00001402-0000-1000-8000-00805F9B34FB -> MDPSink
>
> which is perfectly valid for a HDP driver due that no extra logic is
> required to manage both roles.
>
> In current Bluez implementation only profile MDPSink is taken in count
> due that it appear first in the service class ID list. In addition it
> will have affect to the uuids list provided when driver is probed wich
> will have repeated uuids due to an issue matching the uuid with the
> profiles list: device_match_driver function.
>
> First time that device_match_pattern is executed with uuid
> 00001400-0000-1000-8000-00805F9B34FB it will provide a list with the
> uuid 00001402-0000-1000-8000-00805F9B34FB wich is in the profile list
> (MDPSink) and that uuid will be inserted to the uuid list.
>
> Next iteration it will check next uuid provided in the driver:
> 00001401-0000-1000-8000-00805F9B34FB and device_match_pattern will
> return another time a list with 00001402-0000-1000-8000-00805F9B34FB
> uuid wich will be inserted another time in the for loop. Please, notice
> that now we have the same uuid inserted two times in the uuid list.
>
> Next it will check last uuid provided in the driver:
> 00001402-0000-1000-8000-00805F9B34FB and skip it because it is already
> inserted from before iteration.
>
> You can review the code to check it.
>
> Of course we always can get the necessary entries from the remote SDP
> record, but at least the repeated uuids can be avoided by setting a
> check before to insert anything in the uuid list that it will provided
> when the driver is probed:
>
> /* match pattern driver */
> match = device_match_pattern(device, *uuid, profiles);
> for (; match; match = match->next) {
> + if (!g_slist_find_custom(uuids, match->data,
> + (GCompareFunc) strcasecmp)) {
> uuids = g_slist_append(uuids, match->data);
> + }
> }
Yep, this is the correct fix, but also remember that we don't use
brackets in single line if statements.
Another thing you might want to do is to only list only MDP in the
divers .uuid or only MDPSource/MDPSink if you want them to be handle
in separated drivers, I would suggest doing the former since that is
much easier to do the matching in the core and in the latter you might
run in more problems while trying to read the record from the cache
since it is not the very first service class id listen in the record.
--
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply
* [PATCH] Fix repeated insertion of uuids when a device driver is matched
From: Santiago Carot-Nemesio @ 2010-05-22 10:01 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Santiago Carot-Nemesio
---
src/device.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/device.c b/src/device.c
index 6ba1612..2b6b97f 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1085,7 +1085,9 @@ static GSList *device_match_driver(struct btd_device *device,
/* match pattern driver */
match = device_match_pattern(device, *uuid, profiles);
for (; match; match = match->next)
- uuids = g_slist_append(uuids, match->data);
+ if (!g_slist_find_custom(uuids, match->data,
+ (GCompareFunc) strcasecmp))
+ uuids = g_slist_append(uuids, match->data);
}
return uuids;
--
1.6.3.3
^ permalink raw reply related
* Re: [PATCHv2 1/2] Bluetooth: Check sk is not owned before freeing l2cap_conn
From: Gustavo F. Padovan @ 2010-05-23 2:39 UTC (permalink / raw)
To: Emeltchenko Andrei; +Cc: linux-bluetooth
In-Reply-To: <1274436293-15063-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
* Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com> [2010-05-21 13:04:52 +0300]:
> From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
>
> Check that socket sk is not locked in user process before removing
> l2cap connection handler.
>
> krfcommd kernel thread may be preempted with l2cap tasklet which remove
> l2cap_conn structure. If krfcommd is in process of sending of RFCOMM reply
> (like "RFCOMM UA" reply to "RFCOMM DISC") then kernel crash happens.
>
> ...
> [ 694.175933] Unable to handle kernel NULL pointer dereference at virtual address 00000000
> [ 694.184936] pgd = c0004000
> [ 694.187683] [00000000] *pgd=00000000
> [ 694.191711] Internal error: Oops: 5 [#1] PREEMPT
> [ 694.196350] last sysfs file: /sys/devices/platform/hci_h4p/firmware/hci_h4p/loading
> [ 694.260375] CPU: 0 Not tainted (2.6.32.10 #1)
> [ 694.265106] PC is at l2cap_sock_sendmsg+0x43c/0x73c [l2cap]
> [ 694.270721] LR is at 0xd7017303
> ...
> [ 694.525085] Backtrace:
> [ 694.527587] [<bf266be0>] (l2cap_sock_sendmsg+0x0/0x73c [l2cap]) from [<c02f2cc8>] (sock_sendmsg+0xb8/0xd8)
> [ 694.537292] [<c02f2c10>] (sock_sendmsg+0x0/0xd8) from [<c02f3044>] (kernel_sendmsg+0x48/0x80)
> ...
>
> Modified version after comments of Gustavo F. Padovan <gustavo@padovan.org>
>
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
> ---
> net/bluetooth/l2cap.c | 25 +++++++++++++++++++++++++
> 1 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
> index bb00015..11060d6 100644
> --- a/net/bluetooth/l2cap.c
> +++ b/net/bluetooth/l2cap.c
> @@ -2927,6 +2927,13 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd
> break;
>
> default:
> + /* don't delete l2cap channel if sk is owned by user */
> + if (sock_owned_by_user(sk)) {
> + sk->sk_state = BT_DISCONN;
> + l2cap_sock_clear_timer(sk);
> + l2cap_sock_set_timer(sk, HZ);
Using the sock timer like you are you using looks too hackish, there are
kernel struct for such defer works. I still prefer the first solution,
that avoids the call to l2cap_chan_del() only.
But we have to solve the problem with the sock_kill() call, I'm
wondering if add a check inside l2cap_sock_kill is good idea. So we
check if the socket is owned by user and if yes, we just return, however
may have problem with socket refcnt doing that.
Looking to the rfcomm code I found something that could be cause of the
problem, there isn't any sock_hold() in the rfcomm code, maybe is it
missing? Nevertheless it does the sock_put() without call sock_hold().
Like you I'm trying to figure out how to fix this issue, I don't know
yet how to fix it properly. I advice to take a look on the rfcomm code
and check if we really are missing a sock_hold() there.
Also is not easy to reproduce such sequence of l2cap and rfcomm packets,
so I can't test the issue here too.
> + break;
> + }
> l2cap_chan_del(sk, ECONNREFUSED);
> break;
> }
> @@ -3135,6 +3142,15 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn, struct l2cap_cmd
> del_timer(&l2cap_pi(sk)->ack_timer);
> }
>
> + /* don't delete l2cap channel if sk is owned by user */
> + if (sock_owned_by_user(sk)) {
> + sk->sk_state = BT_DISCONN;
> + l2cap_sock_clear_timer(sk);
> + l2cap_sock_set_timer(sk, HZ);
> + bh_unlock_sock(sk);
> + return 0;
> + }
> +
> l2cap_chan_del(sk, ECONNRESET);
> bh_unlock_sock(sk);
>
> @@ -3167,6 +3183,15 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, struct l2cap_cmd
> del_timer(&l2cap_pi(sk)->ack_timer);
> }
>
> + /* don't delete l2cap channel if sk is owned by user */
> + if (sock_owned_by_user(sk)) {
> + sk->sk_state = BT_DISCONN;
> + l2cap_sock_clear_timer(sk);
> + l2cap_sock_set_timer(sk, HZ);
> + bh_unlock_sock(sk);
> + return 0;
> + }
> +
> l2cap_chan_del(sk, 0);
> bh_unlock_sock(sk);
>
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Gustavo F. Padovan
http://padovan.org
^ permalink raw reply
* Re: HDP proposed API(0.5)
From: Gustavo F. Padovan @ 2010-05-23 2:54 UTC (permalink / raw)
To: Santiago Carot-Nemesio
Cc: Elvis Pfützenreuter, João Paulo Rechi Vita, jcaden,
linux-bluetooth
In-Reply-To: <1274174920.2001.27.camel@mosquito>
Hi Santiago,
Sorry for the delay on the reply.
* Santiago Carot-Nemesio <scarot@libresoft.es> [2010-05-18 11:28:40 +0200]:
> Hello Gustavo,
>
> >
> > MCAP in kernel gives zero-copy communication and just one socket to the
> > HDP API. The better of both UNIX socket and pipes options.
> >
>
> That's right I agree with you, but the main question here is not based
> in hiding MCAP reconnection, because future profiles using MCAP may be
> concern about above reconnection. Please, remember that nothing about
> hiding reconnections are mentioned in MCAP specification. However,
> reconnection are exposed as deseable capability in MCAP that upper
> profiles can use.
>
> In other hands, in particular case of HDP, we want to hide reconnection
> process to application layer because ISO/IEEE11073-20601 is transport
> agnostic, that means for example, a manager or agent sending or
> receiving APDUs don't be concern about such issues in transpiort layer
> (neither MCAP nor HDP). As you can see, the problem isn't in MCAP but in
> HDP<-->App to achieve reconnection transparency. That's is better
> explained in ISO/IEEE11073-20601 and some references can be found in HDP
> white paper.
Exactly. I'm not trying to make reconnection transparent at MCAP level.
What I said is that we can achieve reconnection transparency on the
HDP <--> App level doing MCAP in kernel.
I'm not saying that MCAP should be in kernel, I'm just trying to address
advantages and disadvantages of both implementation.
>
>
> > > That semantics would be implemented in MCAP part. The HDP profile code itself is (or should be) free from these worries.
> > >
> > > Moving MCAP to kernel hides the complexity from userspace HDP profile, but it continues to exist. Then I worry about more complex debugging, dependency on kernel version (or need to put efforts on backporting). MCAP sits above L2CAP, not besides it.
> >
> > The complexity will exist anyway, I'm proposing a less complex option.
> > Is not that complex change the L2CAP channels used by the MCL inside the
> > kernel. Between all the proposed options to handle reconnection it
> > looks the less complex one.
> >
> > We should not care about backporting now. We are working directly
> > with upstream and upstream is what really matters here. :)
> >
> > You will depend on kernel version anyway since ERTM is inside the
> > kernel. About backport if you backport ERTM, then backport MCAP will be
> > easy.
> >
> > Also MCAP will keep sitting on top of L2CAP, that won't change.
> >
> > >
> > > I acknowledge that it would work, but honestly I prefer to see things being moved to the outside of the kernel than to the inside :)
> >
> > The real question here is where MCAP will fit better. And where it adds
> > less complexity to its users.
>
> >From my point of view we should avoid implement MCAP in kernel space
> for the same reason exposed by Jose Antonio and Elvis in other emails.
> IMHO hidding reconnections in MCAP is not an good reason to implement it
> in kernel space because transparency is required in HDP nor in MCAP.
>
> If you hide reconnection to upper profiles in MCAP, you are closing the
> door to future specifications if they require doing aditional precessing
> when a reconnection takes place in MCAP.
>
> Thanks for your comments.
>
> Regards,
>
--
Gustavo F. Padovan
http://padovan.org
^ permalink raw reply
* Auto trust entry remove
From: Christian Birchinger @ 2010-05-24 8:33 UTC (permalink / raw)
To: linux-bluetooth
Hello
In another futile attempt to get a SixAxis controller working
i noticed that bluetoothd removes the trust entry that's needed
for that device to work.
It doesn't matter if i use some device management tool like blueman
or just add the entry directly before starting the daemon. The later
seems the less problematic way to make sure no external component
messes with the config.
I started bluetoothd in debug mode with -nd and it doesn't even and
it does this right after it does "HIDP: Control: Virtual cable unplug"
for a reason i don't know.
I only see in strace that it does this and after it the trusts
file is 0 bytes again:
open("/var/lib/bluetooth/... .../trusts", O_RDWR) = 23
I didn't get any input data before but at least i got it connect
and register it to the kernel as HID device before.
Is this auto-untrust by the bluetoothd itself something new?
This is a 2.6.34 kernel with bluez 4.64(+sixaxis cable patch).
It's a fresh installation but with known working hardware components.
The controller works and the USB dongle worked with it back in
the bluez 3.x days.
I'm thankfull for any hints. Below is a hcidump of the session
to the point where it self disconnects, resets trusts and then
gets a access denied because of it.
Bye, Christian
HCI sniffer - Bluetooth packet analyzer ver 1.42
device: hci0 snap_len: 1028 filter: 0xffffffffffffffff
< HCI Command: Disconnect (0x01|0x0006) plen 3
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Disconn Complete (0x05) plen 4
> HCI Event: Connect Request (0x04) plen 10
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Role Change (0x12) plen 8
> HCI Event: Connect Complete (0x03) plen 11
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Read Remote Supported Features (0x0b) plen 11
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
> HCI Event: Command Status (0x0f) plen 4
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 17 scid 0x00e0
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x00e0 result 1 status 0
Connection pending - No futher information available
< ACL data: handle 11 flags 0x02 dlen 10
L2CAP(s): Info req: type 2
> ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x0000
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x00e0 result 0 status 0
Connection successful
> HCI Event: Remote Name Req Complete (0x07) plen 255
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
< ACL data: handle 11 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x00e0 flags 0x00 result 0 clen 4
MTU 672
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x00e0 flags 0x00 clen 0
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
Success
< ACL data: handle 11 flags 0x02 dlen 5
L2CAP(d): cid 0x00e0 len 1 [psm 17]
HIDP: Control: Virtual cable unplug
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x00e0 scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 19 scid 0x00e1
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0041 scid 0x00e1 result 1 status 2
Connection pending - Authorization pending
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0041 scid 0x00e1 result 0 status 0
Connection successful
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x00e0 scid 0x0040
> ACL data: handle 11 flags 0x02 dlen 36
L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 24
QoS 0x02 (Guaranteed)
< ACL data: handle 11 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x00e1 flags 0x00 result 0 clen 4
MTU 672
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x00e1 flags 0x00 clen 0
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 0
Success
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x00e1 scid 0x0041
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x0041 scid 0x00e1
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x0041 scid 0x00e1
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x00e1 scid 0x0041
> HCI Event: Number of Completed Packets (0x13) plen 5
< HCI Command: Disconnect (0x01|0x0006) plen 3
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Disconn Complete (0x05) plen 4
> HCI Event: Connect Request (0x04) plen 10
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Role Change (0x12) plen 8
> HCI Event: Connect Complete (0x03) plen 11
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Read Remote Supported Features (0x0b) plen 11
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
> HCI Event: Command Status (0x0f) plen 4
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 17 scid 0x00e2
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x00e2 result 1 status 0
Connection pending - No futher information available
< ACL data: handle 11 flags 0x02 dlen 10
L2CAP(s): Info req: type 2
> ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x0000
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x00e2 result 0 status 0
Connection successful
> HCI Event: Remote Name Req Complete (0x07) plen 255
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
< ACL data: handle 11 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x00e2 flags 0x00 result 0 clen 4
MTU 672
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x00e2 flags 0x00 clen 0
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
Success
< ACL data: handle 11 flags 0x02 dlen 5
L2CAP(d): cid 0x00e2 len 1 [psm 17]
HIDP: Control: Virtual cable unplug
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x00e2 scid 0x0040
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 19 scid 0x00e3
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0041 scid 0x00e3 result 1 status 2
Connection pending - Authorization pending
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0041 scid 0x00e3 result 0 status 0
Connection successful
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x00e2 scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 36
L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 24
QoS 0x02 (Guaranteed)
< ACL data: handle 11 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x00e3 flags 0x00 result 0 clen 4
MTU 672
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x00e3 flags 0x00 clen 0
> ACL data: handle 11 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 0
Success
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x00e3 scid 0x0041
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x00e3 scid 0x0041
< HCI Command: Disconnect (0x01|0x0006) plen 3
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Disconn Complete (0x05) plen 4
> HCI Event: Connect Request (0x04) plen 10
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Role Change (0x12) plen 8
> HCI Event: Connect Complete (0x03) plen 11
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Read Remote Supported Features (0x0b) plen 11
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
> HCI Event: Command Status (0x0f) plen 4
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 17 scid 0x00e4
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x00e4 result 1 status 0
Connection pending - No futher information available
< ACL data: handle 11 flags 0x02 dlen 10
L2CAP(s): Info req: type 2
> ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x0000
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x00e4 result 0 status 0
Connection successful
> HCI Event: Remote Name Req Complete (0x07) plen 255
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
< ACL data: handle 11 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x00e4 flags 0x00 result 0 clen 4
MTU 672
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x00e4 flags 0x00 clen 0
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
Success
< ACL data: handle 11 flags 0x02 dlen 5
L2CAP(d): cid 0x00e4 len 1 [psm 17]
HIDP: Control: Virtual cable unplug
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x00e4 scid 0x0040
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 19 scid 0x00e5
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0041 scid 0x00e5 result 1 status 2
Connection pending - Authorization pending
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0041 scid 0x00e5 result 0 status 0
Connection successful
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x00e4 scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 36
L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 24
QoS 0x02 (Guaranteed)
< ACL data: handle 11 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x00e5 flags 0x00 result 0 clen 4
MTU 672
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x00e5 flags 0x00 clen 0
> ACL data: handle 11 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 0
Success
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x00e5 scid 0x0041
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x0041 scid 0x00e5
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x0041 scid 0x00e5
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x00e5 scid 0x0041
< HCI Command: Disconnect (0x01|0x0006) plen 3
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Disconn Complete (0x05) plen 4
> HCI Event: Connect Request (0x04) plen 10
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Role Change (0x12) plen 8
> HCI Event: Connect Complete (0x03) plen 11
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Read Remote Supported Features (0x0b) plen 11
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
> HCI Event: Command Status (0x0f) plen 4
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 17 scid 0x00e6
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x00e6 result 1 status 0
Connection pending - No futher information available
< ACL data: handle 11 flags 0x02 dlen 10
L2CAP(s): Info req: type 2
> ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x0000
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x00e6 result 0 status 0
Connection successful
> HCI Event: Remote Name Req Complete (0x07) plen 255
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
< ACL data: handle 11 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x00e6 flags 0x00 result 0 clen 4
MTU 672
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x00e6 flags 0x00 clen 0
> HCI Event: Number of Completed Packets (0x13) plen 5
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
Success
< ACL data: handle 11 flags 0x02 dlen 5
L2CAP(d): cid 0x00e6 len 1 [psm 17]
HIDP: Control: Virtual cable unplug
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x00e6 scid 0x0040
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 19 scid 0x00e7
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0041 scid 0x00e7 result 1 status 2
Connection pending - Authorization pending
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0041 scid 0x00e7 result 0 status 0
Connection successful
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x00e6 scid 0x0040
> ACL data: handle 11 flags 0x02 dlen 36
L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 24
QoS 0x02 (Guaranteed)
< ACL data: handle 11 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x00e7 flags 0x00 result 0 clen 4
MTU 672
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x00e7 flags 0x00 clen 0
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 0
Success
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x00e7 scid 0x0041
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x00e7 scid 0x0041
> HCI Event: Number of Completed Packets (0x13) plen 5
< HCI Command: Disconnect (0x01|0x0006) plen 3
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Disconn Complete (0x05) plen 4
> HCI Event: Connect Request (0x04) plen 10
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Role Change (0x12) plen 8
> HCI Event: Connect Complete (0x03) plen 11
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Read Remote Supported Features (0x0b) plen 11
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
> HCI Event: Command Status (0x0f) plen 4
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 17 scid 0x00e8
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x00e8 result 1 status 0
Connection pending - No futher information available
< ACL data: handle 11 flags 0x02 dlen 10
L2CAP(s): Info req: type 2
> ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x0000
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x00e8 result 0 status 0
Connection successful
> HCI Event: Remote Name Req Complete (0x07) plen 255
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
< ACL data: handle 11 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x00e8 flags 0x00 result 0 clen 4
MTU 672
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x00e8 flags 0x00 clen 0
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
Success
< ACL data: handle 11 flags 0x02 dlen 5
L2CAP(d): cid 0x00e8 len 1 [psm 17]
HIDP: Control: Virtual cable unplug
< ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x00e8 scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 19 scid 0x00e9
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0041 scid 0x00e9 result 1 status 2
Connection pending - Authorization pending
< ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0041 scid 0x00e9 result 3 status 0
Connection refused - security block
> ACL data: handle 11 flags 0x02 dlen 12
L2CAP(s): Disconn rsp: dcid 0x00e8 scid 0x0040
^ 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