haozhijian 发表于 2014-8-12 22:02:14

CSR8670的BLE和传统蓝牙双模兼容问题

   目前遇到的问题是无法将CSR8670的BLE和传统蓝牙双模给兼容起来,不知是参数配置问题,
      还是代码流程问题,还请各位大侠帮忙分析解决下,谢谢。
操作流程:1、首先调整Project Properties如下四项: Battery Operation:      EnabledEnable GATT:            GATT Server EnabledEnable BLE                  BLE EnableExecution 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 Connectable 和Discoverable了,但为什么还是扫描不到 传统蓝牙设备呢? :GATT:start_ble_advertisingBLE : Start AD //在此后加入@@***stateManagerEnterConnectableStateHS: Power On--hello--SM : PowerOnSM: @@***stateManagerEnterConnectableStateSM: @@***stateManagerEnterConnectableState->sinkEnableConnectableMP Enable Connectable -iSM: @@***stateManagerEnterConnectableState->stateManagerSetState deviceConnectableSM:->HS: EnterPair ***SM :stateManagerEnterConnDiscoverableStateMP Enable Connectable -iMP Enable Discoverable +pMP Enable Discoverable scan:3SM : Pair SM:->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: @@***stateManagerEnterConnectableStateCL : AD Data registeredGATT_INIT_CFM GATT server_handle_gatt_init_cfmGATT will GattConnectRequestHS: Power On--hello--SM : PowerOnSM: @@***stateManagerEnterConnectableStateSM: @@***stateManagerEnterConnectableState->sinkEnableConnectableMP Enable Connectable -iSM: @@***stateManagerEnterConnectableState->stateManagerSetState deviceConnectableSM:->GATT_CONNECT_CFM GATT server_handle_gatt_connect_cfmGATT: Connection initialisingGATT:start_ble_advertisingBLE : Start ADHS: EnterPair ***SM :stateManagerEnterConnDiscoverableStateMP Enable Connectable -iMP Enable Discoverable +pMP Enable Discoverable scan:3SM : Pair SM:->

bluetooth_ble 发表于 2014-8-13 11:35:48

我也碰到你相同的问题,望高手出现。。。

dvtsh 发表于 2014-8-14 09:23:20

也比较关心这个问题

yiran 发表于 2014-8-14 11:34:39

好厉害的样子

lb4btspeaker 发表于 2014-8-29 11:51:55

关注,期待高手

smith 发表于 2014-8-29 15:25:23

顶!我也出现这个问题

smith 发表于 2014-8-29 15:36:25

顶!我也出现这个问题

mupro 发表于 2014-8-30 00:15:19

8670是可以同时打开EDR和BLE的,SPP应该也可以一起打开;但是应该只能同时连接其中2个

cnc202 发表于 2014-9-6 19:02:31

路过,留个脚印:)

tyro_2003 发表于 2014-9-17 14:51:12

:(:(:(:(:(
页: [1] 2 3
查看完整版本: CSR8670的BLE和传统蓝牙双模兼容问题