BLE Chip Design: Scanning State

The scanning state is also a fundamental state of the link layer. The host enters the scanning state through HCI commands, and the HCI commands related to scanning include:

  • HCI_LE_Set_Scan_Parameters
  • HCI_LE_Set_Scan_Enable
  • HCI_LE_Set_Scan_Response_Data

Scanning is divided into passive scanning and active scanning (similar to WIFI). Passive scanning means that the link layer only receives packets and does not send any packets.Active scanning means that after receiving an advertising PDU, it will decide whether to respond with a scanning PDU based on the type of PDU.The types of scanning PDUs mainly include the following four:

  • SCAN_REQ
  • SCAN_RSP
  • AUX_SCAN_REQ
  • AUX_SCAN_RSP

The structure of these four types of packets is as follows:BLE Chip Design: Scanning StateSimilarly, for extended types of scanning PDUs, the payload will also include an extended header, which can carry more information.In the previous article, two important parameters of scanning were mentioned: scan interval and scan window. These two parameters can determine the duration of the scan.Comparison of BLE and WIFI transmission modes.The scanning state is simpler than the advertising state, mainly involving packet reception. Its state machine corresponds to the state machine of the advertising state, which can be summarized as follows:BLE Chip Design: Scanning StateIf the received broadcast packet during scanning is connectable, the central device will switch from the scanning state to the initiating state, indicating that a connection can be started. In summary, the scanning state mainly handles received packets, and the scanning time is mainly controlled by the scan interval and scan window.Done!

Leave a Comment