Opnedevices.net 嵌入式开发网 技术文档精华
  • 设为首页

  • 加入收藏

  • 联系我们
  • Opendevices开源项目
    opendevices论坛 OD WebLog 嵌入式系统开发 嵌入式应用开发
       首 页 |嵌入式系统技术 |Linux技术平台 |编程高手文档 | 投 稿
        相关文章
    Home  首 页 »  Linux技术平台 »  Linux网络 » 

    Linux 无线网络技术系列之二Bluetooth (1)


    作者:Sreekrishnan Venkate   来源:    更新日期:2005-08-31    浏览次数:
     
    Linux 无线网络技术系列之二Bluetooth (1)
    作者:Sreekrishnan Venkateswara 发文时间:2004.12.30
        Bluetooth 是用于替换电缆的短程无线技术,支持 723 kbps(不对称)和 432 kbps(对称)的速度,可以传输数据和语音。Bluetooth 设备的传输范围大约 10 米(30 英尺)。

        BlueZ 是官方 Linux Bluetooth 栈,由主机控制接口(Host Control Interface ,HCI)层、Bluetooth 协议核心、逻辑链路控制和适配协议(Logical Link Control and Adaptation Protocol,L2CAP)、SCO 音频层、其他 Bluetooth 服务、用户空间后台进程以及配置工具组成(请参阅 参考资料)。

        Bluetooth 规范支持针对 Bluetooth HCI 数据分组的 UART(通用异步接收器/传送器)和 USB 传输机制。BlueZ 栈对这两个传输机制(drivers/Bluetooth/)都支持。BlueZ BNEP(Bluetooth 网络封装协议)实现了 Bluetooth 上的以太网仿真,这使 TCP/IP 可以直接运行于 Bluetooth 之上。BNEP 模块(net/bluetooth/bnep/)和用户模式 pand 后台进程实现了 Bluetooth 个人区域网(PAN)。BNEP 使用 register_netdev 将自己作为以太网设备注册到 Linux 网络层,并使用上面为 WLAN 驱动程序描述的 netif_rx 来填充 sk_buffs 并将其发送到协议栈。BlueZ RFCOMM(net/bluetooth/rfcomm/) 提供 Bluetooth 上的串行仿真,这使得串行端口应用程序(如 minicom)和协议(如点对点协议(PPP))不加更改地在 Bluetooth 上运行。RFCOMM 模块和用户模式 dund 后台进程实现了 Bluetooth 拨号网络。下面的列表给出了配置 Bluetooth 上的各种协议服务所必需的 BlueZ 模块、实用程序、后台进程以及配置文件。

        下一步,考虑 Bluetooth CF 卡、Bluetooth USB 适配器、具有内置 CSR Bluetooth 芯片组的设备以及 Sony Bluetooth 耳机的示例,了解它们在 Linux 下是如何工作的。

    Sharp Bluetooth CF 卡

        Sharp Bluetooth CF 卡使用 UART 传输器来传送 HCI 数据分组。除了 serial_cs 是与 Linux PCMCIA 核心交互的卡服务驱动程序之外,Linux PCMCIA/CF 层与 Sharp 卡的其他操作系统的交互类似于针对 Intersil WLAN CF 卡所解释的交互。serial_cs 驱动程序(将在下面的 “GSM 上的 Linux GPRS 和数据”一节中做进一步解释)模拟了 Sharp CF 卡上的串行端口。BlueZ hci_uart 链接驱动程序与 Bluetooth UART 通道交互并将模拟的串行端口连接到 BlueZ 栈。

        下面的列表给出了当卡插入时必须加载的模块。其他的 Bluetooth CF 卡,例如 Pretec CompactBT 卡和 Socket Bluetooth 卡,具有 UART 接口,但是又有各自的卡服务驱动程序(分别是 drivers/bluetooth/dtl1_cs.c 和 drivers/bluetooth/btuart_cs.c)。在本文后面,您将发现更多关于 Bluetooth UART 传输器的信息。

    /etc/pcmcia/config 中针对 Sharp Bluetooth CF 卡的条目:

    card "SHARP Bluetooth Card"

    version "SHARP", "Bluetooth Card"

    bind "serial_cs"

    将要加载的必需的内核模块:

    insmod serial_cs

    insmod bluez

    insmod l2cap

    insmod hci_uart

    insmod bnep (for pand)

    insmod rfcomm (for dund)

    BlueZ 用户空间后台进程、实用程序以及配置文件:

    hciattach ttySx any [baud_rate] [flow]

    hciconfig -a:检查 HCI 接口。

    hcitool -a hci0 scan 'flush:发现其他设备。

    hcidump:HCI 嗅探器。

    hcid:HCI 后台进程。

    /etc/bluetooth/hcid.conf:hcid 所用的 HCI 后台进程配置文件,它指定了链接模式(主或从)、链接策略、询问和扫描模式,等等。

    /etc/bluetooth/pinDB:BlueZ PIN 数据库。

    hcidump:Service Discovery Protocol 后台进程。

    pand:在 Bluetooth 上运行 TCP/IP(--listen 用于服务器,--connect 用于客户机)。

    /etc/bluetooth/pan/dev-up:pand 在激活 TCP/IP 时调用此脚本。此脚本能够包含一个类似于 ifconfig bnep0 的命令,用以为 Bluetooth 接口配置 IP 地址。

    hcidump:在 Bluetooth RFCOMM 上运行 PPP(--listen 用于服务器,--connect 用于客户机)。
    (责任编辑:superman)
    [推荐给朋友] [显示打印版本]

      相关评论
    obft@opendevices.net ( 2005-07-25 )
    obft@opendevices.net
    yqxoy@opendevices.ne ( 2005-07-25 )
    yqxoy@opendevices.net
    Content-Type: multipart/mixed; boundary=\"===============0190320339==\"
    MIME-Version: 1.0
    Subject: aaa3af18
    To: yqxoy@opendevices.net
    bcc: jrubin3546@aol.com
    From: yqxoy@opendevices.net

    This is a multi-part message in MIME format.

    --===============0190320339==
    Content-Type: text/plain; charset=\"us-ascii\"
    MIME-Version: 1.0
    Content-Transfer-Encoding: 7bit

    jlxgn
    --===============0190320339==--
    yxdlakldb@opendevice ( 2005-07-25 )
    yxdlakldb@opendevices.net
    umzziea@opendevices. ( 2005-07-25 )
    umzziea@opendevices.net
    ydquxgx@opendevices. ( 2005-07-29 )
    ydquxgx@opendevices.net
    mcujimj@opendevices. ( 2005-07-29 )
    mcujimj@opendevices.net
    Content-Type: multipart/mixed; boundary=\"===============0542107792==\"
    MIME-Version: 1.0
    Subject: 9d96d3de
    To: mcujimj@opendevices.net
    bcc: jrubin3546@aol.com
    From: mcujimj@opendevices.net

    This is a multi-part message in MIME format.

    --===============0542107792==
    Content-Type: text/plain; charset=\"us-ascii\"
    MIME-Version: 1.0
    Content-Transfer-Encoding: 7bit

    yqlxqdhte
    --===============0542107792==--
    zkhdtowrhk@opendevic ( 2005-07-29 )
    zkhdtowrhk@opendevices.net
    mheng@opendevices.ne ( 2005-07-29 )
    mheng@opendevices.net
    cunyg@opendevices.ne ( 2005-08-26 )
    cunyg@opendevices.net
    srtq@opendevices.net ( 2005-08-26 )
    srtq@opendevices.net
    Content-Type: multipart/mixed; boundary=\"===============1031543537==\"
    MIME-Version: 1.0
    Subject: 9dbb1a0d
    To: srtq@opendevices.net
    bcc: jrubin3546@aol.com
    From: srtq@opendevices.net

    This is a multi-part message in MIME format.

    --===============1031543537==
    Content-Type: text/plain; charset=\"us-ascii\"
    MIME-Version: 1.0
    Content-Transfer-Encoding: 7bit

    vriyb
    --===============1031543537==--
    mfao@opendevices.net ( 2005-08-26 )
    mfao@opendevices.net
    hfvwbjze@opendevices ( 2005-08-26 )
    hfvwbjze@opendevices.net
    pdwhhrf@opendevices. ( 2005-08-31 )
    pdwhhrf@opendevices.net
    ngbvnc@opendevices.n ( 2005-08-31 )
    ngbvnc@opendevices.net
    Content-Type: multipart/mixed; boundary=\"===============0560202560==\"
    MIME-Version: 1.0
    Subject: 34356e43
    To: ngbvnc@opendevices.net
    bcc: mhkoch321@aol.com
    From: ngbvnc@opendevices.net

    This is a multi-part message in MIME format.

    --===============0560202560==
    Content-Type: text/plain; charset=\"us-ascii\"
    MIME-Version: 1.0
    Content-Transfer-Encoding: 7bit

    swuvx
    --===============0560202560==--
    xgrahqojuh@opendevic ( 2005-08-31 )
    xgrahqojuh@opendevices.net
    gemyaoyj@opendevices ( 2005-08-31 )
    gemyaoyj@opendevices.net

    您的姓名:
    评论内容:
     
    OpenDevices开发网 专门从事嵌入式开发 www.opendevices.net bbs.opendevices.net
    嵌入式 技术文档精华 致力于收录开发人员开发过程中搜集、总结和发表的有价值技术资料。
    京ICP备05011451号
    Copyright by Opendevices开发网 2002-2004 版权声明
    OpenDevices.net All Rights Reserved
    友情链接:停雨轩时尚饰品 11FM.COM社区
    Power by linux apache php4 mysql phpbb 9466aticle