Part Number:CC2642ROther Parts Discussed in Thread:LAUNCHXL-CC26X2R1, SYSCONFIG
使用的simplelink_cc13x2_26x2_sdk_3_10_00_53开发应用发现扫描到的response数据很少,使用官网最新版SDK验证-simplelink_cc13xx_cc26xx_sdk_6_10_00_29还是存在该问题,解决该问题是否需要修改某些配置参数
Kevin Qiu1:
你是用哪个例程扫描的,simple_central还是multirole?
,
123 asd:
是基于multirole开发的应用程序,我也试了使用simple_central例程扫描测试,都是同样的情况
,
Kevin Qiu1:
我用launchpad测试没有发现问题,可以搜到多个从机设备
你可以搜到多少个设备,附近一共有多少BLE从机,使用的开发板是什么?
,
123 asd:
附近的从机大概100-150个,使用的开发板是LAUNCHXL-CC26X2R1。从机基本上都能被扫描到,但是获取的从机SCAN_RSP数据特别少
,
Kevin Qiu1:
Scan Response可以在sysconfig中自己配置:
,
123 asd:
我配置从机Simple_Peripheral发送Response data,但是使用simple_central或者multirole都只能偶尔扫到从机的Response data,这是正常现象吗?
,
Kevin Qiu1:
simple_central默认没有打印所有扫描到的信息,你可以抓包查看扫描到的具体信息
,
123 asd:
我自己添加了一些打印,根据evtType的Bit3判断Response并计数,计数结果数量很少
/// Event for advertising report typedef struct {/*** Bits 0 to 4 indicate connectable, scannable, directed, scan response, and* legacy respectively*/uint8_tevtType;/// Public, random, public ID, random ID, or anonymousGAP_Addr_Types_t addrType;/// Address of the advertising deviceuint8_taddr[B_ADDR_LEN];/// PHY of the primary advertising channelGapScan_ScannedPhy_t primPhy;/// PHY of the secondary advertising channelGapScan_ScannedPhy_t secPhy;/// SID (0x00-0x0f) of the advertising PDU. 0xFF means no ADI field in the PDUuint8_tadvSid;/// -127 dBm <= TX power <= 126 dBmint8_ttxPower;/// -127 dBm <= RSSI <= 20 dBmint8_trssi;/// Type of TargetA address in the directed advertising PDUGAP_Addr_Types_t directAddrType;/// TargetA addressuint8_tdirectAddr[B_ADDR_LEN];/// Periodic advertising interval. 0 means no periodic advertising.uint16_t periodicAdvInt;/// Length of the datauint16_t dataLen;/// Pointer to advertising or scan response datauint8_t*pData; } GapScan_Evt_AdvRpt_t;
,
Kevin Qiu1:
你说的扫描数据少具体指的是什么,是设备数量少还是Response data数据本身少
如果是后者可以在sysconfig配置更多的数据,如果是前者默认定义最多为8个设备#define DEFAULT_MAX_SCAN_RES 8
抓包文件有所需的详细信息,将抓包文件传上来以进一步分析
,
123 asd:
就是扫描到周围环境的设备,但是只能获取到该设备的advertisement data,想要获取该设备的response data却很难获取,只有极小的概率能获取到或者完全获取不到response data,DEFAULT_MAX_SCAN_RES 这个宏我改为0或者更大的值都是没作用
,
Kevin Qiu1:
用sniffer抓包查看以确定是否有scanRspData
,
123 asd:
PacketBle.psd这个是我抓包的数据,是有scanRspData的,但是我应用程序中很难获取Response data
,
Kevin Qiu1:
抓包文件显示有scanRspData,应该是获取的方法不对
可以在SimpleCentral_processAppMsg() :: SC_EVT_ADV_REPORT中打印scanRspData信息
我用两个设备在SC_EVT_ADV_REPORT中打印可以看到peripheral 对应的ScanResponseAddr信息
,
123 asd:
你好,我验证了一下,在这个事件中获取的数据基本上都是AdvData,偶尔才会获取到一包ResponseData,从抓包数据来看好像发送SCAN_REQ都挺少的
,
Kevin Qiu1:
当接收到广播时,扫描设备向广播设备发送扫描请求,广播设备以扫描响应进行响应,没有SCAN_REQ也不会有scanRspData
有些数据类型只允许在广播和扫描响应数据中使用一次,详细说明查看:Bluetooth Core Specification Supplement (CSSv7)
另外如果广播不可扫描,也加载不到扫描响应数据
TI中文支持网


![CCSTUDIO: CCS20.2 导入工程时编译出现乱码!]ϵͳ�Ҳ���ָ�����ļ���-TI中文支持网](https://www.ti2k.com/wp-content/uploads/ti2k/DeyiSupport_DSP_pastedimage1753170415800v1.jpg)


