首页 > 其他分享 >记录一些蓝牙 BLE 心率服务信息

记录一些蓝牙 BLE 心率服务信息

时间:2024-12-30 13:52:02浏览次数:1  
标签:heart RR 蓝牙 心率 rate values https BLE Bit

首先是官方文档,但是感觉说的不是特别清晰:

https://www.bluetooth.com/specifications/specs/heart-rate-profile-1-0/

https://www.bluetooth.com/specifications/specs/heart-rate-service-1-0/

然后是一个网友的总结:

Determine the format

The Bluetooth site has been reorganized recently (~2020), and in particular they got rid of some of the document viewers, which makes things much harder to find and read IMO. All the documentation is in the Heart Rate Service (HRS) document, linked from the main GATT page, but for just parsing the format, the best source I know of is the XML for org.bluetooth.characteristic.heart_rate_measurement. (Since the reorganization, I don't know how you can find this page without searching for it. It doesn't seem to be linked anymore.)

Byte 0 - Flags: 22 (0001 0110)

Bits are numbered from LSB (0) to MSB (7).

  • Bit 0 - Heart Rate Value Format: 0 => UINT8 beats per minute
  • Bit 1-2 - Sensor Contact Status: 11 => Supported and detected
  • Bit 3 - Energy Expended Status: 0 => Not present
  • Bit 4 - RR-Interval: 1 => One or more values are present

The meaning of RR-intervals is explained in the HRS document, linked above. It sounds like you just want the heart rate value, so I won't go into them here.

Byte 1 - UINT8 BPM: 56

Since Bit 0 of flags was 0, this is the beats per minute. 56.

Bytes 2-5 - UINT16 RR Intervals: 55, 4, 7, 3

You probably don't care about these, but there are two UINT16 values here (there can be an arbitrary number of RR-Interval values). BLE is always little-endian, so [55, 4] is 1,079 (55 + 4<<8), and [7, 3] is 775 (7 + 3<<8).

I believe the docs are a little confusing on this one. The XML suggests that these values are in seconds, but the comments say "Resolution of 1/1024 second." The normal way to express this would be <BinaryExponent>-10</BinaryExponent>, and I'm certain that's what they meant. So these would be:

  • RR0: 1.05s (1079/1024)
  • RR1: 0.76s (775/1024)

来自:https://stackoverflow.com/a/65458794

补充信息:https://blog.csdn.net/weixin_44336913/article/details/138419344

标签:heart,RR,蓝牙,心率,rate,values,https,BLE,Bit
From: https://www.cnblogs.com/xwgli/p/18640870

相关文章

  • WPF EventTrigger RoutedEvent Button.MouseEnter BeginStoryboard Storyboard Double
    //xaml<Windowx:Class="WpfApp117.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.mi......
  • WPF EventTrigger BeginStoryboard TargetName TargetProperty DoubleAnimation From
    <Windowx:Class="WpfApp116.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft......
  • DVWA靶场Brute Force (暴力破解) 漏洞low(低),medium(中等),high(高),impossible(不可能
    目录暴力破解low方法1方法2mediumhighimpossible暴力破解暴力破解是一种尝试通过穷尽所有可能的选项来获取密码、密钥或其他安全凭证的攻击方法。它是一种简单但通常无效率的破解技术,适用于密码强度较弱的环境或当攻击者没有其他信息可供利用时。暴力破解的基本原......
  • DVWA靶场File Inclusion (文件包含) 漏洞low(低),medium(中等),high(高),impossible(不可
    目录文件包含1.low远程文件包含本地文件包含源码审计2.medium源码审计3.high源码审计4.impossible源码审计文件包含文件包含漏洞(FileInclusionVulnerability)是一种常见的网络安全漏洞,主要出现在应用程序中不安全地处理文件路径时。攻击者可以利用此漏洞执......
  • WPF DoubleAnimation RepeatBehavior,Duration,SpeedRation,AutoReverse
    //xaml<Windowx:Class="WpfApp114.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.mi......
  • MTK-YNR_Table校准
    目录一、目的二、YNRTable校准1、前期准备:2、校准步骤:三、校准数据一、目的 在ISP调试过程中可能会遇到相同ISO不同场景参数cover不住的问题,这是因为不同颜色的噪声等级是不一样的,YNRTable校准可以对噪声等级进行准确的估算,避免不同颜色场景NR无法区分的现象以及......
  • 解密Prompt45. 再探LLM Scalable Oversight -辩论、博弈哪家强
    之前我们已经介绍过几个针对ScalableOversight的解法,也就是当模型能力在部分领域超越人类标注者后,我们该如何继续为模型提供监督信号,包括持续提升Verifier的能力,辅助人类提供监督信号:self-Critic持续提升模型在弱监督下的泛化性:weak-to-strongGeneralization以上两个方向相......
  • P1303 A*B Problem——高精度乘法
    题目背景高精度乘法模板题。题目描述给出两个非负整数,求它们的乘积。输入格式输入共两行,每行一个非负整数。输出格式输出一个非负整数表示乘积。样例#1样例输入#112样例输出#12提示每个非负整数不超过\(10^{2000}\)。我的作答#include<stdio.h>#include......
  • P1601 A+B Problem(高精)——高精度加法
    题目描述高精度加法,相当于a+bproblem,不用考虑负数。输入格式分两行输入。\(a,b\leq10^{500}\)。输出格式输出只有一行,代表\(a+b\)的值。样例#1样例输入#111样例输出#12样例#2样例输入#210019099样例输出#210100提示\(20\%\)的测试数据,\(0\le......
  • Linux shell 提取 html网页中table表格内容
    前言全局说明一、说明1.1环境:Windows11家庭版23H222631.3737Python3.8.10(tags/v3.8.10:3d8993a,May32021,11:48:03)[MSCv.192864bit(AMD64)]onwin32Windows7旗舰版VisualStudio2013Ubuntu18.04.6LTS(Linuxqt-vm5.4.0-150-generic#167~18......