Other Parts Discussed in Thread: SYSCONFIG
SDK版本:simplelink_cc13xx_cc26xx_sdk_7_10_00_98(最新版本)
硬件:自制最小系统板5287.原理图 蓝牙模块-CC2642_V1.3.pdf
现象:
使用TI的simple_central和simple_peripheral测试,主机扫描到从机,建立连接后,会调用GATT_ExchangeMTU更新MTU:
static void SimpleCentral_startSvcDiscovery(void)
{
bStatus_t status;
attExchangeMTUReq_t req;
// Initialize cached handles
svcStartHdl = svcEndHdl = 0;
discState = BLE_DISC_STATE_MTU;
// Discover GATT Server's Rx MTU size
req.clientRxMTU = scMaxPduSize - L2CAP_HDR_SIZE;
// ATT MTU size should be set to the minimum of the Client Rx MTU
// and Server Rx MTU values
//VOID GATT_ExchangeMTU(scConnHandle, &req, selfEntity);
status = GATT_ExchangeMTU(simpleBLEConnHandle, &req, selfEntity);
if(status == 0){
sprintf(printbuf,"Request was queued successfully.\r\n");
}else{
sprintf(printbuf,"Error:status=%d.\r\n",status);
}
PRINT_LOG;
}
SimpleCentral_processGATTMsg(gattMsgEvent_t *pMsg)函数中收到ATT_MTU_UPDATED_EVENT情况非常少见,大部分情况是收不到,在收不到ATT_MTU_UPDATED_EVENT的情况下,连接会自动断开。
GATT_ExchangeMTU()函数的返回状态是0,即成功,我尝试更新的 ATT MTU 大小的值是65,这是工程默认可改MTU的最大值。
simple_peripheral用手机连接改MTU每次都是正常的。此问题应该与simple_peripheral无关。