当前位置: 首页 > news >正文

织梦如何做网站/安卓手机优化软件排名

织梦如何做网站,安卓手机优化软件排名,聚名网页版,推广游戏网站怎么做http://blog.csdn.net/tommy_wxie/article/details/17716675 有了前几篇对bluetooth的初步了解,今天晓东就和大家正式开始bluetooth的代码阅读了。在开写这篇文章之前,晓东也很纠结,究竟该从哪里开始着手写相关的内容。最初的打算是准备从蓝牙…

http://blog.csdn.net/tommy_wxie/article/details/17716675

有了前几篇对bluetooth的初步了解,今天晓东就和大家正式开始bluetooth的代码阅读了。在开写这篇文章之前,晓东也很纠结,究竟该从哪里开始着手写相关的内容。最初的打算是准备从蓝牙的开关开始着手的,这是一条大家很好理解也很容易上手的路线。但后来好好想想,还是放弃了这样的想法,因为,我们的这次的系列文章准备稍微讲得深入一点,协议层是肯定要涉及的,而不是简单的浮在JNI之上去分析。所以,今天我们首先从kernel中的config选项着手,先来分析一下若想使用蓝牙,在kernel中需要选上哪些选项。

         我们在《Android4.0Bluetooth的代码结构》一文中提到,kernel中的代码包含两个部分,一个部分是stack的,一个部分是driver的。stack的位于kernel/net/bluetooth目录下,那么我们就去这个目录下的MakefileKconfig来看一下吧:

[html] view plaincopy
  1. menuconfig BT  
  2. tristate "Bluetooth subsystem support"  
  3. ……  
  4.       Say Y here to compile Bluetooth support into the kernel or say M to  
  5.       compile it as module (bluetooth).  

毫无疑问,这里我们要把bluetooth编译进kernel,这个是必不可少的了,选择Y,基本上我们是不会把stack相关的内容编译成module模式的。

[html] view plaincopy
  1. config BT_L2CAP  
  2.     bool "L2CAP protocol support"  
  3.     select CRC16  
  4.     select CRYPTO  
  5.     select CRYPTO_BLKCIPHER  
  6.     select CRYPTO_AES  
  7.     select CRYPTO_ECB  
  8.     help  
  9.       L2CAP (Logical Link Control and Adaptation Protocol) provides  
  10.       connection oriented and connection-less data transport.  L2CAP  
  11.       support is required for most Bluetooth applications.  

从注释上可以清楚地看到,L2CAP对大多数的蓝牙应用是不可缺少的。事实上也是如此,无论我们是听音乐,传文件,我们都需要在L2CAP链路上建立相应的profile,所以,这里没有什么异议地选上吧。

[html] view plaincopy
  1. config BT_SCO  
  2.     bool "SCO links support"  
  3.     help  
  4.       SCO link provides voice transport over Bluetooth.  SCO support is  
  5.       required for voice applications like Headset and Audio.  

SCO链路是用来打电话的,所以一般对手机而言,这里是要选上的,我们这里也同样选上。

source "net/bluetooth/rfcomm/Kconfig"

下面就到了rfcommKconfig选项,

[html] view plaincopy
  1. config BT_RFCOMM  
  2.     tristate "RFCOMM protocol support"  
  3.     depends on BT && BT_L2CAP  
  4.     help  
  5.       RFCOMM provides connection oriented stream transport.  RFCOMM  
  6.       support is required for Dialup Networking, OBEX and other Bluetooth  
  7.       applications.  

很明显可以看到他是OBEX层的支撑,OBEX是我们文件传输OPP的支撑,所以,要想能够传输文件,rfcomm是不可缺少的,选上吧。

[html] view plaincopy
  1. config BT_RFCOMM_TTY  
  2.     bool "RFCOMM TTY support"  
  3.     depends on BT_RFCOMM  
  4.     help  
  5.       This option enables TTY emulation support for RFCOMM channels.  

这个是rfcomm的模拟串口的功能,可以使能,若是实在不想使能应该也没有关系吧。不选应该问题也不大,不过晓东是选上的,多选也没有关系啦。

继续回到上一层的Kconfig文件,source "net/bluetooth/bnep/Kconfig",到了bnep的目录

[html] view plaincopy
  1. config BT_BNEP  
  2.     tristate "BNEP protocol support"  
  3.     depends on BT && BT_L2CAP  
  4.     select CRC32  
  5.     help  
  6.       BNEP (Bluetooth Network Encapsulation Protocol) is Ethernet  
  7.       emulation layer on top of Bluetooth.  BNEP is required for  
  8.       Bluetooth PAN (Personal Area Network).  

这里可以看到,这个选项是用来支持PAN的,就是通过蓝牙共享上网,有点类似wifisoft ap(共享热点),Android4.0之后是支持的,所以我们也选上吧。

[html] view plaincopy
  1. config BT_BNEP_MC_FILTER  
  2.     bool "Multicast filter support"  
  3.     depends on BT_BNEP  
  4.     help  
  5.       This option enables the multicast filter support for BNEP.  
  6.   
  7. config BT_BNEP_PROTO_FILTER  
  8.     bool "Protocol filter support"  
  9.     depends on BT_BNEP  
  10.     help  
  11.       This option enables the protocol filter support for BNEP.  

这两个是多路filterprotocol filter的支持,这里也选上吧。

继续看bluetooth下的Kconfig文件,source "net/bluetooth/cmtp/Kconfig",这次进入了cmtp目录,我们也去看一下

[html] view plaincopy
  1. config BT_CMTP  
  2.     tristate "CMTP protocol support"  
  3.     depends on BT && BT_L2CAP && ISDN_CAPI  
  4.     help  
  5.       CMTP (CAPI Message Transport Protocol) is a transport layer  
  6.       for CAPI messages.  CMTP is required for the Bluetooth Common  
  7.       ISDN Access Profile.  
  8.    

这个是用来支持CAPI的,我们好像用不到,可以不选。

继续看source "net/bluetooth/hidp/Kconfig"如下:

[html] view plaincopy
  1. config BT_HIDP  
  2.     tristate "HIDP protocol support"  
  3.     depends on BT && BT_L2CAP && INPUT && HID_SUPPORT  
  4.     select HID  
  5.     help  
  6.       HIDP (Human Interface Device Protocol) is a transport layer  
  7.       for HID reports.  HIDP is required for the Bluetooth Human  
  8.       Interface Device Profile.  

这个是用来支持HID设备的,比如蓝牙鼠标,蓝牙键盘,毫无疑问若是在平板上,这个是非常重要的,在手机平台的话选不选意义就不大了,晓东会把这里选上的。

最后就是source "drivers/bluetooth/Kconfig",一下子就到drvier下面的Kconfig了,去看看吧:

[html] view plaincopy
  1. config BT_HCIBTUSB  
  2.     tristate "HCI USB driver"  
  3.     depends on USB  
  4. ……  
  5. config BT_HCIBTSDIO  
  6.     tristate "HCI SDIO driver"  
  7.     depends on MMC  
  8. ……  
  9. config BT_HCIUART  
  10.     tristate "HCI UART driver"  
  11. ……  

3个就放到一起来看了,是用来表示接口的,有USB,SDIO,UART。晓东这里选择的是UART的接口,一般而言,在手机方案上,uart会多一点,在平板方案上,usb则会多一点。

选择了这个之后,就是各家方案的具体协议的driver了:

[html] view plaincopy
  1. config BT_HCIUART_BCSP  
  2.     bool "BCSP protocol support"  
  3.     depends on BT_HCIUART  

比较多,有H4BCSP什么的,这里就写成一个csrdrvier的选项为例,别的就不写了。一般而言,这里都是厂商自己开发加入的。

[html] view plaincopy
  1. config BT_SINGLE_LINK  
  2.         tristate "Bluetooth single link"  
  3.         help  
  4.           This enables the Bluetooth driver for single link.  

最后再提一下,single link的选项,好坑啊,晓东当时有一次不小心把这个选上了,发现只能连一个链路,就是比如配对了一个手机,就不能连耳机了。呵呵,所以,这个就不要选了吧。

至此,Kernel中的config选项就介绍完毕了。选上他们,编译内核吧。


http://www.jmfq.cn/news/5223655.html

相关文章:

  • html网页制作兼职平台/专业seo网络推广
  • 网站的建设和维护/一份完整的活动策划方案
  • 仿券妈妈券老大网站开发/东莞百度快速排名
  • int域名网站有哪些/谷歌官方网站注册
  • a站下载安装/免费建立个人网站申请
  • wordpress网站 frp穿透/seo网上培训
  • 网站咨询聊天怎么做/产品推广方案模板
  • 北京做网站定制价格/媒体资源网官网
  • 济南中建设计院 官方网站/网站推广的优化
  • 龙岩市新罗区疫情/徐州网页关键词优化
  • 做微信的网站有哪些/google seo教程
  • 做java面试题的网站/sem分析是什么
  • 文化广电旅游局网站建设方案/360建网站
  • 呼叫中心网站建设/免费软文网站
  • 成全视频免费观看在线看 综合 笔记 视频/四川旅游seo整站优化
  • 网站建设疑问/建站教程
  • 女生做网站编辑/广州网站设计
  • 视频网站做视频节目赚钱吗/快速网站轻松排名
  • 网站内容如何编辑软件/网站自动收录
  • 网站 配色方案/找网站设计公司
  • cpa建站教程/推广哪个网站好
  • 长春网站建设/手机访问另一部手机访问文件
  • 商城网站制作公司/网络seo关键词优化技术
  • discuz可以做门户网站么/郑州网络推广哪个好
  • 网页制作与网站设计/优化大师win10
  • 搭建什么样的平台/百度一键优化
  • 武汉做网站hlbzx/seo教程
  • 网站布局策划/外链seo
  • 专业的网页设计和网站制作公司/免费浏览网站推广
  • 手机网站模板 优帮云/留手机号广告