当前位置:网站首页>CH582 BLE 5.0 使用 LE Coded 广播和连接
CH582 BLE 5.0 使用 LE Coded 广播和连接
2022-07-25 17:54:00 【可可芯意】
一、获取资料
- 获取SDKhttps://www.wch.cn/search?t=all&q=CH582
- 修改参考https://www.cnblogs.com/debugdabiaoge/p/16205973.html
二、步骤
使用例子:
EVT\EXAM\BLE\Peripheral在
Peripheral\APP\peripheral.c的Peripheral_Init函数中加入uint8 initial_adv_event_type = GAP_ADTYPE_EXT_CONN_UNDIRECT; GAPRole_SetParameter(GAPROLE_ADV_EVENT_TYPE, sizeof(uint8), &initial_adv_event_type); GAP_SetParamValue(TGAP_ADV_SECONDARY_PHY, GAP_PHY_VAL_LE_CODED); GAP_SetParamValue(TGAP_ADV_PRIMARY_PHY, GAP_PHY_VAL_LE_CODED); GAP_SetParamValue(TGAP_ADV_SECONDARY_MAX_SKIP, 0); GAP_SetParamValue(TGAP_ADV_ADVERTISING_SID, 8);这里使用的是125K的速率
这里的修改,可以参考例子:EVT\EXAM\BLE\SYNC_ADV若需要 连接后,从机进行PHY的协商,可以在
peripheralStateNotificationCB的case GAPROLE_CONNECTED中加入协商任务case GAPROLE_CONNECTED: if(pEvent->gap.opcode == GAP_LINK_ESTABLISHED_EVENT) { Peripheral_LinkEstablished(pEvent); PRINT("Connected..\n"); tmos_start_task(Peripheral_TaskID, SBP_PHY_UPDATE_EVT, SBP_READ_RSSI_EVT_PERIOD); //启动协商PHY 这里的SBP_READ_RSSI_EVT_PERIOD 只是随意定的,拿来用用 } break;若需要加大功率,可以修改
config.h的#define BLE_TX_POWER LL_TX_POWEER_6_DBM
三、结果
可以看到PrimaryPHY和SecondaryPHY都是 LE Coded
注意这里看不到名字,是需要修改广播包的,这里可以参考EVT\EXAM\BLE\SYNC_ADV进行广播包的修改,我暂时没做下一步的研究了
边栏推荐
- 【硬件工程师】DC-DC隔离式开关电源模块为什么会用到变压器?
- 带你初步了解多方安全计算(MPC)
- ROS learning notes (IV) ROS cannot solve rosdep init or update
- Redis source code and design analysis -- 15. RDB persistence mechanism
- UFT(QTP)-总结点与自动化测试框架
- I2C communication - sequence diagram
- 有没有什么不起眼却挣钱的副业?
- Principle and implementation of UDP penetration NAT in P2P
- Stm32 paj7620u2 gesture recognition module (IIC communication) program source code explanation
- C LINQ de Duplication & de duplication sum
猜你喜欢
随机推荐
面试官:说说 log.Fatal 和 panic 的区别
Calculation date or date formatting
虚拟偶像代言产品出问题谁负责?
Brief introduction of bubble sort and quick sort
Redis source code and design analysis -- 16. AOF persistence mechanism
I'm also drunk. Eureka delayed registration and this pit!
WPF implements user avatar selector
H5 test point (mind map)
mysql case when
喜讯!瑞云科技被授予“海上扬帆”5G融合应用专委会成员单位
【VSCODE】支持argparser/接受命令行参数
Tkinter module advanced operations (I) -- transparent buttons, transparent text boxes, custom buttons and custom text boxes
mysql case when
Brief introduction to clustered index, secondary index, index push down
Redis源码与设计剖析 -- 18.Redis网络连接库分析
Sorting also needs to know the information and linked list
精彩记录
Idea 必备插件
Auditing相关注解
go channel简单笔记









