微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI蓝牙设计交流 > sensortag 怎样同时扮演peripheral加Broadcaster

sensortag 怎样同时扮演peripheral加Broadcaster

时间:10-02 整理:3721RD 点击:

请教一下各位大神,

看到用SimpleBLEPeripheral的project改成peripheral+Broadcaster模式,如下,

1.ble-stack 1.4.0,simplperipherl 例子

2.编译器里允许PLUS_BROADCASTER,去掉那个×

3.exclude "peripheral.c和.h",include"peripheralBroadcaster.c和.h"

4.peripheralBroadcaster.c的include“hci.h”改为#include "hci_tl.h"

用sensortag的project照搬结果出现错误,如下,

尤其是第二个错误,ST_ADV_IN_CONNECTION_EVT这个event不管在"peripheral.c"还是"peripheralBroadcaster.c“”都没有定义过,只是因为编译器加入了PLUS_BROADCASTER,在SensorTag.c中就编译了以下这段代码

#if defined ( PLUS_BROADCASTER )
if ( events & ST_ADV_IN_CONNECTION_EVT )
{
uint8 turnOnAdv = TRUE;
// Turn on advertising while in a connection
GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &turnOnAdv );

return (events ^ ST_ADV_IN_CONNECTION_EVT);
}
#endif // PLUS_BROADCASTER

是否还要加入其他源文件或者库文件,怎么能够把sensortag修改成peripheral+Broadcaster模式呢?

非常感谢!

您可以参考下TI提供的相关例程 http://processors.wiki.ti.com/index.php/LPRF_BLE_PeripheralBroadcaster

The example shows how SimpleBlePeripheral can be connected while also simultaneously broadcasting advertisements. The left keyFob button will increment data in the advertisement. 

嗨,朋友,我也遇到了同样的问题,请教一下,你后面是怎么处理的这个问题?

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top