android 蓝牙学习小记

这篇博客主要介绍了Android蓝牙学习的关键点,包括FTP与OPP协议的区别,BluetoothAdapter的getProfileProxy()方法,蓝牙工作频段,蓝牙设备间的socket通信机制,以及蓝牙协议的层次结构和LMP协议的作用。通过对蓝牙核心技术的探讨,帮助读者深入理解蓝牙通信的本质。
摘要由CSDN通过智能技术生成

Android 蓝牙学习小记

这里面记录了一些开始学蓝牙是学到的一些小知识点,很零碎, 有的是自己总结,有的是从别的文章中摘抄的。

FTP与OPP协议

两个协议都是传文件的,但是两个协议传的文件有所不同。

  1. OPP协议传输特定格式的文件,在协议里定义了可以该协议可以接受哪些格式的文件,如下所示, 这些类型的文件接受到了后将按照文件的格式进行对应的解析。
   /**
    * The MIME type(s) of we could accept from other device.
    * This is in essence a "white list" of acceptable types.
    * Today, restricted to images, audio, video and certain text types.
    */
   public static final String[] ACCEPTABLE_SHARE_INBOUND_TYPES = new String[] {
   
       "image/*",
       "video/*",
       "audio/*",
       "text/x-vcard",
       "text/plain",
       "text/html",
       "text/xml",
       "text/comma-separated-values",
       "text/calendar",
       "application/ogg",
       "application/zip",
       "application/vnd.ms-excel",
       "application/msword",
       "application/vnd.ms-powerpoint",
       "application/pdf",
       "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
       "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
       "application/vnd.openxmlformats-officedocument.presentationml.presentation",
       "application/x-hwp",
       "application/vnd.android.package-archive",
   };
  1. 其它类型的文件就由FTP协议进程传输,标准的文件传送,如果你用FTP协议传 "text/x-vcard"类型的文件,接受端只认为传送过来的是一个文件,并将这个文件保存。
    而不会将其解成一个名片。

传统蓝牙服务端中常见协议列表

A2DP:​ Advanced Audi​​o Distribution Profile
AVRCP: A/V Remote Control Profile
FTP: File Transfer Profile
HDP: Health Device Profile
HFP: Hands-Free Profile
HID : Human Interface Device Profile
HSP :Headset Profile
MAP: Message Access Profile
OPP​

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值