zoukankan      html  css  js  c++  java
  • 低功耗蓝牙BLE [学习笔记]

    手机设备会区分 "connecting" and "pairing" ,前者可以自动连接,后者则需要请求。
    BLE不再有pairing的麻烦,能直接连上目标设备,并开启服务自动发送数据功能。

    开发蓝牙程序,主要是两块:连接和数据解析。

    1. Connect 连接。

    1.1) How to know service UUID?
    https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx
    1.2) How to know Characteristics UUID?
    https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx
    1.3) How to know Descriptors UUID?
    https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx
    如果不在上述列表,那么Service是custom service,只能通过相关文档或者遍历尝试了。

    2. Data parsing 数据解析。

    GATT Specifications
    https://developer.bluetooth.org/gatt/Pages/default.aspx
    其中,Units/Format Types/GATT Namespace Descriptors 三个是基本命名规则等,可以不看。

    想知道某个角色模型:(Sample: https://developer.bluetooth.org/TechnologyOverview/Pages/HRP.aspx)
    Web site -> GATT Specifications -> Bluetooth specifications -> "Overview Page" column
    角色模型,Service组成都在这里了。

    具体查阅某个Characteristics的数据格式,还是跟查UUID一样:
    https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx

    ===================================
    参考:

    一个很好的例子,手机与BLE串口设备通信,用串口小助手辅助调试:
    (http://blog.csdn.net/hellogv/article/details/24267685)

    Callback及基本介绍:http://www.xlgps.com/article/114904.html
    一个很好的给官方的翻译页面,http://blog.csdn.net/qinxiandiqi/article/details/40741269
    给出很好的介绍及新旧两种连接方式: http://blog.davidvassallo.me/2015/09/02/ble-health-devices-first-steps-with-android/
    各种Callback 函数的总结: http://www.cnblogs.com/liqw/p/4031437.html
    一些很好的翻译及介绍: http://www.race604.com/gatt-connect/
    http://www.race604.com/gatt-profile-intro/
    https://learn.adafruit.com/introduction-to-bluetooth-low-energy?view=all
    ====================================
    关于开发板的开发,C语言开发的:
    http://china.cypress.com/blog/100-projects-100-days
    http://china.cypress.com/blog/100-projects-100-days/project-045-pulse-oximetry-heart-rate-monitor

    BLE 设备有6 tytes 的唯一地址标识。
    ====================================

  • 相关阅读:
    bzoj千题计划202:bzoj3191: [JLOI2013]卡牌游戏
    bzoj千题计划201:bzoj1820: [JSOI2010]Express Service 快递服务
    bzoj千题计划200:bzoj3106: [cqoi2013]棋盘游戏
    bzoj千题计划199:bzoj1055: [HAOI2008]玩具取名
    NOIP2017 小凯的疑惑
    Codeforces 837E. Vasya's Function
    bzoj1084: [SCOI2005]最大子矩阵
    bzoj4247: 挂饰
    Codeforces Round #276 (Div. 1) A. Bits
    bzoj千题计划196:bzoj4826: [Hnoi2017]影魔
  • 原文地址:https://www.cnblogs.com/lionfight/p/5141965.html
Copyright © 2011-2022 走看看