?? readme
字號:
Bluetooth Driver for Linux Kernel v2.0, v2.2 and v2.4-----------------------------------------------------These files are a work in progress. For more information on Bluetooth on Linux see http://sourceforge.net/projects/openbt/ where you can findthe newest versions of the software.See the ChangeLog file for list of all changes.================================================================================================================================================1) How to build and install the AXIS Bluetooth Stack----------------------------------------------------# Unpack the archive:tar xvfz <name of archive># Create the Bluetooth stack module and all applications (both for use with the kernel version of the stack and the user mode version):cd openbtsource init_env(See section 6 on how to compile for different Bluetooth HW)make# Install the applications in /usr/local/bin and the SDP configuration file in /etc (must be done as root):make install# If the BT device nodes have not been created previously then do (as root):make devs# Insert the module into the kernel (must be done as root):insmod src/bt.o# To get debug messages in kernel start another window and issue:tail -f /var/log/messages (or whatever file is set in /etc/syslog.conf)========================================================================2) Multi-Point Bluetooth Daemon application (btdm)--------------------------------------------------2.1) How to start the btdm application? Both short and long options may be used whatever suits best. syntax: ./btdm [options] options: -u, --physdev <uart device> sets which uart device that will be used by the stack default: ttyS2 -m, --modem Use modem emulation (used when emulate modem in windows dialup. Can also be done from command line mode. default: on -n, --local-name prefix used for the local Bluetooth device name default: nothing -R, --reset reset Bluetooth hardware before use default: no reset -i, --initial-speed <speed | baudbase/divisor> sets initial uart speed default: 115200 baud -s, --speed <speed> sets uart speed 9600, 19200, 38400, 57600, 115200, 230400, 460800 default: 115200 baud -f, --noflow force uart communication to not use CTS and RTS default: flow control activated if defined hardware support it e.g if using module at 460800 baud and acting as server ./btdm --speed 460800 if using non default devices ./btdm --physdev /dev/ttyS2 [options...]- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -2.2) How to setup a session between two units?Server side:1. btdm --reset --speed 115200Client side:1. bti --reset --speed 1152002. Connect to the other unit by executing btcon -a <bd address>========================================================================3) Bluetooth Daemon application (btd)------------------------------------- BTD IS OBSOLETE, AND SHOULD ONLY BE USED IN CASE BTDM DOES NOT WORK AS EXPECTED. DO NOT EXPECT TO RECEIVE ANY SUPPORT FOR BTD.- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -3.1) How to start the btd application? Both short and long options may be used whatever suits best. syntax: ./btd [options] options: -u, --physdev <uart device> sets which uart device that will be used by the stack default: ttyS2 -b, --btdev <Bluetooth device> sets which Bluetooth device that will be used from application default: ttyBT0 -d, --local <local ip> Sets local ipadress in pppd options -D, --remote <remote ip> Sets remote ipaddress in pppd options -e, --modem Use modem emulation (used when emulate modem in windows dialup. Can also be done from command line mode. default: on -m, --cmdmode enters command line mode default: skip command line mode -n, --local-name prefix used for the local Bluetooth device name default: nothing "-r server", --server sets application role to server "-r client", --client sets application role to client) default: server -R, --reset reset Bluetooth hardware before use default: no reset -s, --speed <speed> sets uart speed 9600, 19200, 38400, 57600, 115200, 230400, 460800 default: 115200 baud -S, --unixsock use local unix socket as phys device Used together with hci emulation to test stack locally (usermode stack only) -T, --tcpsock <ipaddr:port> use tcp socket as phys device. Used together with hci emulation to test stack over any TCP/IP based network Server listens on <:port>, client tries to connect to <ipaddr:port>. (usermode stack only) e.g if using module at 460800 baud and acting server ./btd --speed 460800 if acting as a client with a command line interface ./btd -r client if using non default devices ./btd --physdev /dev/ttyS2 --btdev /dev/ttyBT3 [options...] if using the stack in usermode over a local UNIX socket. Do the following in separate windows Server : ./btd --cmdmode --unixsock Client : ./btd --cmdmode --unixsock --client if using the stack in usermode over a TCP socket. Do the following on separate computers connected to the same network Server : ./btd --cmdmode --tcpsock <:port> Client : ./btd --cmdmode --tcpsocket <ipaddr:port> --client- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -3.2) What do the command menu options do in btd?inq (inquiry scan) Performs an inquiry to see what other devices that are presentrf_conn <xx:xx:xx:xx:xx:xx> <srv ch> <line> Connect to BT device with BD_ADDR <xx:xx:xx:xx:xx:xx> on line <line> with RFCOMM server channel <srv channel> <profile (not used)>rf_send <nbr bytes> <nbr repeats> <line> Just send chunks of data. <nbr bytes> are sent <nbr repeats> times. Data is sent using the RFCOMM protocol layerrf_disc <line> Disconnect the rfcomm session that is connected on this linerf_wait <line> Waits for an rfcomm connection on this lineme <1/0> Turn modem emulation on/off. Modem emulation is used on the server side to fool a windows client that it is talking to a modem. The emulation answers OK to all AT*\r\n sequences. When it receives ATD*\r\n it quits and let data through to ppp.setbd <xx:xx:xx:xx:xx:xx> Set the BT device BD_ADDR to <xx:xx:xx:xx:xx:xx> (Currently Ericsson specific)readbd Get the BT device BD_ADDR reset Reset the BT device.ppp Quit btd and start ppp to the peer instead. quit Just quit.- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -3.3) How to setup a session between two unitsServer side:1. btd --reset --speed 115200Client side:1. btd --reset --speed 115200 -r client2. Connect to the other unit by doing rf_conn <bd address> <srv ch>========================================================================4) How to use the stack in user mode instead of in the kernel------------------------------------------------------------- THE USERMODE STACK SHOULD ONLY BE USED FOR DEVELOPMENT AND TESTING OF BASIC STACK FUNCTIONALITIES AND DOES NOT PROVIDE THE FULL STACK FUNCTIONALITIES (blocking calls, multiple lines etc etc).1) Build the applications according to the instructions above.2) Run btduser (as root) with the same options as with the btd application (see above).If something does not work, then look in /var/log/messages or whateverfile syslog is set to use (see /etc/syslog.conf) *** NOTE -- pppd must support running on pty:s (version >= 2.3.7) ***========================================================================5) How do I setup the stack for different Bluetooth hardware?-------------------------------------------------------------You need to modify btconfig.h, and define whichever ofCONFIG_BLUETOOTH_<hardware> that matches the hardware you are using.========================================================================6) How to setup a session without any Bluetooth hardware--------------------------------------------------------To make the stack work without any hardware, HCI_EMULATION must be switched on in the file btconfig.h and the stack must be recompiled.You will see a note in the debug messages when starting the stack if HCIemulation really is used or not.********* Note *********The HCI emulation as of today simply converts some HCI commands to the corresponding events and simply forwards all ACL/SCO data.If you get messages from the stack that something fails when initiating the stack it is because those HCI commands are not supported in the HCI emulator.Anyone who wants to is welcome to improve it and send us a patch. For example, there could be network delays/packet losses included and different kinds of hardware can be simulated.There are three ways depending on how you want to test the stack.The first one works both when running the stack in kernel and when running it in user mode. The other two (2 and 3 below) works only in user mode.See above for details on command options- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -6.1) Using a serial cable (null modem)Connect 2 Linux PC with a null modem cable, and start the btd application as server as one side and btd as client on the other side.Server side:1. start btd with the option btd --physdev <phys device> --speed <speed> --cmdmode --local <local ip> --remote <remote ip>Client side:1. start btd with the option btd --physdev <phys device> --speed <speed> --client --hwinit none2. When the menu shows and server also are setup and initialized type: rf_conn 11:22:33:44:55:66 <srv ch> <line> (BD address is ignored)- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -6.2) Using a local unix socket on one computerServer side:1. btd --cmdmode --unixsockClient side:1. btd --client --unixsock2. When the menu shows and server also are setup and initialized type: rf_conn 11:22:33:44:55:66 <srv ch> <line> (BD address is ignored)- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -6.3) Using a network tcp socket between two computers if using the stack in user mode over a TCP socket. Do the following on separate computers connected to a networkServer side:1. btd --tcpsock <:port> Client side:1. Client: ./btd --tcpsocket <ipaddr:port> --client2. When the menu shows and server also are setup and initialized type: rf_conn 11:22:33:44:55:66 <srv ch> <line> (BD address is ignored)========================================================================7) It does not work, what am I doing wrong? -------------------------------------------FAQ Q: What is the difference between kernel mode and user mode?A: bt.o is the kernel mode driver. When you insmod bt.o you are inserting it into the kernel, where it can cause bad things to happen if it screws up. btduser is the user mode driver. It runs as an application in user space, where usually the worse thing that can happen is a segfault. You don't have to insmod anything for user mode. You just run the application. To build the 'stack' for usermode just go to the top level and type 'make'. If you see errors while building btduser then cd to the btduser directory and type 'make links'. Then try again. Finally, at the top level type 'make install' (as root). Then btduser should be in your path.Q: After I make a connection from the client and try to send data I see the following error message on the server side: BT SYS: ERROR :Line 0 not active and linebuf full, silent discard \ (considerincreasing line buffer [256])A: It's not an error (even though the debug says it...), it only tells you that the line buffer is full. The reason for this is that you don't seem to have an application on top of the tty which takes care of the data. The line buffer was meant to store a small amount of data until an application was started after detecting that a connection was setup. E.g pppd is started over /dev/ttyBT0 when a new rfcomm is discovered. If this takes too long the data won't be lost. (Answer provided by Mattias Agren)o If you are having troubles with trashed data on the UART please look at http://developer.axis.com/download/bluetooth/uart_problemsFor debug when running in kernel, look in /var/log/messages, /var/log/debug or whatever file is specified in /etc/syslog.confIf you think you have found a bug please switch on all debug in btdebug.h and send the logs to bluetooth-dev@axis.com together with a description of the problem.========================================================================Please let us know if there are any unclear issues or errors in this README. Comments are appreciated and if there are someone that feels an urge of making it more complete please contact us or send us a text fragment and we will happily include it!Finally, we would also like to thank all contributors on the stack for comments and patches etc.Keep up the good work !Best regards The Bluetooth Team,Axis Communications AB================================================================================================================================================
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -