想用CC2541做peripheral and observer,同时实现从机和观察者的功能,应该怎么做
void GAPRole_Init( uint8 task_id ) 函数中应该如何设定 gapRole_profileRole,宏定义只定义了以下四种啊:
#define GAP_PROFILE_BROADCASTER 0x01
#define GAP_PROFILE_OBSERVER 0x02
#define GAP_PROFILE_PERIPHERAL 0x04
#define GAP_PROFILE_CENTRAL 0x08
看到函数GAP_DeviceInit( )后懂了,应该是两个宏定义或一下就可以了
bStatus_t GAP_DeviceInit( )
{
case (GAP_PROFILE_PERIPHERAL | GAP_PROFILE_OBSERVER):
}
buildConfig.cfg文件中的宏定义也需要修改下,将第三行注释掉,第5行开启
//-DHOST_CONFIG=BROADCASTER_CFG
//-DHOST_CONFIG=OBSERVER_CFG
-DHOST_CONFIG=PERIPHERAL_CFG
//-DHOST_CONFIG=CENTRAL_CFG
//-DHOST_CONFIG=BROADCASTER_CFG+OBSERVER_CFG
//-DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG
//-DHOST_CONFIG=CENTRAL_CFG+BROADCASTER_CFG
//-DHOST_CONFIG=PERIPHERAL_CFG+CENTRAL_CFG
我们有发布SimpleBLE ComboRoles的例程,请看这边:http://processors.wiki.ti.com/index.php/SimpleBLE_ComboRoles#Central_.2B_Broadcaster
工程应该用哪个IAR版本打开,我试了IAR for 8051 8.10不行