我爱蓝牙网 - 52Bluetooth - 最具人气蓝牙技术交流网站

标题: CSR8670的BLE和传统蓝牙双模兼容问题 [打印本页]

作者: haozhijian    时间: 2014-8-12 22:02
标题: CSR8670的BLE和传统蓝牙双模兼容问题
     目前遇到的问题是无法将CSR8670的BLE和传统蓝牙双模给兼容起来,不知是参数配置问题,
        还是代码流程问题,还请各位大侠帮忙分析解决下,谢谢。

操作流程:

1、  首先  调整Project Properties如下四项:

Battery Operation:        Enabled

Enable GATT:              GATT Server Enabled

Enable BLE                  BLE Enable

Execution mode            Assisted Native

        

2、 在上述基本工作完成后,编译ADK3.0自带的sink,F7->F5,启动后,android4.4的手机能够识别到BLE蓝牙设备,并能够通过gatt读取CSR8670调试版上的电源电压。但是,不能进行传统蓝牙的配对连接,android2.2手机也识别不到蓝牙,音频无法使用,相当于是BLE单模。

3、为解决5中的问题,我在CSR8670(做server端)开启广播start_ble_advertising()之后添加了如下标红代码,但F7->F5后,现象同上。

void server_handle_gatt_connect_cfm(GATT_CONNECT_CFM_T * cfm)

{

GATT_SERVER_DEBUG(("GATT server_handle_gatt_connect_cfm \n "));

switch(cfm->status)

{

case gatt_status_initialising:

{

GATT_SERVER_DEBUG(("GATT: Connection initialising\n"));

#if defined(BLE_ENABLED)

{

GATT_SERVER_DEBUG(("GATT:start_ble_advertising\n"));

/* Start Advertising so a remote device can find and connect */

start_ble_advertising();

MessageSend(&theSink.task , EventUsrPowerOn, 0);

stateManagerEnterConnectableState(TRUE);

MessageSendLater(&theSink.task , EventUsrEnterPairing, 0, 1000);

}

#endif

}

对应的log如下,从log上看已经enable ConnectableDiscoverable了,但为什么还是扫描不到 传统蓝牙设备呢?

GATT:start_ble_advertising

BLE : Start AD //在此后加入

@@***stateManagerEnterConnectableState

HS: Power On

--hello--

SM : PowerOn

SM: @@***stateManagerEnterConnectableState

SM: @@***stateManagerEnterConnectableState->sinkEnableConnectable

MP Enable Connectable -i

SM: @@***stateManagerEnterConnectableState->stateManagerSetState deviceConnectable

SM:[Connectable]->[Connectable][1]

HS: EnterPair [1]

***SM :stateManagerEnterConnDiscoverableState

MP Enable Connectable -i

MP Enable Discoverable +p

MP Enable Discoverable scan:3

SM : Pair [258]

SM:[Connectable]->[ConnDisc][2]

HS : EventSysCheckAudioAmpDrive turn off amp

4、在源代码基础上(去掉3中在start_ble_advertising()之后添加的代码),在main.c的CL_DM_BLE_SET_ADVERTISING_DATA_CFM下添加如下标红代码,F7->F5,启动后,android4.4和android2.2的手机均能扫描到传统蓝牙设备,音频正常,音乐可正常播放,电话可正常接听。但BLE设备却识别不到,android4.4手机上专门用于扫描BLE设备的apk应用无法找到BLE设备(在2和3情况下可以找到BLE设备),故也只体现了传统蓝牙的单模。

case CL_DM_BLE_SET_ADVERTISING_DATA_CFM:

{

MAIN_DEBUG(("CL_DM_BLE_SET_ADVERTISING_DATA_CFM\n"));

MessageSend(task , EventUsrPowerOn, 0); //如果没有,无声音输出。

stateManagerEnterConnectableState(TRUE);

MessageSendLater(task , EventUsrEnterPairing, 0, 1000);

#ifdef GATT_SERVER_ENABLED

{

handle_set_ble_ad_data_cfm( (CL_DM_BLE_SET_ADVERTISING_DATA_CFM_T*)message );

}

#endif

}

对应log如下,在log上看,GATT:start_ble_advertising,BLE : Start AD//gatt已经发送了广播了,但为什么android4.4手机找不到BLE设备呢?

CL_DM_BLE_SET_ADVERTISING_DATA_CFM//在此处加

SM: @@***stateManagerEnterConnectableState

CL : AD Data registered

GATT_INIT_CFM [0]

GATT server_handle_gatt_init_cfm

GATT will GattConnectRequest

HS: Power On

--hello--

SM : PowerOn

SM: @@***stateManagerEnterConnectableState

SM: @@***stateManagerEnterConnectableState->sinkEnableConnectable

MP Enable Connectable -i

SM: @@***stateManagerEnterConnectableState->stateManagerSetState deviceConnectable

SM:[Connectable]->[Connectable][1]

GATT_CONNECT_CFM [13]

GATT server_handle_gatt_connect_cfm

GATT: Connection initialising

GATT:start_ble_advertising

BLE : Start AD

HS: EnterPair [1]

***SM :stateManagerEnterConnDiscoverableState

MP Enable Connectable -i

MP Enable Discoverable +p

MP Enable Discoverable scan:3

SM : Pair [258]

SM:[Connectable]->[ConnDisc][2]



作者: bluetooth_ble    时间: 2014-8-13 11:35
我也碰到你相同的问题,望高手出现。。。
作者: dvtsh    时间: 2014-8-14 09:23
也比较关心这个问题
作者: yiran    时间: 2014-8-14 11:34
好厉害的样子
作者: lb4btspeaker    时间: 2014-8-29 11:51
关注,期待高手
作者: smith    时间: 2014-8-29 15:25
顶!我也出现这个问题
作者: smith    时间: 2014-8-29 15:36
顶!我也出现这个问题
作者: mupro    时间: 2014-8-30 00:15
8670是可以同时打开EDR和BLE的,SPP应该也可以一起打开;但是应该只能同时连接其中2个
作者: cnc202    时间: 2014-9-6 19:02
路过,留个脚印
作者: tyro_2003    时间: 2014-9-17 14:51

作者: mmxnuaa    时间: 2014-9-18 13:23
根据这个帖子:
http://stackoverflow.com/questio ... nnected-br-edr-a2dp
和这个帖子:
http://www.52bluetooth.com/thread-3784-1-1.html

应该可以解释没法同时能被连的原因。协议限制。
作者: haozhijian    时间: 2014-9-19 10:58
mmxnuaa 发表于 2014-9-18 13:23
根据这个帖子:
http://stackoverflow.com/questions/23056668/ios-bluetooth-dual-mode-connect-ble-gatt ...

有用,感谢。
作者: bluetooth_isen    时间: 2014-9-19 15:07
学习了
作者: 中国123    时间: 2014-9-25 14:29
路过,留个脚印
作者: jasoncs    时间: 2014-10-9 04:02
學習了~

作者: mupro    时间: 2014-10-9 10:36
mmxnuaa 发表于 2014-9-18 13:23
根据这个帖子:
http://stackoverflow.com/questions/23056668/ios-bluetooth-dual-mode-connect-ble-gatt ...

应该不是这样吧 我这能连接A2DPHFP+BLE呀
作者: 中国123    时间: 2014-10-13 10:32
请问mupro,是如何实现A2DPHFP+BLE的?
作者: ble007    时间: 2014-10-16 13:54
解决了吗?
作者: linngjun1022    时间: 2014-10-16 14:43
来学习学习
作者: RobotHCS    时间: 2015-4-8 17:59
大神好厉害!
作者: tzc986858997    时间: 2015-8-14 12:41
我也路过..我也要学习

作者: hanhuliang    时间: 2016-1-7 13:47
路过学习一下

作者: Hello    时间: 2016-1-14 09:46
可以同时开,使用过别人做的

作者: dengyq1234    时间: 2016-3-24 10:06
谢谢分享!!!!

作者: qushitu    时间: 2016-3-29 15:36
3.5的加BLE可以用,有需要的?

作者: Rhino007    时间: 2016-3-30 22:06
高人有指点怎么入门的么!!

作者: mchgx    时间: 2016-4-26 14:17
已解决。。。。


作者: 姜小山    时间: 2016-4-26 19:44
关注,期待高手





欢迎光临 我爱蓝牙网 - 52Bluetooth - 最具人气蓝牙技术交流网站 (https://www.52bluetooth.com/) Powered by Discuz! X3.5