This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GAPRole_TerminateConnection使用了这个会GAPROLE_ERROR错误

在从机端使用GAPRole_TerminateConnection函数主动与主机断开连接后,会造成GAPROLE_ERROR错误,请问这个是不是一个BUG呀,里面又是看不到源码的,问题都不好找啊!请问TI的大神这个是怎么回事啊?

主要是断开很多时候都不能断开,我跟踪了产生这个GAPROLE_ERROR错误的地方是

if ( events & START_ADVERTISING_EVT )
{
if ( gapRole_AdvEnabled )
{
gapAdvertisingParams_t params;

// Setup advertisement parameters
params.eventType = gapRole_AdvEventType;
params.initiatorAddrType = gapRole_AdvDirectType;
VOID osal_memcpy( params.initiatorAddr, gapRole_AdvDirectAddr, B_ADDR_LEN );
params.channelMap = gapRole_AdvChanMap;
params.filterPolicy = gapRole_AdvFilterPolicy;

if ( GAP_MakeDiscoverable( gapRole_TaskID, &params ) != SUCCESS )
{
gapRole_state = GAPROLE_ERROR;

// Notify the application with the new state change
if ( pGapRoles_AppCGs && pGapRoles_AppCGs->pfnStateChange )
{
pGapRoles_AppCGs->pfnStateChange( gapRole_state );
}
}
}
return ( events ^ START_ADVERTISING_EVT );
}

这个地方产生的。

  • 补充一下,调用这个GAP_MakeDiscoverable( gapRole_TaskID, &params ) 函数的时候返回的是0x12!

    来个TI的大神啊!

  • 继续补充,问题好像不是调用GAPRole_TerminateConnection函数引起的,而是我在动态的修改广播数据,及两种广播数据在不停的切换,这个时候只要有设备发起连接,就会产生GAPROLE_ERROR这个错误。

    那么问题就来了要怎么才能实现动态广播呢,而且还需要可以连接,连接时还要不产生错误。

  •  但是只是动态广播不会出现这种问题,只是在动态广播下发起连接才会有这种问题。

  • 请问TI的大神们,为什么从机在利用GAP_UpdateAdvertisingData实现动态广播时,主机发起连接会产生GAPROLE_ERROR这个错误,

    请问要实现动态广播,且设备可连接应该怎么做啊?还有为什么会引起GAPROLE_ERROR错误啊。

    if ( gapRole_AdvEnabled )
    {
    gapAdvertisingParams_t params;

    // Setup advertisement parameters
    params.eventType = gapRole_AdvEventType;
    params.initiatorAddrType = gapRole_AdvDirectType;
    VOID osal_memcpy( params.initiatorAddr, gapRole_AdvDirectAddr, B_ADDR_LEN );
    params.channelMap = gapRole_AdvChanMap;
    params.filterPolicy = gapRole_AdvFilterPolicy;

    if (GAP_MakeDiscoverable( gapRole_TaskID, &params ) != SUCCESS )
    {
    gapRole_state = GAPROLE_ERROR;//错误是在这里产生的,GAP_MakeDiscoverable的返回值是0x12


    // Notify the application with the new state change
    if ( pGapRoles_AppCGs && pGapRoles_AppCGs->pfnStateChange )
    {
    pGapRoles_AppCGs->pfnStateChange( gapRole_state );
    }
    }
    }

  • 动态修改广播数据+断开连接是不是太频繁了?延长下时间看看呢

  • 想起来一个类似案例,你试一下先关闭广播,再动态修改数据,完了以后再开启广播 

x 出现错误。请重试或与管理员联系。