* [PATCH hcidump 2/2] core: Add support for passing PSM as OBEX port
2012-02-17 9:48 [PATCH hcidump 1/2] L2CAP: add OBEX support Luiz Augusto von Dentz
@ 2012-02-17 9:48 ` Luiz Augusto von Dentz
2012-02-17 11:06 ` [PATCH hcidump 1/2] L2CAP: add OBEX support Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2012-02-17 9:48 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
As OBEX can now use L2CAP as transport, -O/--obex option should accept
values other than RFCOMM channel, so values over 31 are now interpreted
as PSM.
---
src/hcidump.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/hcidump.c b/src/hcidump.c
index 0c13360..36eedc5 100644
--- a/src/hcidump.c
+++ b/src/hcidump.c
@@ -855,7 +855,7 @@ static void usage(void)
" -R, --raw Dump raw data\n"
" -C, --cmtp=psm PSM for CMTP\n"
" -H, --hcrp=psm PSM for HCRP\n"
- " -O, --obex=channel Channel for OBEX\n"
+ " -O, --obex=port Channel/PSM for OBEX\n"
" -P, --ppp=channel Channel for PPP\n"
" -D, --pppdump=file Extract PPP traffic\n"
" -A, --audio=file Extract SCO audio data\n"
@@ -904,6 +904,7 @@ int main(int argc, char *argv[])
int defpsm = 0;
int defcompid = DEFAULT_COMPID;
int opt, pppdump_fd = -1, audio_fd = -1;
+ uint16_t obex_port;
while ((opt=getopt_long(argc, argv, "i:l:p:m:w:r:d:taxXRC:H:O:P:D:A:YZ46hv", main_options, NULL)) != -1) {
switch(opt) {
@@ -970,7 +971,11 @@ int main(int argc, char *argv[])
break;
case 'O':
- set_proto(0, 0, atoi(optarg), SDP_UUID_OBEX);
+ obex_port = atoi(optarg);
+ if (obex_port > 31)
+ set_proto(0, obex_port, 0, SDP_UUID_OBEX);
+ else
+ set_proto(0, 0, obex_port, SDP_UUID_OBEX);
break;
case 'P':
--
1.7.7.6
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH hcidump 1/2] L2CAP: add OBEX support
2012-02-17 9:48 [PATCH hcidump 1/2] L2CAP: add OBEX support Luiz Augusto von Dentz
2012-02-17 9:48 ` [PATCH hcidump 2/2] core: Add support for passing PSM as OBEX port Luiz Augusto von Dentz
@ 2012-02-17 11:06 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2012-02-17 11:06 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hi Luiz,
On Fri, Feb 17, 2012, Luiz Augusto von Dentz wrote:
> ---
> parser/l2cap.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/parser/l2cap.c b/parser/l2cap.c
> index 696456a..fba530a 100644
> --- a/parser/l2cap.c
> +++ b/parser/l2cap.c
> @@ -1090,6 +1090,14 @@ static void l2cap_parse(int level, struct frame *frm)
> raw_dump(level + 1, frm);
> break;
>
> + case SDP_UUID_OBEX:
> + if (!p_filter(FILT_OBEX))
> + obex_dump(level, frm);
> + else
> + raw_dump(level + 1, frm);
> + break;
> +
> +
> default:
One unnecessary empty line above. Other than that the patches looked
fine so they're now (with the above fix) pushed upstream.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread