In the next example I will show you how you can upload files from command line to your mobile phone using Bluetooth:
First you need to run sdptool search OPUSH to see if your phone provide Object PUSH and on which channel it was provided and also the mac address of the phone. My results were as follows:
# sdptool search OPUSH
Inquiring …
Searching for OPUSH on 00:1F:01:28:B2:36 …
Service Name: OBEX Object Push
Service RecHandle: 0×10001
Service Class ID List:
“OBEX Object Push” (0×1105)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 9
“OBEX” (0×0008)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Profile Descriptor List:
“OBEX Object Push” (0×1105)
Version: 0×0100
As you can see it runs on channel 9. Now to upload some files:
# obex_test -b 00:1F:01:28:B2:36 9
Using Bluetooth RFCOMM transport
OBEX Interactive test client/server.
> c
Connect OK!
Version: 0×10. Flags: 0×00
> p
PUT file (local, remote)> /root/www_starhost_ro.jpg www_starhost_ro.jpg
name=/root/www_starhost_ro.jpg, size=72674
Going to send 72674 bytes
Made some progress…
Made some progress…
Made some progress…
PUT successful!
>
q
#
Somne other intresting commands:
# hcitool scan
Scanning …
00:12:D2:30:E8:00 Adelita
#
# sdptool browse 00:1F:01:28:B2:36
Browsing 00:1F:01:28:B2:36 …
Service Name: Network Access Point Service
Service Description: Personal Ad-hoc Network Service which provides access to a network
Service RecHandle: 0×10000
Service Class ID List:
“Network Access Point” (0×1116)
Protocol Descriptor List:
“L2CAP” (0×0100)
PSM: 15
“BNEP” (0x000f)
Version: 0×0100
SEQ8: dd 6
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Profile Descriptor List:
“Network Access Point” (0×1116)
Version: 0×0100
Service Name: OBEX Object Push
Service RecHandle: 0×10001
Service Class ID List:
“OBEX Object Push” (0×1105)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 9
“OBEX” (0×0008)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Profile Descriptor List:
“OBEX Object Push” (0×1105)
Version: 0×0100
Service Name: OBEX File Transfer
Service RecHandle: 0×10002
Service Class ID List:
“OBEX File Transfer” (0×1106)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 10
“OBEX” (0×0008)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Profile Descriptor List:
“OBEX File Transfer” (0×1106)
Version: 0×0100
Service Name: Dial-up networking
Service RecHandle: 0×10003
Service Class ID List:
“Dialup Networking” (0×1103)
“Generic Networking” (0×1201)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Profile Descriptor List:
“Dialup Networking” (0×1103)
Version: 0×0100
Service Name: Nokia PC Suite
Service RecHandle: 0×10004
Service Class ID List:
“Serial Port” (0×1101)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 15
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Service Name: COM 1
Service RecHandle: 0×10005
Service Class ID List:
“Serial Port” (0×1101)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 3
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Service Name: Voice Gateway
Service RecHandle: 0×10006
Service Class ID List:
“Handsfree Audio Gateway” (0x111f)
“Generic Audio” (0×1203)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 13
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Profile Descriptor List:
“Handsfree” (0x111e)
Version: 0×0105
Service Name: Audio Gateway
Service RecHandle: 0×10007
Service Class ID List:
“Headset Audio Gateway” (0×1112)
“Generic Audio” (0×1203)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 12
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Profile Descriptor List:
“Headset” (0×1108)
Version: 0×0100
Service Name: SyncML Client
Service RecHandle: 0×10009
Service Class ID List:
UUID 128: 00000002-0000-1000-8000-0002ee000002
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 11
“OBEX” (0×0008)
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Service Name: SIM ACCESS
Service RecHandle: 0x1000e
Service Class ID List:
“SIM Access” (0x112d)
“Generic Telephony” (0×1204)
Protocol Descriptor List:
“L2CAP” (0×0100)
“RFCOMM” (0×0003)
Channel: 4
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0×100
Profile Descriptor List:
“SIM Access” (0x112d)
Version: 0×0101
rfcomm connect rfcomm0 00:1F:01:28:B2:36 1
# rfcomm
rfcomm0: 00:1F:01:28:B2:36 channel 1 clean
no comment untill now