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.

还是updata connection parameter的问题



在bluetooth 4.0里有说,当peripheral接收到central发送的updata connection request后,peripheral可以选择接受,或则断开连接,

但是在TI的例程中,我似乎没有看到这一步,

请问peripheral接受到central发送的updata connection request后,会触发什么事件呢,还是例程中已经默认是接受呢?

谢谢大家!

  • Hi sw yang

        只有Central才能更新连接参数,并且更新连接参数会立即生效;

        Peripheral则只能向Central发起更新请求,将参数值发送给Central,至于能不能更新参数,这得取决于Central的决定。

  • Hi, shaokai,

      谢谢你的回答,但就是 至于能不能更新参数,这得取决于Central的决定 这个使我疑惑,

      因为我遍寻TI的Central的例程,没有找到Central做决定的这段程序,似乎Central默认接受Peripheral的更新请求,请问是否这样呢?

    Thank you !

  • Hi sw yang

        是的,协议栈是规定由central来决定是否执行更新peripheral的更新请求的,2540里的协议栈默认是接受peripheral的更新请求的。

    static void simpleBLECentralEventCB( gapCentralRoleEvent_t *pEvent )
    {

     case GAP_LINK_PARAM_UPDATE_EVENT://这个事件表示完成一次参数更新,如果你从机有发起更新请求,主机应该会触发这个事件

    }

    另外,主机在连接期间可以随时调用以下API来修改连接参数:

    bStatus_t GAPCentralRole_UpdateLink( uint16 connHandle, uint16 connIntervalMin,
    uint16 connIntervalMax, uint16 connLatency,
    uint16 connTimeout );

  • Hi, saokai,

      你的回答让我明白了,非常感谢 !