当前位置:网站首页>【开发教程10】疯壳·开源蓝牙心率防水运动手环-蓝牙 BLE 收发
【开发教程10】疯壳·开源蓝牙心率防水运动手环-蓝牙 BLE 收发
2022-07-28 22:34:00 【efans_Mike】
开源蓝牙心率防水运动手环
——疯壳·智能穿戴开发系列
蓝牙 BLE 收发
1相关简介
DA14580 内部集成了射频模块,同时官方也提供了一套 SDK,里面包含了蓝牙协议栈部分。本节蓝牙收发就是通过修改官方提供的 SDK,完成蓝牙收发功能。关于蓝牙的基本知识,大家可以参考前面的蓝牙基础。
2硬件设计
DA14580 内部集成了射频模块,这里只需要从 PF10p 脚接一根天线。
图 1
3软件设计
打开 SDK,从路径:
SDK5.0.4\DA1458x_SDK\5.0.4\project\target_apps\ble_examples\ble_app_profi le\Keil_5 中打开 ble_app_profile 工程文件。
首先修改 user_cust1_def.h 文件,该文件对服务的参数进行了声明,我们这里需要修改服务和特征值的 UUID 等参数,并将多余的特征值删除。
图 2
再修改 user_cust1_def.c 文件,该文件对文件和特征值的属性进行了定义,这里需要对要使用的服务和特征值进行修改,并删除多余的特征值定义。
图 3
代码1
最后要修改的是cust1_task.c 文件,该文件定义了 cust1 服务的一些任务函数, 需要将原来定义为 128 位的修改为 16 位。另外,由于前面删除了多余的特征值服务,这里还需要修改接受函数。
图 4
相关代码可以查看我们的实验例程。
4实验现象
首先打开 SmartSnippets。
图 5
设置好 SmartSnippets 之后,点击上图中的 Open。
图 6
(1)点击 Connect,连接我们的单片机。
(2)点击 Erase,擦除 Flash。
(3)点击 Browse,找到我们工程的.hex 文件。
(4)点击 Burn,完成代码下载。
代码下载完成之后,运行代码,然后打开手机上的 Wolverine BLE。
(1)点击 Connect。
图 7
(2)选择我们的蓝牙设备 DIALOG-PRFL。
图 8
(3)在输入框输入 BLE,然后点击 Send。
图 9
完成以上 3 步,手机能收到我们所发送的字符。
图 10
更多完整学习资料和对应开源套件,请登陆官网:“疯壳”
如需定制开发,请通过官网“疯壳”网页底部的“联系我们”进行联系
边栏推荐
猜你喜欢

Basic knowledge of PHP language (super detailed)

PHP语言基础知识(超详细)

MySQL的存储过程

Plato farm is expected to further expand its ecosystem through elephant swap

Concurrency in go

Control fillet stroke materialshapedrawable

12个MySQL慢查询的原因分析

IDEA报错Error running ‘Application‘ Command line is too long解决方案
![[applet project development -- JD mall] uni app commodity classification page (first)](/img/6c/5b92fc1f18d58e0fdf6f1896188fcd.png)
[applet project development -- JD mall] uni app commodity classification page (first)

“Method Not Allowed“,405问题分析及解决
随机推荐
Recursion / backtracking (Part 2)
Attack and defense world web master advanced area web_ php_ unserialize
#{}和${}的区别
MySQL transaction (this is enough...)
Exchange 2013 SSL certificate installation document
17.机器学习系统的设计
Real time data warehouse: meituan's implementation of real-time data warehouse construction based on Flink
Network traffic monitoring tool iftop
动态规划问题(六)
IDEA报错Error running ‘Application‘ Command line is too long解决方案
Virtual lab basic experiment tutorial -8. Fourier transform (1)
Laravel permission control
还在写大量 if 来判断?一个规则执行器干掉项目中所有的 if 判断...
Erc20 Standard Code
Sword finger offer 55 - I. depth of binary tree
Dynamic programming problem (4)
【esn】 学习回声状态网络
CV target detection model sketch (2)
Sword finger offer 64. find 1+2+... +n, logical operator short circuit effect
Event extraction and documentation (2018)