aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2012-02-17 11:48:55 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-17 13:04:48 +0200
commitbbbd45012eae6eb1342018bef089c60d1eec8fdf (patch)
tree855efa761773cb22de6ac741d50b743ac765c15e
parent60651dea51959587e18ca7e091cc81aa97a44bc4 (diff)
downloadbluez-hcidump-bbbd45012eae6eb1342018bef089c60d1eec8fdf.tar.gz
bluez-hcidump-bbbd45012eae6eb1342018bef089c60d1eec8fdf.tar.xz
bluez-hcidump-bbbd45012eae6eb1342018bef089c60d1eec8fdf.zip
core: Add support for passing PSM as OBEX port
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.
-rw-r--r--src/hcidump.c9
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':