微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI蓝牙设计交流 > CC2640 sppledemo 连接Android设备连接时间间隔

CC2640 sppledemo 连接Android设备连接时间间隔

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

想要修改连接时间间隔,代码协议栈和例子用的是:

C:\TI\Connectivity\CC256X BT\CC256x STM32 Bluetopia SDK\v4.2.1.0\NoOS\STM3240G-EVAL\Samples\SPPLEDemo

修改时间间隔的地方只在sppledemo.c的建立连接ConnectLEDevice()函数中找到参数初始化设置

static int ConnectLEDevice(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, GAP_LE_Address_Type_t RemoteAddressType ,GAP_LE_Address_Type_t OwnAddressType, Boole

ConnectionParameters.Connection_Interval_Min = 20; //modify by yhc 2017.06.01
ConnectionParameters.Connection_Interval_Max = 200;
ConnectionParameters.Minimum_Connection_Length = 0;
ConnectionParameters.Maximum_Connection_Length = 10000;
ConnectionParameters.Slave_Latency = 0;
ConnectionParameters.Supervision_Timeout = 20000;

我想问的是CC2540中有 GAPRole_SendUpdateParam()函数发送参数请求的函数,CC2564有没有类似的函数,谢谢!

有,参考GenericAccessProfileServiceAPI.PDF,路径:C:\ti\Connectivity\CC256X BT\CC256x STM32 Bluetopia SDK\v4.0.2.2\NoOS\Documentation\API Documentation

非常感谢你的回复,

1,我在SPPLEdemo端申请了参数更新,

SPPLEdemo端回掉函数:

etLE_Connection_Parameter_Updated with size 14.

Status: 0x00.

BD_ADDR: 0x64638E6D3465.

Connection Interval: 8.

Slave Latency: 0.

Supervision Timeout: 100.

Android端收到了申请如下:

 D/BluetoothGattServer: onConnParamsChanged() - Device=88:C2:55:D1:D6:B6 interval=6 status=0

从打印信息上看已经修改了连接间隔。

2,SPPLE端定时器12ms发送数据,但是在Android端收到的数据,两次间隔为200ms,我不知道这么大的延时处在哪?

测试用的是三星S7

06-06 14:05:17.752 15744-15760/com.pico.advertis E/GattServer: data = 303132333435363738393031323334353637
06-06 14:05:17.952 15744-15760/com.pico.advertis E/GattServer: data = 383930313233343536373839303132333435
06-06 14:05:18.152 15744-15760/com.pico.advertis E/GattServer: data = 363738393031323334353637383930313233
06-06 14:05:18.362 15744-15762/com.pico.advertis E/GattServer: data = 343536373839303132333435363738393031
06-06 14:05:18.552 15744-15760/com.pico.advertis E/GattServer: data = 323334353637383930313233343536373839

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

网站地图

Top