蓝牙BLE主从机中GAP几种状态的解释

这是在从机上对GAP状态的描述

typedef enum
{
  GAPROLE_INIT = 0,                       //!< Waiting to be started 等待启动
  GAPROLE_STARTED,                        //!< Started but not advertising 启动但是没有在广播
  GAPROLE_ADVERTISING,                    //!< Currently Advertising 处于广播状态

  GAPROLE_WAITING,      
//设备启动但是没处于广播状态,处于再次广播之前的等待期间,比如关闭了广播等待再次打开广播             
 //!< Device is started but not advertising, is in waiting period before advertising again

  GAPROLE_WAITING_AFTER_TIMEOUT,      
// 设备仅仅是从连接中超时但是未广播,在再次广播之前处于等待期间   
 //!< Device just timed out from a connection but is not yet advertising, is in waiting period before advertising again

  GAPROLE_CONNECTED,                      //!< In a connection 处于连接状态
  GAPROLE_ERROR                           //!< Error occurred - invalid state 错误发生,无效的状态

} gaprole_States_t;

主机上对GAP状态的描述

enum
{
  BLE_STATE_IDLE,        //GAP连接处于空闲状态,说明我这个主机未和任何从机连接
  BLE_STATE_CONNECTING, //说明当前主机处于建立连接状态
  BLE_STATE_CONNECTED, //说明当前主机建立了连接状态
  BLE_STATE_DISCONNECTING //说明当前主机处于断开状态
};

你可能感兴趣的:(TI,低功耗蓝牙4.0)