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.

CC2564+msp430动态设置SPP(server)的Connectable Mode和Discoverablity Mode

Other Parts Discussed in Thread: CC2564

软件环境: SDK-v1.5-R2,使用工程v1.5 R2\MSP430_Experimentor\Samples\SPPLEDemo_Lite

开发工具:CCS6.0.1

需求:当BLE连接成功,关闭SPP(SPP不可见,不可连);当BLE断开连接,SPP可见可连

代码实现思路:

GAP_LE_Event_Callback()

{

  case etLE_Connection_Complete:

                                                              //...
                                                             SetNonConnect();
                                                             SetNonDisc();
                                                             SetNonPairable();
                                                             break;

case etLE_Disconnection_Complete:

                                                              //...
                                                             SetConnect();
                                                             SetDisc();
                                                             SetPairable();
                                                             break;

}

结果: 函数执行返回值均成功,但是造成BLE连接异常: 使用lightblue连接CC2564,上电后第一次能连接成功,断开后再用lightblue能扫描到,但是连接失败。