⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 network-bluetooth.html

📁 FreeBSD操作系统的详细使用手册
💻 HTML
📖 第 1 页 / 共 3 页
字号:
Network Access with PPP (LAN) Profiles</a></h2><p>The Dial-Up Networking (DUN) profile is mostly used with modems and cellular phones.The scenarios covered by this profile are the following:</p><ul><li><p>use of a cellular phone or modem by a computer as a wireless modem for connecting to adial-up Internet access server, or using other dial-up services;</p></li><li><p>use of a cellular phone or modem by a computer to receive data calls.</p></li></ul><p>Network Access with PPP (LAN) profile can be used in the following situations:</p><ul><li><p>LAN access for a single Bluetooth device;</p></li><li><p>LAN access for multiple Bluetooth devices;</p></li><li><p>PC to PC (using PPP networking over serial cable emulation).</p></li></ul><p>In FreeBSD both profiles are implemented with <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=ppp&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ppp</span>(8)</span></a> and <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=rfcomm_pppd&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">rfcomm_pppd</span>(8)</span></a> - awrapper that converts RFCOMM Bluetooth connection into something PPP can operate with.Before any profile can be used, a new PPP label in the <ttclass="FILENAME">/etc/ppp/ppp.conf</tt> must be created. Consult <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=rfcomm_pppd&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">rfcomm_pppd</span>(8)</span></a> manualpage for examples.</p><p>In the following example <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=rfcomm_pppd&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">rfcomm_pppd</span>(8)</span></a> will beused to open RFCOMM connection to remote device with BD_ADDR 00:80:37:29:19:a4 on DUNRFCOMM channel. The actual RFCOMM channel number will be obtained from the remote devicevia SDP. It is possible to specify RFCOMM channel by hand, and in this case <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=rfcomm_pppd&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">rfcomm_pppd</span>(8)</span></a> willnot perform SDP query. Use <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=sdpcontrol&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">sdpcontrol</span>(8)</span></a> to findout RFCOMM channel on the remote device.</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">rfcomm_pppd -a 00:80:37:29:19:a4 -c -C dun -l rfcomm-dialup</kbd></pre><p>In order to provide Network Access with PPP (LAN) service the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=sdpd&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">sdpd</span>(8)</span></a> server must berunning. A new entry for LAN clients must be created in the <ttclass="FILENAME">/etc/ppp/ppp.conf</tt> file. Consult <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=rfcomm_pppd&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">rfcomm_pppd</span>(8)</span></a> manualpage for examples. Finally, start RFCOMM PPP server on valid RFCOMM channel number. TheRFCOMM PPP server will automatically register Bluetooth LAN service with the local SDPdaemon. The example below shows how to start RFCOMM PPP server.</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">rfcomm_pppd -s -C 7 -l rfcomm-server</kbd></pre></div><div class="SECT2"><h2 class="SECT2"><a id="AEN36859" name="AEN36859">24.4.9 OBEX Object Push (OPUSH)Profile</a></h2><p>OBEX is a widely used protocol for simple file transfers between mobile devices. Itsmain use is in infrared communication, where it is used for generic file transfersbetween notebooks or PDAs, and for sending business cards or calendar entries betweencellular phones and other devices with PIM applications.</p><p>The OBEX server and client are implemented as a third-party package <bclass="APPLICATION">obexapp</b>, which is available as <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/comms/obexapp/pkg-descr"><ttclass="FILENAME">comms/obexapp</tt></a> port.</p><p>OBEX client is used to push and/or pull objects from the OBEX server. An object can,for example, be a business card or an appointment. The OBEX client can obtain RFCOMMchannel number from the remote device via SDP. This can be done by specifying servicename instead of RFCOMM channel number. Supported service names are: IrMC, FTRN and OPUSH.It is possible to specify RFCOMM channel as a number. Below is an example of an OBEXsession, where device information object is pulled from the cellular phone, and a newobject (business card) is pushed into the phone's directory.</p><pre class="SCREEN"><samp class="PROMPT">%</samp> <kbdclass="USERINPUT">obexapp -a 00:80:37:29:19:a4 -C IrMC</kbd>obex&gt; getget: remote file&gt; telecom/devinfo.txtget: local file&gt; devinfo-t39.txtSuccess, response: OK, Success (0x20)obex&gt; putput: local file&gt; new.vcfput: remote file&gt; new.vcfSuccess, response: OK, Success (0x20)obex&gt; diSuccess, response: OK, Success (0x20)</pre><p>In order to provide OBEX Object Push service, <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=sdpd&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">sdpd</span>(8)</span></a> server must berunning. A root folder, where all incoming objects will be stored, must be created. Thedefault path to the root folder is <tt class="FILENAME">/var/spool/obex</tt>. Finally,start OBEX server on valid RFCOMM channel number. The OBEX server will automaticallyregister OBEX Object Push service with the local SDP daemon. The example below shows howto start OBEX server.</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">obexapp -s -C 10</kbd></pre></div><div class="SECT2"><h2 class="SECT2"><a id="AEN36877" name="AEN36877">24.4.10 Serial Port Profile(SPP)</a></h2><p>The Serial Port Profile (SPP) allows Bluetooth devices to perform RS232 (or similar)serial cable emulation. The scenario covered by this profile deals with legacyapplications using Bluetooth as a cable replacement, through a virtual serial portabstraction.</p><p>The <a href="http://www.FreeBSD.org/cgi/man.cgi?query=rfcomm_sppd&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">rfcomm_sppd</span>(1)</span></a> utilityimplements the Serial Port profile. A pseudo tty is used as a virtual serial portabstraction. The example below shows how to connect to a remote device Serial Portservice. Note that you do not have to specify a RFCOMM channel - <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=rfcomm_sppd&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">rfcomm_sppd</span>(1)</span></a> canobtain it from the remote device via SDP. If you would like to override this, specify aRFCOMM channel on the command line.</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">rfcomm_sppd -a 00:07:E0:00:0B:CA -t /dev/ttyp6</kbd>rfcomm_sppd[94692]: Starting on /dev/ttyp6...</pre><p>Once connected, the pseudo tty can be used as serial port:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cu -l ttyp6</kbd></pre></div><div class="SECT2"><h2 class="SECT2"><a id="AEN36894" name="AEN36894">24.4.11 Troubleshooting</a></h2><div class="SECT3"><h3 class="SECT3"><a id="AEN36896" name="AEN36896">24.4.11.1 A remote device cannotconnect</a></h3><p>Some older Bluetooth devices do not support role switching. By default, when FreeBSDis accepting a new connection, it tries to perform a role switch and become master.Devices, which do not support this will not be able to connect. Note that role switchingis performed when a new connection is being established, so it is not possible to ask theremote device if it does support role switching. There is a HCI option to disable roleswitching on the local side:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">hccontrol -n ubt0hci write_node_role_switch 0</kbd></pre></div><div class="SECT3"><h3 class="SECT3"><a id="AEN36902" name="AEN36902">24.4.11.2 Something is going wrong,can I see what exactly is happening?</a></h3><p>Yes, you can. Use the <b class="APPLICATION">hcidump-1.5</b> third-party package thatcan be downloaded from <a href="http://www.geocities.com/m_evmenkin/"target="_top">http://www.geocities.com/m_evmenkin/</a>. The <bclass="APPLICATION">hcidump</b> utility is similar to <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=tcpdump&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">tcpdump</span>(1)</span></a>. It can beused to display the content of the Bluetooth packets on the terminal and to dump theBluetooth packets to a file.</p></div></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="network-wireless.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="network-bridging.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Wireless Networking</td><td width="34%" align="center" valign="top"><a href="advanced-networking.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Bridging</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting &#60;<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>&#62;.<br />For questions about this documentation, e-mail &#60;<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&#62;.</small></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -