试了两种方法
GAPRole_GetParameter(GAPROLE_CONNHANDLE, &connectionHandle);
GATT_ExchangeMTU(connectionHandle,64,selfEntity)
返回值2
无效参数??
GAPRole_GetParameter(GAPROLE_CONNHANDLE, &connectionHandle);
HCI_LE_SetDataLenCmd(connectionHandle, 64, txTime)
返回值0
不起作用
Alvin Chen:
#define INVALIDPARAMETER0x02 //!< Invalid Parameter\
说明你的参数配置不对,
GATT_ExchangeMTU(connectionHandle,64,selfEntity) 你参数都没填写对。bStatus_t GATT_ExchangeMTU ( uint16connHandle,
attExchangeMTUReq_t *pReq,
uint8taskId
)hciStatus_t HCI_LE_SetDataLenCmd ( uint16connHandle,
uint16txOctets,
uint16txTime
)举例:attExchangeMTUReq_t req;
req.clientRxMTU = xx
// ATT MTU size should be set to the minimum of the Client Rx MTU// and Server Rx MTU valuesVOID GATT_ExchangeMTU(scConnHandle, &req, selfEntity);
}
user4822357:
回复 Alvin Chen:
我的SDK是1.45的,#define GATT_ExchangeMTU(connHandle, pReq, taskID)(icall_directAPI(ICALL_SERVICE_CLASS_BLE, (uint32_t) IDX_GATT_ExchangeMTU, connHandle, pReq, ICall_getLocalMsgEntityId(ICALL_SERVICE_CLASS_BLE_MSG, taskID)))
user4822357:
回复 Alvin Chen:
我也改了,试VOID GATT_ExchangeMTU(scConnHandle, &req, selfEntity);返回值还是2
Alvin Chen:
回复 user4822357:
看一下ble_user_config中是否修改了,参考下面博客
http://leconiot.com/download/cc2640r2f/ble_stack_app/app_examples/exchange_mtu/exchange_mtu.html