用BLE协议栈里两个程序,simpleBLECentral,SimpleBLEPeripheral。Central进行扫描后再成功连接了一个设备。为什么过了一段时间后又自动断开了,大概是20秒,中间也无法发送数据,获取HAND值,求解答,谢谢。
调试能进入这段函数:case GAP_LINK_ESTABLISHED_EVENT:
{
if ( pEvent->gap.hdr.status == SUCCESS )
{
simpleBLEState = BLE_STATE_CONNECTED;
simpleBLEConnHandle = pEvent->linkCmpl.connectionHandle;
simpleBLEProcedureInProgress = TRUE;
// If service discovery not performed initiate service discovery
if ( simpleBLECharHdl == 0 )
{
osal_start_timerEx( simpleBLETaskId, START_DISCOVERY_EVT, DEFAULT_SVC_DISCOVERY_DELAY );
}
LCD_WRITE_STRING( "Connected", HAL_LCD_LINE_1 );
LCD_WRITE_STRING( bdAddr2Str( pEvent->linkCmpl.devAddr ), HAL_LCD_LINE_2 );
HalUARTWrite(0,"—Connected—",15);
HalUARTWrite(0,bdAddr2Str( pEvent->linkCmpl.devAddr ),14);
}
Pmdt2016:
你好,请问你的这个问题现在解决了吗?解决了的话,问题出在了什么地方?方便的话请告知我一下,谢谢!