How to use Bluetooth in Linux
I. Bluetooth storage device
Bluetooth adapter: ISSC chip, USB interface (there are other brands on the market, most of which are OK)
Bluetooth mobile phone: Sony Ericsson t628
Bluetooth headset: Jabra bt250 (the Chinese mainland model is fs258, which takes care of the special Chinese understanding of Bt and 258 Geely numbers)
1. Load the Bluetooth adapter
After the USB port is inserted, you can use the lsusb command to see:
Bus 004 device 003: Id 1131: 1001 integrated system solution Corp.
Here is, run hciconfig and you can see:
Hci0: Type: USB
BD address: 00: 11: 67: 02: 1A: 03 acl mtu: 678: 8 sco mtu: 48: 5
Down
RX Bytes: 142289 ACL: 884 SCO: 0 events: 823 errors: 0
TX Bytes: 13302 ACL: 494 SCO: 0 commands: 151 errors: 0
Run:
Hciconfig hci0 up
Can activate the excuse (this step is not done, hcitool scan cannot run)
3. Configure bluez
Put the default configuration file in the/etc/Bluetooth directory
Hcid. conf and pin do not need to be modified. The security mode has been set to auto to facilitate the connection. You can modify them by yourself. We recommend that you do not modify them to prevent some devices from being connected.
4. Restart the Bluetooth service.
/Etc/rc. d/init. d/Bluetooth stop
/Etc/rc. d/init. d/Bluetooth start
5. Scan Devices
Run hcitool scan to obtain:
Scanning...
00: 01: EC: 0C: D2: 00 tree's t628
6. modify the configuration file:
Modify/etc/Bluetooth/RFCOMM. conf
Replace the following:
Device 11: 22: 33: 44: 55: 66;
The result of hcitool scan:
Device 00: 01: EC: 0C: D2: 00
Save and exit.
7. Create a device:
Run
Rfcomm_create_dev.
8. Add a channel:
Sdptool add -- channel = 1 did SP Dun LAN fax opush ftp hs hf sap nap GN Panu hid cip ctp a2src a2snk SyncML nokid pcsuite SR1
The following parameters are not necessarily supported, but in case some services are not opened, they are all opened.
RFCOMM bind/dev/rfcomm0 address channel (configured in RFCOMM. conf)
The command here should be written:
RFCOMM bind/dev/rfcomm0 00: 01: EC: 0C: D2: 00 1
9. Connect to the mobile phone:
Hcitool CC phone address
That is
Hcitool CC 00: 01: EC: 0C: D2: 00
At this time, we can see that the Bluetooth connection on the mobile phone is in the China Unicom status.
10. Send files from the computer:
Obex-send abc.jpg
The operating system prompts you to select the target to be sent.
At the same time, a prompt box is displayed on the mobile phone asking whether to accept the file.
11. Mobile phone Configuration:
You need to perform the following configuration on your mobile phone:
Connect-> Bluetooth-> matching device-> Add device.
Automatically scans the adapter on the PC.
If you need to fill in the identification code, enter 123. It has been set above.
At this time, we can see that the mobile phone has successfully added a bluetooth device.
12. Send a file from your mobile phone.
Start obex-server on a PC and a small icon appears on the system tray.
After completing the above work, you can enter the mobile phone:
Multimedia> my album
Select an image.
Then, "send"-> "via Bluetooth"
We can see the Bluetooth adapter we just scanned.
Then, you can send the file.
13. use software to manage mobile phone information.
Refer to the gnokii software documentation
Ii. Bluetooth headsets.
1. At the same time, press the "phone key" and "volume increase key" on Jabra 250. The blue light is always on for about 8 seconds.
1. Scan the headset to get the bdaddress
Hcitool Scan
3. Configuration:
Modprobe snd_bt_sco
Hciconfig hci0 void 0x0060
Btsco bdaddress (the bdaddress here is the result of the scan)
After btsco runs, a dialog box is displayed, asking you to enter the pin of the headset. The value of Jabra 250 is 0000, which can be found in the instruction manual.
4. After the connection is established, the device is mapped to/dev/dsp1.
Taking beep as an example,
Plug-in-> output, select the Alsa driver and click "Preferences". In the audio settings section, you can see information such as btsco: hw0 and 1. Select this one.
Play a song and try wireless fun.
Then configure the player you want to use.