nimble Link layer 状态机

Link Layer总共有7个状态,这7个状态串起了整个Link layer的运作。

1
2
3
4
5
6
7
#define BLE_LL_STATE_STANDBY        (0)
#define BLE_LL_STATE_ADV (1)
#define BLE_LL_STATE_SCANNING (2)
#define BLE_LL_STATE_INITIATING (3)
#define BLE_LL_STATE_CONNECTION (4)
#define BLE_LL_STATE_DTM (5)
#define BLE_LL_STATE_SYNC (6)
stateDiagram
    [*] --> STANDBY : reset
    STANDBY --> ADV
    STANDBY --> SCANNING
    STANDBY --> SYNC
    ADV --> STANDBY
    ADV --> SYNC
    ADV --> CONNECTION
    SCANNING --> STANDBY
    SCANNING --> INITIATING
    SCANNING --> SYNC
    INITIATING --> CONNECTION
    INITIATING --> STANDBY
    CONNECTION --> STANDBY
    CONNECTION --> DTM
    CONNECTION --> SYNC
    DTM --> STANDBY
    SYNC --> STANDBY