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.

cc2540连接时间问题



你好,

请教个问题,我想实现调用GAPCentralRole_EstablishLink函数后,如果300ms内没有建立连接,就退出连接状态。请问默认的连接时间是多长,在哪设置连接不成功退出的时间。

  • hi zhe,

    需要花多少时间才能建立连接, 这个没有具体说法, 看具体的实际情况的, 信号之类等等.

    但是你的问题只要设定一个timer, 300ms后去判断有没有收到过 GAP_LINK_ESTABLISHED_EVENT 事件, 判断一下状态, 是否已经连接上之类. 如果没有, 就当成连接不成功就行.