芯科蓝牙BG27开发笔记3-修改第一个程序

提问:

如何实现连续发送通知消息?

蓝牙无线射频信号在时间轴不是连续不断地存在,为了实现大数量的传输,需要额外的机制保证设备可以在下一次启动射频后可以接着发送之前没有发完的消息,nordic是可以使用队列,也可以使用“BLE_NUS_EVT_TX_RDY”:表示收到了对方的应答包可以继续发送(TX已经准备好)。

那么芯科协议栈有没有这个蓝牙事件?

sl_bt_evt_gatt_server_notification_tx_completed_id,经过测试,不行!

仔细查看文档:

/**
 * @addtogroup sl_bt_evt_gatt_server_notification_tx_completed sl_bt_evt_gatt_server_notification_tx_completed
 * @{
 * @brief Indicates that one or more GATT notifications have been transmitted.
 *
 * By default, this event is not enabled on Bluetooth connections due to
 * additional resource usages
 *
 * Following enablers are required to enable the Bluetooth stack's functionality
 * for supporting this event,
 *   - Include feature bluetooth_feature_resource_report in the application
 *     project.
 *   - Use command @ref sl_bt_resource_enable_connection_tx_report to enable
 *     data packet TX status reports before this Bluetooth connection is
 *     established.
 */

/** @brief Identifier of the notification_tx_completed event */
#define sl_bt_evt_gatt_server_notification_tx_completed_id           0x060a00a0

可知,必须使能此功能才行?根据以上提示,使能此功能。

但是bluetooth_feature_resource_report如何加入到工程中?

可知nordic那套工具中,协议栈有大量的可配置参数,由此推论,芯科必然也有!!(此思路并未走通,虽然有许多配置存在于代码,但是他们都提示这是由配置向导生成的)

偶然的,在电脑中全局搜索“bluetooth_feature_resource_report”!~可以看到:

芯科蓝牙BG27开发笔记3-修改第一个程序_第1张图片

提示了这是一个软件模组!

安装后相关代码会自动添加。

芯科蓝牙BG27开发笔记3-修改第一个程序_第2张图片

编译下载,可以看到,连续发送成功。

芯科蓝牙BG27开发笔记3-修改第一个程序_第3张图片

你可能感兴趣的:(Silicon,labs蓝牙开发,笔记)