/** * @addtogroup BLE_COMMON * @{ * @defgroup BLE_COMMON_MSC Message Sequence Charts * @{ * * @defgroup BLE_COMMON_ENABLE BLE Stack Enable * @{ * @msc * hscale = "1.5"; * APP,SD; * |||; * APP=>SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GAP, cfg = {conn_cfg_tag = 1, gap_conn_cfg.conn_count = 1, app_ram_base);"]; * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATT, cfg = {conn_cfg_tag = 1, gatt_conn_cfg, app_ram_base);"]; * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTC, cfg = {conn_cfg_tag = 1, gattc_conn_cfg, app_ram_base);"]; * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTS, cfg = {conn_cfg_tag = 1, gatts_conn_cfg, app_ram_base);"]; * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; * APP<SD [label = "sd_ble_gap_connect(params, conn_cfg_tag = BLE_CONN_CFG_TAG_DEFAULT);"]; * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params)"]; * APP<SD [label = "sd_ble_gap_adv_start(adv_handle, conn_cfg_tag = 1);"]; * APP<SD [label = "sd_ble_gap_connect(params, conn_cfg_tag = 1);"]; * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; * APP<SD [label = "sd_nvic_EnableIRQ(SD_EVT_IRQn)"]; * APP<APP [label = "SD_EVT_IRQHandler()"]; * APP=>SD [label = "sd_ble_evt_get(buffer);"]; * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; * APP<SD [label = "sd_app_evt_wait(void);"]; * APP rbox APP [label="App Thread Mode blocked, CPU in low power mode"]; * |||; * ...; * |||; * SD rbox SD [label="Event Available for the App"]; * APP<SD [label = "sd_ble_evt_get(buffer);"]; * APP<SD [label = "sd_app_evt_wait(void);"]; * APP rbox APP [label="App Thread Mode blocked, CPU in low power mode"]; * |||; * ...; * |||; * SD rbox SD [label="Event Available for the App"]; * APP<SD [label = "sd_ble_evt_get(buffer);"]; * APP<SD [label = "sd_app_evt_wait(void);"]; * APP rbox APP [label="App Thread Mode blocked, CPU in low power mode"]; * |||; * ...; * |||; * @endmsc * * @} * @} */ /** * @addtogroup BLE_GAP * @{ * @defgroup BLE_GAP_MSC Message Sequence Charts * @{ * @defgroup BLE_GAP_ADV_MSC Advertising * @{ * @defgroup BLE_GAP_ADV_MSC_LEGACY Advertising using legacy advertising PDUs * @msc * hscale = "1.5"; * APP,SD,SCANNERS; * |||; * APP=>SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params)"]; * APP<SD [label = "sd_ble_gap_adv_start(adv_handle, conn_cfg_tag = BLE_CONN_CFG_TAG_DEFAULT)"]; * APP<SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; * ...; * SD->SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #1 App Stops Advertisement "]; * APP=>SD [label = "sd_ble_gap_adv_stop(adv_handle)"]; * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params : properties : type = BLE_GAP_ADV_TYPE_EXTENDED_*)"]; * APP<SD [label = "sd_ble_gap_adv_start(adv_handle, conn_cfg_tag = BLE_CONN_CFG_TAG_DEFAULT)"]; * APP<SCANNERS [label = "Advertisement (ADV_EXT_IND) on 1MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (AUX_*_IND) on 1MBPS/2MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (ADV_EXT_IND) on 1MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (AUX_*_IND) on 1MBPS/2MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; * ...; * SD->SCANNERS [label = "Advertisement (ADV_EXT_IND) on 1MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (AUX_*_IND) on 1MBPS/2MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #1 App Stops Advertisement "]; * APP=>SD [label = "sd_ble_gap_adv_stop(adv_handle)"]; * APP<CENTRAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED"]; * |||; * --- [label = " Variant #1 Local Disconnection "]; * APP=>SD [label = "sd_ble_gap_disconnect(reason)"]; * APP<CENTRAL [label = "Connection Termination", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {reason}"]; * |||; * --- [label = " Variant #2 Remote Disconnection "]; * SD<:CENTRAL [label = "Connection Termination", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {reason}"]; * @endmsc * * @defgroup BLE_GAP_CPU_MSC Peripheral Connection Parameter Update * @msc * hscale = "1.5"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established with conn. params. CP#1"]; * |||; * APP=>SD [label = "sd_ble_gap_conn_param_update(CP#2)"]; * APP<CENTRAL [label = "L2CAP Connection Parameter Update Request", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #1 Central Accepts "]; * |||; * SD<:CENTRAL [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; * SD<:CENTRAL [label = "LL Connection Update (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#2}"]; * |||; * --- [label = " Variant #2 Central Rejects "]; * |||; * SD<:CENTRAL [label = "L2CAP Connection Parameter Update Response: Rejected", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#1}"]; * --- [label = " Variant #3 Central Ignores "]; * |||; * ...; * |||; * SD box SD [label="Timeout"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#1}"]; * @endmsc * * @defgroup BLE_GAP_RSSI_FILT_MSC RSSI for connections with event filter * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * --- [label = " Variant #1: Trigger event when a new RSSI is available"]; * |||; * APP=>SD [label = "sd_ble_gap_rssi_start(conn_handle, 0, 0)"]; * APP<SD [label = "sd_ble_gap_rssi_stop()"]; * APP<SD [label = "sd_ble_gap_rssi_start(conn_handle, 0x05, 0x00)"]; * APP<SD [label = "sd_ble_gap_rssi_stop()"]; * APP<SD [label = "sd_ble_gap_rssi_start(conn_handle, 0x05, 0x03)"]; * APP<SD [label = "sd_ble_gap_rssi_stop()"]; * APP<SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi, p_ch_index)"]; * APP<SD [label = "sd_ble_gap_rssi_start(conn_handle, BLE_GAP_RSSI_THRESHOLD_INVALID, 0x00)"]; * APP<SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi, p_ch_index)"]; * APP<SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi, p_ch_index)"]; * APP<SD [label = "sd_ble_gap_rssi_stop()"]; * APP<SD [label = "sd_ble_gap_authenticate(params)"]; * APP<CENTRAL [label = "SMP Security Request", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #1 Central initiates Security Establishment "]; * |||; * APP rbox CENTRAL [label="Encryption or Pairing/Bonding initiated by Central"]; * |||; * --- [label = " Variant #2 Central ignores "]; * |||; * ...; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Timeout, error_src: local}"]; * |||; * @endmsc * * @defgroup BLE_GAP_PERIPH_LEGACY_MSC Peripheral Legacy Pairing * @{ * * @defgroup BLE_GAP_PERIPH_PAIRING_JW_MSC Pairing: Just Works * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: no_bond, no_mitm, no_io_caps}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: no_bond, no_mitm, no_io_caps, p_keyset: NULL)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * |||; * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; * |||; * APP rbox CENTRAL [label = "Encrypted with STK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_BONDING_JW_MSC Bonding: Just Works * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, no_mitm, no_io_caps}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, no_mitm, no_io_caps, p_keyset)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * |||; * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; * |||; * APP rbox CENTRAL [label = "Encrypted with STK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; * |||; * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_BONDING_PK_PERIPH_MSC Bonding: Passkey Entry, Peripheral displays * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, keyboard}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, mitm, display, p_keyset)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; * APP rbox APP [label="Passkey displayed to the user"]; * |||; * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; * |||; * APP rbox CENTRAL [label = "Encrypted with STK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_MITM}"]; * |||; * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC Bonding: Passkey Entry, User Inputs on Peripheral or OOB * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, display}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, mitm, keyboard, p_keyset)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_KEY_REQUEST {type}"]; * APP rbox APP [label="User enters Passkey or data received Out Of Band"]; * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey or OOB)"]; * APP<SD [label = "sd_ble_opt_set(opt_id = BLE_GAP_OPT_PASSKEY, p_opt->p_passkey=passkey)"]; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, keyboard}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, mitm, display, p_keyset)"]; * * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; * APP rbox APP [label="Passkey displayed to the user"]; * |||; * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; * |||; * APP rbox CENTRAL [label = "Encrypted with STK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_MITM}"]; * |||; * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_PAIRING_CONFIRM_FAIL_MSC Pairing failure: Confirm failed * This occurs if the random value doesn't match, usually because the user entered a wrong pin * or out of band data was missing. * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: mitm, display}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: mitm, keyboard, p_keyset: NULL)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * SD<:CENTRAL [label = "SMP Pairing Confirm", textcolor="#000080", linecolor="#000080"]; * SD:>CENTRAL [label = "SMP Pairing Confirm", textcolor="#000080", linecolor="#000080"]; * SD<:CENTRAL [label = "SMP Pairing Random", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Confirm value, error_src: local}"]; * SD:>CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @} * * @defgroup BLE_GAP_PERIPH_LESC_MSC Peripheral LESC Pairing * @{ * * @defgroup BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC Pairing: Just Works * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, no_bond, no_mitm, no_io_caps}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, no_bond, no_mitm, no_io_caps, p_pk_own)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; * |||; * APP abox APP [label="App starts DHKey calculation"]; * |||; * SD abox CENTRAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; * |||; * SD<:CENTRAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; * |||; * APP abox APP [label="App completes DHKey calculation"]; * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox CENTRAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_LESC_BONDING_NC_MSC Bonding: Numeric Comparison * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display(kbd/yesno)}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, mitm, display(kbd/yesno), keyset with p_pk_own)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; * |||; * APP abox APP [label="App starts DHKey calculation"]; * |||; * SD abox CENTRAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=1}"]; * APP rbox APP [label="Passkey displayed to the user, user compares values"]; * |||; * --- [label = " Variant #1 User confirms on both sides "]; * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_PASSKEY, NULL)"]; * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox CENTRAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; * |||; * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * --- [label = " Variant #2 User does not confirm locally "]; * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_NONE, NULL)"]; * APP<CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; * --- [label = " Variant #3 User does not confirm remotely "]; * SD<:CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: num comp failure, error_src: remote}"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC Bonding: Passkey Entry, Peripheral Displays * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, keyboard}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, mitm, display, keyset with p_pk_own)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; * APP rbox APP [label="Passkey displayed to the user"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; * |||; * APP abox APP [label="App starts DHKey calculation"]; * |||; * --- [label = " Optional keypresses from peer "]; * SD<:CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; * APP abox APP [label="App displays keypress"]; * SD<:CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; * APP abox APP [label="App displays keypress"]; * |||; * --- [label = ""]; * SD abox CENTRAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; * |||; * SD<:CENTRAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; * |||; * APP abox APP [label="App completes DHKey calculation"]; * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox CENTRAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; * |||; * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC Bonding: Passkey Entry, User Inputs on Peripheral * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, mitm, keyboard, keyset with p_pk_own)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_KEY_REQUEST {passkey}"]; * APP rbox APP [label="User enters Passkey"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; * |||; * APP abox APP [label="App starts DHKey calculation"]; * |||; * --- [label = " Optional keypresses sent to peer "]; * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; * APP<CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; * APP<CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = ""]; * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey)"]; * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox CENTRAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; * |||; * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC Bonding: Out of Band * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; * APP<SD [label = "sd_ble_gap_lesc_oob_data_get(p_pk_own, p_oobd_own)"]; * APP<SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, oob, keyset with p_pk_own)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk, oobd_req=1}"]; * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; * |||; * APP abox APP [label="App starts DHKey calculation"]; * |||; * APP=>SD [label = "sd_ble_gap_lesc_oob_data_set(p_oobd_own, p_oobd_peer)"]; * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox CENTRAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; * |||; * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * @endmsc * * @} * * @defgroup BLE_GAP_PERIPH_PAIRING_KS_OUT_OF_RANGE_MSC Pairing failure: Keysize out of supported range * This occurs if the min key size offered by the peer is above 16, or max key size below 7. * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Invalid params, error_src: local}"]; * SD:>CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_PAIRING_KS_TOO_SMALL_MSC GAP Failed Pairing: Keysize too small * This occurs if the max key size offered by the peer is below the min key size specified by * the app. * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * SD<:CENTRAL [label = "SMP Pairing Confirm", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Enc key size, error_src: local}"]; * SD:>CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_PAIRING_APP_ERROR_MSC Pairing failure: Pairing aborted by the application * When the application detects that the pairing should not be performed, for example an * insufficient IO combination, it can use sd_ble_gap_sec_params_reply() to send * SMP Pairing failed to the peer. * * When the stack handles the response from the application it will also validate * the passkey (SMP_STC_PASSKEY_ENTRY_FAILED). If any error is detected it will be * reported when sd_ble_gap_sec_params_reply() is called. * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; * SD abox APP [label="Stack looks for errors", textbgcolor="#7f7fff"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply()"]; * APP<CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: , error_src: local}"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_PAIRING_REMOTE_PAIRING_FAIL_MSC Pairing failure: Pairing failed from central * SMP Pairing Failed may be sent from the central at various times. The application should * prepare for this and gracefully handle the event. * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * SD<:CENTRAL [label = "SMP Pairing Failed", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: , error_src: remote}"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_PAIRING_TIMEOUT_MSC Pairing failure: Timeout * This occurs if the central device doesn't continue the pairing sequence within 30 seconds. * @msc * hscale = "2"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS)"]; * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * --- [ label = "Wait 30 sec" ]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Timeout, error_src: local}"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_ENC_MSC Peripheral Encryption Establishment using stored keys * @msc * hscale = "1.5"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established"]; * |||; * SD<:CENTRAL [label = "LL Encryption Request (LL_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_INFO_REQUEST {addr, ediv, rand}"]; * |||; * --- [label = " Variant #1 App Replies with Keys "]; * |||; * APP rbox APP [label = "Load Peripheral Keys"]; * APP=>SD [label = "sd_ble_gap_sec_info_reply(ediv, rand, LTK)"]; * APP<CENTRAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; * APP rbox CENTRAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE"]; * |||; * --- [label = " Variant #2 App Replies without Keys "]; * |||; * APP=>SD [label = "sd_ble_gap_sec_info_reply(NULL)"]; * APP<CENTRAL [label = "LL Reject Ind (LL_REJECT_IND): Pin or Key Missing", textcolor="#000080", linecolor="#000080"]; * APP rbox CENTRAL [label = "Link is NOT encrypted"]; * |||; * --- [label = " Variant #3 App Replies with Incorrect Keys "]; * |||; * APP rbox APP [label = "Load Incorrect Peripheral Keys"]; * APP=>SD [label = "sd_ble_gap_sec_info_reply(ediv, rand, LTK)"]; * APP<CENTRAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; * APP rbox CENTRAL [label = "Link Terminated due to authentication error"]; * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {MIC Failure}"]; * @endmsc * * @defgroup BLE_GAP_PERIPH_INVALID_SMP_PDU_MSC Unexpected Security Packet Reception * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP rbox PEER [label="No pairing in progress"]; * |||; * PEER rbox PEER [label="Peer misbehaving"]; * |||; * SD<:PEER [label = "SMP Pairing Failed (or other unexpected SMP PDU)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {PDU_INVALID}"]; * |||; * @endmsc * @} * * * @defgroup BLE_GAP_SCAN_MSC Scanning * @{ * @defgroup BLE_GAP_SCAN_MSC_LEGACY Scanning for advertisers performing legacy advertising * @msc * hscale = "1.5"; * APP,SD,ADVERTISERS; * |||; * APP=>SD [label = "sd_ble_gap_scan_start(params : extended = 0, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_scan_start(params : {extended = 0, active = 1}, adv_report_buffer)"]; * APP<ADVERTISERS [label = "Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; * SD<-ADVERTISERS [label = "Scan Response (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {bdaddr, rssi, data}"]; * ...; * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"]; * |||; * @endmsc * @defgroup BLE_GAP_SCAN_MSC_AE Scanning for advertisers performing legacy and extended advertising * @msc * hscale = "1.5"; * APP,SD,ADVERTISERS; * |||; * APP=>SD [label = "sd_ble_gap_scan_start(params : {extended = 1, report_incomplete_evts = 0}, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_scan_start(params : {extended = 1, active = 1, report_incomplete_evts = 0}, adv_report_buffer)"]; * APP<ADVERTISERS [label = "Scan Request (AUX_SCAN_REQ) on secondary_phy", textcolor="#000080", linecolor="#000080"]; * SD<-ADVERTISERS [label = "Scan Response (AUX_SCAN_RSP) on secondary_phy", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 1, scannable = 1, scan_response = 1}, data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<ADVERTISERS [label = "Legacy Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 0, scannable = 1, scan_response = 0}, adv_data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_scan_start(params : {extended = 1, report_incomplete_evts = 1}, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_connect(scan_params : extended = 0, conn_params)"]; * APP<PERIPHERAL [label = "LL Connect (CONNECT_IND)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED"]; * |||; * --- [label = " Variant #2 Connection Establishment Cancelled "]; * APP=>SD [label = "sd_ble_gap_connect_cancel()"]; * APP<SD [label = "sd_ble_gap_connect(scan_params={extended=1,scan_phys=PHY_A and PHY_B}, conn_params)"]; * APP<PERIPHERAL [label = "LL Connect Request(AUX_CONNECT_REQ) on secondary_phy", textcolor="#000080", linecolor="#000080"]; * SD<:PERIPHERAL [label = "LL Connect Response(AUX_CONNECT_RSP) on secondary_phy", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED"]; * |||; * --- [label = " Variant #2 Connection Establishment Cancelled "]; * APP=>SD [label = "sd_ble_gap_connect_cancel()"]; * APP<SD [label = "sd_ble_gap_connect(scan_params={extended=1,scan_phys=PHY_A}, conn_params)"]; * APP<SD [label = "sd_ble_gap_conn_param_update(CP#2)"]; * APP<PERIPHERAL [label = "LL Connection Update (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#2}"]; * |||; * --- [label = " Peripheral Solicited procedure"]; * |||; * SD<:PERIPHERAL [label = "L2CAP Connection Parameter Update Request {CP#3}", textcolor="#000080", linecolor="#000080"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST {CP#3}"]; * |||; * --- [label = " Variant #1 App Accepts "]; * APP=>SD [label = "sd_ble_gap_conn_param_update(CP#3)"]; * APP<PERIPHERAL [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; * SD:>PERIPHERAL [label = "LL Connection Update (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#3}"]; * |||; * --- [label = " Variant #2 App Rejects "]; * |||; * APP=>SD [label = "sd_ble_gap_conn_param_update(NULL)"]; * APP<PERIPHERAL [label = "L2CAP Connection Parameter Update Response: Rejected", textcolor="#000080", linecolor="#000080"]; * |||; * @endmsc * * @defgroup BLE_GAP_CENTRAL_SEC_MSC Central Security Procedures * @{ * * @defgroup BLE_GAP_CENTRAL_SEC_REQ_MSC Security Request Reception * @msc * hscale = "1.5"; * APP,SD,PERIPHERAL; * |||; * APP rbox PERIPHERAL [label="Connection Established"]; * |||; * SD<:PERIPHERAL [label = "SMP Security Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_REQUEST {bond, mitm}"]; * |||; * --- [label = " Variant #1 Central initiates Security Establishment "]; * |||; * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; * APP<SD [label = "sd_ble_gap_authenticate(params)"]; * APP<SD [label = "sd_ble_gap_authenticate(NULL)"]; * APP<PERIPHERAL [label = "SMP Pairing Failed: Pairing Not Supported", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Pairing Not Supp, error_src: local}"]; * |||; * @endmsc * * @defgroup BLE_GAP_CENTRAL_LEGACY_MSC Central Legacy Pairing * @{ * * @defgroup BLE_GAP_CENTRAL_PAIRING_JW_MSC Pairing: Just Works * @msc * hscale = "2"; * APP,SD,PERIPHERAL; * |||; * APP rbox PERIPHERAL [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gap_authenticate(no_bond, no_mitm, no_io_caps)"]; * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: no_bond, no_mitm, no_io_caps}"]; * |||; * --- [label = " Variant #1 Central Accepts Peripheral parameters "]; * |||; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset: NULL)"]; * |||; * SD abox PERIPHERAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; * |||; * APP rbox PERIPHERAL [label = "Encrypted with STK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * |||; * --- [label = " Variant #2 Central Rejects Peripheral parameters "]; * |||; * APP=>SD [label = "sd_ble_gap_sec_params_reply(BLE_GAP_SEC_STATUS_INVALID_PARAMS, own_params: NULL, p_keyset: NULL)"]; * |||; * SD:>PERIPHERAL [label = "SMP Pairing Failed", textcolor="#000080", linecolor="#000080"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {FAILURE}"]; * @endmsc * * @defgroup BLE_GAP_CENTRAL_BONDING_JW_MSC Bonding: Just Works * @msc * hscale = "2"; * APP,SD,PERIPHERAL; * |||; * APP rbox PERIPHERAL [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gap_authenticate(bond, no_mitm, no_io_caps)"]; * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, no_mitm, no_io_caps}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset)"]; * |||; * SD abox PERIPHERAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; * |||; * APP rbox PERIPHERAL [label = "Encrypted with STK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; * |||; * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * @endmsc * * @defgroup BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC Bonding: Passkey Entry, Central displays * @msc * hscale = "2"; * APP,SD,PERIPHERAL; * |||; * APP rbox PERIPHERAL [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gap_authenticate(bond, mitm, display)"]; * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Response}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, keyboard}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset)"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; * APP rbox APP [label="Passkey displayed to the user"]; * |||; * SD abox PERIPHERAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; * |||; * APP rbox PERIPHERAL [label = "Encrypted with STK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_MITM}"]; * |||; * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * @endmsc * * @defgroup BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC Bonding: Passkey Entry, User Inputs on Central or OOB * @msc * hscale = "2"; * APP,SD,PERIPHERAL; * |||; * APP rbox PERIPHERAL [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gap_authenticate(bond, mitm, keyboard)"]; * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, display}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset)"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_KEY_REQUEST {type}"]; * APP rbox APP [label="User enters Passkey or data received Out Of Band"]; * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey or OOB)"]; * APP<SD [label = "sd_ble_gap_authenticate(lesc, no_bond, no_mitm, no_io_caps)"]; * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, no_bond, no_mitm, no_io_caps}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_pk_own)"]; * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; * |||; * APP abox APP [label="App starts DHKey calculation"]; * |||; * SD abox PERIPHERAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; * |||; * APP abox APP [label="App completes DHKey calculation"]; * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * @endmsc * * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC Bonding: Numeric Comparison * @msc * hscale = "2"; * APP,SD,PERIPHERAL; * |||; * APP rbox PERIPHERAL [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gap_authenticate(lesc, bond, mitm, display(kbd/yesno))"]; * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display(kbd/yesno)}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; * |||; * APP abox APP [label="App starts DHKey calculation"]; * |||; * SD abox PERIPHERAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=1}"]; * APP rbox APP [label="Passkey displayed to the user, user compares values"]; * |||; * --- [label = " Variant #1 User confirms on both sides "]; * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_PASSKEY, NULL)"]; * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; * |||; * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * --- [label = " Variant #2 User does not confirm locally "]; * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_NONE, NULL)"]; * APP<PERIPHERAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; * --- [label = " Variant #3 User does not confirm remotely "]; * SD<:PERIPHERAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: num comp failure, error_src: remote}"]; * @endmsc * * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC Bonding: Passkey Entry: Central Displays * @msc * hscale = "2"; * APP,SD,PERIPHERAL; * |||; * APP rbox PERIPHERAL [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gap_authenticate(lesc, bond, mitm, display)"]; * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, keyboard}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; * |||; * APP abox APP [label="App starts DHKey calculation"]; * |||; * --- [label = " Optional keypresses from peer "]; * SD<:PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; * APP abox APP [label="App displays keypress"]; * SD<:PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; * APP abox APP [label="App displays keypress"]; * |||; * --- [label = ""]; * SD abox PERIPHERAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; * |||; * APP abox APP [label="App completes DHKey calculation"]; * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; * |||; * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * @endmsc * * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC Bonding: Passkey Entry: User Inputs on Central * @msc * hscale = "2"; * APP,SD,PERIPHERAL; * |||; * APP rbox PERIPHERAL [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gap_authenticate(lesc, bond, mitm, keyboard)"]; * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; * |||; * APP abox APP [label="App starts DHKey calculation"]; * |||; * --- [label = " Optional keypresses sent to peer "]; * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; * APP<PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; * APP<PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = ""]; * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey)"]; * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; * |||; * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * @endmsc * * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC Bonding: Out of Band * @msc * hscale = "2"; * APP,SD,PERIPHERAL; * |||; * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; * APP<SD [label = "sd_ble_gap_lesc_oob_data_get(p_pk_own, p_oobd_own)"]; * APP<SD [label = "sd_ble_gap_authenticate(lesc, bond, oob)"]; * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, oob}"]; * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk, oobd_req=1}"]; * |||; * APP abox APP [label="App starts DHKey calculation"]; * |||; * APP=>SD [label = "sd_ble_gap_lesc_oob_data_set(p_oobd_own, p_oobd_peer)"]; * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; * |||; * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; * |||; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; * APP rbox APP [label = "Keys stored in keyset"]; * @endmsc * @} * * @defgroup BLE_GAP_CENTRAL_INVALID_SMP_PDU_MSC Unexpected Security Packet Reception * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP rbox PEER [label="No pairing in progress"]; * |||; * PEER rbox PEER [label="Peer misbehaving"]; * |||; * SD<:PEER [label = "SMP Pairing Failed (or other unexpected SMP PDU)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {PDU_INVALID}"]; * |||; * @endmsc * * @defgroup BLE_GAP_CENTRAL_ENC_MSC Encryption Establishment using stored keys * @msc * hscale = "1.5"; * APP,SD,PERIPHERAL; * |||; * APP rbox PERIPHERAL [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; * APP<PERIPHERAL [label = "LL Encryption Request (LL_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #1 Peripheral replies with keys "]; * |||; * PERIPHERAL rbox PERIPHERAL [label = "Peripheral Loads Keys"]; * SD<:PERIPHERAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE"]; * |||; * --- [label = " Variant #2 Peripheral keys missing "]; * |||; * PERIPHERAL rbox PERIPHERAL [label = "Peripheral Keys Missing"]; * SD<:PERIPHERAL [label = "LL Reject Ind (LL_REJECT_IND): Pin or Key Missing", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE"]; * APP rbox PERIPHERAL [label = "Link is NOT encrypted"]; * |||; * --- [label = " Variant #3 Incorrect peripheral keys "]; * |||; * PERIPHERAL rbox PERIPHERAL [label = "Peripheral Loads Incorrect Keys"]; * SD<:PERIPHERAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; * APP rbox PERIPHERAL [label = "Link Terminated due to authentication error"]; * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {MIC Failure}"]; * |||; * @endmsc * * @defgroup BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC Central Encryption and Authentication mutual exclusion * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; * APP<PEER [label = "Encryption Start (LL_START_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; * |||; * APP note SD [label = " Encryption in progress, authentication disallowed"]; * |||; * APP=>SD [label = "sd_ble_gap_authenticate()"]; * APP<SD [label = "sd_ble_gap_conn_param_update()"]; * APP<PEER [label = "Connection Update Start (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; * |||; * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; * APP<SD [label = "sd_ble_gap_authenticate()"]; * APP<PEER [label = "Encryption Start (LL_START_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "Encryption Complete (LL_START_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE "]; * |||; * APP=>SD [label = "sd_ble_gap_authenticate()"]; * APP<SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; * APP<SD [label = "sd_ble_gap_conn_param_update(conn_handle_3, CP#3)"]; * APP<PERIPHERALS [label = "Connection Update Start on link #3 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; * |||; * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_1, CP#1)"]; * APP<SD [label = "sd_ble_gap_conn_param_update(conn_handle_2, CP#2)"]; * APP<PERIPHERALS [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; * |||; * APP note PERIPHERALS [label = " Additional procedure on link #2 fails, since another one is pending"]; * |||; * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_2, CP#5)"]; * APP<PERIPHERALS [label = "Connection Update Start on link #1 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; * SD<:PERIPHERALS [label = "Connection Update Complete on link #1", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_1, CP#1}"]; * |||; * SD:>PERIPHERALS [label = "Connection Update Start on link #2 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; * |||; * APP note PERIPHERALS [label = " Peripheral solicited procedure on link #4"]; * |||; * SD<:PERIPHERALS [label = "L2CAP Connection Parameter Update Request {CP#4}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST {conn_handle_4, CP#4}"]; * |||; * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_4, CP#4)"]; * APP<PERIPHERALS [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; * |||; * SD<:PERIPHERALS [label = "Connection Update Complete on link #2", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_2, CP#2}"]; * |||; * SD:>PERIPHERALS [label = "Connection Update Start on link #4 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; * SD<:PERIPHERALS [label = "Connection Update Complete on link #4", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_4, CP#4}"]; * |||; * @endmsc * * @defgroup BLE_GAP_MULTILINK_CTRL_PROC_MSC Central Control Procedure Serialization on multiple links * @msc * hscale = "1.5"; * APP,SD,PERIPHERALS; * |||; * APP rbox PERIPHERALS [label="Connection Established with 4 peers, all with conn. params. CP#0"]; * |||; * APP note PERIPHERALS [label = " Peripheral solicited procedure on link #2"]; * |||; * SD<:PERIPHERALS [label = "L2CAP Connection Parameter Update Request {CP#2}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST {conn_handle_2, CP#3}"]; * |||; * APP note PERIPHERALS [label = " Encryption procedure on link #3"]; * |||; * APP=>SD [label = "sd_ble_gap_encrypt(conn_handle_3, LTK#3)"]; * APP<PERIPHERALS [label = "Encryption Start (LL_START_ENC_REQ) on link #3", textcolor="#000080", linecolor="#000080"]; * |||; * APP note PERIPHERALS [label = " Connection Update procedure on link #1"]; * |||; * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_1, CP#1)"]; * APP<SD [label = "sd_ble_gap_conn_param_update(conn_handle_2, CP#2)"]; * APP<PERIPHERALS [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; * |||; * APP note PERIPHERALS [label = " Encryption procedure on link #4"]; * |||; * APP=>SD [label = "sd_ble_gap_encrypt(conn_handle_4, LTK#4)"]; * APP<PERIPHERALS [label = "Encryption Start (LL_START_ENC_REQ) on link #4", textcolor="#000080", linecolor="#000080"]; * SD<:PERIPHERALS [label = "Encryption Complete (LL_START_ENC_RSP) on link #4", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {conn_handle_4}"]; * |||; * SD:>PERIPHERALS [label = "Connection Update Start (LL_CONNECTION_UPDATE_IND) on link #1", textcolor="#000080", linecolor="#000080"]; * SD<:PERIPHERALS [label = "Connection Update Complete on link #1", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_1, CP#1}"]; * |||; * SD:>PERIPHERALS [label = "Connection Update Start (LL_CONNECTION_UPDATE_IND on link #2", textcolor="#000080", linecolor="#000080"]; * SD<:PERIPHERALS [label = "Connection Update Complete on link #2", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_2, CP#2}"]; * |||; * @endmsc * * @defgroup BLE_GAP_WL_SHARE_MSC Whitelist Sharing * @msc * hscale = "1.5"; * APP,SD; * |||; * APP=>SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: { fp = CONNREQ })"]; * APP<SD [label = "sd_ble_gap_whitelist_set(WL#1)"]; * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; * APP<SD [label = "sd_ble_gap_whitelist_set(WL#2)"]; * APP<SD [label = "sd_ble_gap_scan_start(use_whitelist = 1, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_adv_stop(adv_handle)"]; * APP<SD [label = "sd_ble_gap_scan_stop()"]; * APP<SD [label = "sd_ble_gap_whitelist_set(WL#2)"]; * APP<SD [label = "sd_ble_gap_scan_start(use_whitelist = 1, adv_report_buffer)"]; * APP<SD [label = "sd_ble_gap_connect(use_whitelist = 1)"]; * APP<SD [label = "sd_ble_gap_addr_set(addr)"]; * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = NULL})"]; * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; * APP<SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; * ...; * SD box SD [label="Private address timeout"]; * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #2 Advertise with address resolvable by local IRK in device identity list "]; * |||; * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: {local_irk1}) "]; * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1})"]; * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; * APP<SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; * ...; * SD box SD [label="Private address timeout"]; * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #3 Advertise with non-resolvable address "]; * |||; * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: NON_RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = NULL})"]; * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; * APP<SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable1", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable1", textcolor="#000080", linecolor="#000080"]; * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable1", textcolor="#000080", linecolor="#000080"]; * ...; * SD box SD [label="Private address timeout"]; * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable2", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GAP_PRIVACY_SCAN_MSC Private Scanning * @msc * hscale = "1.5"; * APP,SD,ADVERTISERS; * |||; * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; * APP<SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #2 Active Scan with address resolvable by local IRKs "]; * |||; * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, {peer_addr2, peer_irk2}, pp_local_irks: {local_irk1, local_irk2}) "]; * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; * APP<SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; * SD box ADVERTISERS [label = "peer_addr1 is in the device identity list, respond with an address generated from local_irk1"]; * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; * |||; * ...; * ADVERTISERS->SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; * SD box ADVERTISERS [label = "Resolvable2 resolved to device identity peer_addr2 in the device identity list, respond with an address generated from local_irk2"]; * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; * |||; * ...; * ADVERTISERS->SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND), Addr = peer_addr3", textcolor="#000080", linecolor="#000080"]; * SD box ADVERTISERS [label = "peer_addr3 is not in the device identity list, respond with an address generated from device_irk"]; * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #3 Active Scan with non-resolvable address "]; * |||; * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: NON_RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; * APP<SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Non-Resolvable", textcolor="#000080", linecolor="#000080"]; * ADVERTISERS->SD [label = "Scan Response packet (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; * |||; * @endmsc * * @defgroup BLE_GAP_PRIVACY_SCAN_PRIVATE_SCAN_MSC Scan Private Devices * @msc * hscale = "1.5"; * APP,SD,ADVERTISERS; * |||; * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; * SD note ADVERTISERS [label="Resolvable1 resolved to device identity peer_addr1"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr1, rssi, data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<SD [label = "Advertisement (ADV_*_IND), Addr = peer_addr2", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr2, rssi, data}"]; * |||; * --- [label = " Variant #2 Scan and resolve private devices with whitelist "]; * |||; * APP=>SD [label = "sd_ble_gap_whitelist_set({peer_addr1, Resolvable2}) "]; * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; * SD note ADVERTISERS [label="Resolvable1 resolved to device identity peer_addr1 which is in the whitelist"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr1, rssi, data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; * SD note ADVERTISERS [label="Resolvable2 did not resolve to a device identity but is in the whitelist"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {Resolvable2, rssi, data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable3", textcolor="#000080", linecolor="#000080"]; * SD note ADVERTISERS [label="Resolvable3 is not in the whitelist, no report generated"]; * |||; * --- [label = " Variant #3 Scan directed advertisers and resolve initiator address using device IRK"]; * |||; * APP=>SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; * APP<SD [label = "Advertisement (ADV_*_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * ADVERTISERS box SD [label = "Advertiser Address resolved using peer_irk1, Initiator address resolved using device_irk"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr: peer_addr1"]; * |||; * --- [label = " Variant #4 Scan directed advertisers and resolve initiator address using local IRK in device identity list"]; * |||; * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: local_irk1) "]; * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; * APP<SD [label = "Advertisement (ADV_*_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * ADVERTISERS box SD [label = "Advertiser Address resolved using peer_irk1, Initiator address resolved using local_irk1"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr: peer_addr1"]; * |||; * --- [label = " Variant #5 Scan directed advertisers with unresolved direct address "]; * |||; * APP=>SD [label = "sd_ble_gap_scan_start(params: {adv_dir_report = 1}, adv_report)"]; * APP<SD [label = "Advertisement (ADV_*_IND), Advertiser Addr = peer_addr2, Initiator Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; * ADVERTISERS box SD [label = "Resolvable2 could not be resolved, report the unresolved direct address"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr: peer_addr2, direct_addr: Resolvable2}"]; * |||; * @endmsc * * @defgroup BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC Directed Advertising * @msc * hscale = "1.5"; * APP,SD,INITIATOR; * |||; * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND) , Advertiser Addr = addr, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = addr, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = addr, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #2 Private directed advertising to private peer using device IRK"]; * |||; * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #3 Private directed advertising to private peer using local IRK in device identity list"]; * |||; * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: {local_irk1}) "]; * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #4 Private directed advertising to non-private peer using local IRK in device identity list"]; * |||; * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk=0..0}, pp_local_irks: {local_irk1}) "]; * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; * |||; * @endmsc * * @defgroup BLE_GAP_PERIPH_CONN_PRIV_MSC Peripheral Connection Establishment with Private Peer * @msc * hscale = "1.5"; * APP,SD,CENTRAL; * |||; * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<CENTRAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 1}"]; * |||; * --- [label = " Variant #2 Peer used identity address during connection setup "]; * |||; * APP rbox CENTRAL [label="Start Connectable Advertising"]; * |||; * SD<:>CENTRAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 0}"]; * |||; * @endmsc * * @defgroup BLE_GAP_CENTRAL_CONN_PRIV_MSC Central Connection Establishment with Private Peer * @msc * hscale = "1.5"; * APP,SD,PERIPHERAL; * |||; * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_connect(peer_addr = {peer_addr1, addr_id_peer = 1})"]; * APP<PERIPHERAL [label = "Scanning", textcolor="#000080", linecolor="#000080"]; * --- [label = " Variant #1 Peer used resolvable addresses during connection setup "]; * |||; * SD<:>PERIPHERAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 1}"]; * |||; * --- [label = " Variant #2 Peer used identity address during connection setup "]; * |||; * SD<:>PERIPHERAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 0}"]; * |||; * @endmsc * * @} * * @defgroup BLE_GAP_EVT_PHY_MSC PHY Update Procedure * @{ * * @defgroup BLE_GAP_CENTRAL_PHY_UPDATE Central PHY Update * @msc * hscale = "1.5"; * APP,SD,PERIPHERAL; * |||; * APP rbox PERIPHERAL [label="Connection Established. Current TX PHY and RX PHY are both 1Mbit"]; * |||; * --- [label = " Variant #1 Initiated by Peripheral - no change in PHY "]; * SD<=PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=1Mbit, rx_phys=1Mbit})"]; * APP<PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) - No change", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=1Mbit}}"]; * |||; * --- [label = " Variant #2 Initiated by Peripheral - change of PHY required"]; * SD<=PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=2Mbit, rx_phys=2Mbit})"]; * APP<PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; * |||; * --- [label = " Variant #3 Initiated by APP, not supported by peer"]; * |||; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; * APP<PERIPHERAL [label="PHY Request (LL_PHY_REQ)", textcolor="#000080", linecolor="#000080"]; * SD<=PERIPHERAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Not Supported}"]; * |||; * --- [label = " Variant #4 Initiated by APP, change required"]; * |||; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; * APP<PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; * SD<=PERIPHERAL [label = "PHY Response (LL_PHY_RSP) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; * SD=>PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; * |||; * --- [label = " Variant #5 Initiated by Peripheral - APP has no preferences for TX direction"]; * SD<=PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=1Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=1Mbit}}"]; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=BLE_GAP_PHY_AUTO, rx_phys=2Mbit})"]; * APP<PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=1Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=2Mbit}}"]; * |||; * --- [label = " Variant #6 Initiated by APP, peer responding with invalid parameters"]; * |||; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; * APP<PERIPHERAL [label="PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; * SD<=PERIPHERAL [label="PHY Response (LL_PHY_RSP) {tx_phys=0x00, rx_phys=0x00}", textcolor="#000080", linecolor="#000080"]; * SD=>PERIPHERAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Invalid LMP Parameters}"]; * |||; * @endmsc * * @defgroup BLE_GAP_PERIPHERAL_PHY_UPDATE Peripheral PHY Update * @msc * hscale = "1.5"; * APP,SD,CENTRAL; * |||; * APP rbox CENTRAL [label="Connection Established. Current TX PHY and RX PHY are both 1Mbit"]; * |||; * --- [label = " Variant #1 Initiated by Central - no change in PHY "]; * SD<=CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=1Mbit, rx_phys=1Mbit})"]; * APP<CENTRAL [label = "PHY Response (LL_PHY_RSP) {tx_phys=1Mbit, rx_phys=1Mbit}", textcolor="#000080", linecolor="#000080"]; * SD<=CENTRAL [label = "PHY Update (LL_PHY_UPDATE_IND) - No change", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=1Mbit}}"]; * |||; * --- [label = " Variant #2 Initiated by Central - change of PHY required"]; * SD<=CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=2Mbit, rx_phys=2Mbit})"]; * APP<CENTRAL [label = "PHY Response (LL_PHY_RSP) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; * SD<=CENTRAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; * |||; * --- [label = " Variant #3 Initiated by APP, not supported by peer"]; * |||; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; * APP<CENTRAL [label="PHY Request (LL_PHY_REQ)", textcolor="#000080", linecolor="#000080"]; * SD<=CENTRAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Not Supported}"]; * |||; * --- [label = " Variant #4 Initiated by APP, change required"]; * |||; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; * APP<CENTRAL [label="PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; * SD<=CENTRAL [label="PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; * |||; * --- [label = " Variant #5 Initiated by Central - APP has no preferences for TX direction"]; * SD<=CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=1Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=1Mbit}}"]; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=BLE_GAP_PHY_AUTO, rx_phys=2Mbit})"]; * APP<CENTRAL [label = "PHY Response (LL_PHY_RSP) {tx_phys=ALL_PHY, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; * SD<=CENTRAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=1Mbit}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=2Mbit}}"]; * |||; * --- [label = " Variant #6 Collision between self-initiated PHY Update and peer initiated Channel Map Update procedures"]; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=2Mbit, rx_phys=2Mbit})"]; * APP<CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; * SD<=CENTRAL [label = "Reject Command (LL_REJECT_EXT_IND) {ErrorCode=Different Transaction Collision}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Different Transaction Collision, {tx_phy=1Mbit, rx_phy=1Mbit}}"]; * |||; * --- [label = " Variant #7 Initiated by APP, peer responding with invalid parameters"]; * |||; * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; * APP<CENTRAL [label="PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; * SD<=CENTRAL [label="PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=(1Mbit|2Mbit), S_TO_M_PHY=(1Mbit|2Mbit)", textcolor="#000080", linecolor="#000080"]; * SD=>CENTRAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Invalid LMP Parameters}"]; * |||; * @endmsc * * @} * @defgroup BLE_GAP_DATA_LENGTH_UPDATE_PROCEDURE_MSC Data Length Update Procedure * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * --- [label = " Self initiated, automatic parameters "]; * |||; * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; * |||; * ...; * |||; * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, NULL, NULL)"]; * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; * |||; * ...; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * --- [label = " Self initiated, application set parameters "]; * |||; * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; * |||; * ...; * |||; * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, NULL)"]; * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; * |||; * ...; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * --- [label = " Peer initiated, automatic parameters "]; * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; * |||; * ...; * |||; * SD<:PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST {.peer_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, NULL, NULL)"]; * APP<PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; * |||; * ...; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * --- [label = " Peer initiated, application set parameters"]; * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; * |||; * ...; * |||; * SD<:PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST {.peer_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, NULL)"]; * APP<PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; * |||; * ...; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * --- [label = " Using the limitation out parameter to adjust Link Layer Data Channel PDU size, memory limited "]; * |||; * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; * |||; * ...; * |||; * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; * APP<SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=200, .max_rx_octets=200, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=200, rx=200}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=200, .max_rx_octets=200, .max_tx_time_us=1712, .max_rx_time_us=1712}}"]; * |||; * ...; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * --- [label = " Using the limitation out parameter to adjust Link Layer Data Channel PDU size, time limited "]; * |||; * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; * |||; * ...; * |||; * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; * APP<SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251-178=73, .max_rx_octets=251-178=73, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=73, rx=73}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=73, .max_rx_octets=73, .max_tx_time_us=696, .max_rx_time_us=696}}"]; * @endmsc * @} * * @} * @} */ /** * @addtogroup BLE_GATTC * @{ * @defgroup BLE_GATTC_MSC Message Sequence Charts * @{ * @defgroup BLE_GATTC_PRIM_SRVC_DISC_MSC GATTC Primary Service Discovery * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * --- [label = " Variant #1 Discover All Services "]; * |||; * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle, NULL)"]; * APP<PEER [label = "ATT Read By Group Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read By Group Type Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N, NULL)"]; * APP<PEER [label = "ATT Read By Group Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read By Group Type Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N + M, NULL)"]; * APP<PEER [label = "ATT Read By Group Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; * |||; * --- [label = " Variant #2 Discover a Specific Service "]; * |||; * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle, uuid)"]; * APP<PEER [label = "ATT Find By Type Value Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Find By Type Value Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N, uuid)"]; * APP<PEER [label = "ATT Find By Type Value Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Find By Type Value Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N + M, uuid)"]; * APP<PEER [label = "ATT Find By Type Value Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; * @endmsc * * @defgroup BLE_GATTC_REL_DISC_MSC GATTC Relationship Discovery * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gattc_relationships_discover(handle_range)"]; * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_REL_DISC_RSP {SUCCESS, includes}"]; * APP=>SD [label = "sd_ble_gattc_relationships_discover(handle_range + N)"]; * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_REL_DISC_RSP {SUCCESS, includes}"]; * APP=>SD [label = "sd_ble_gattc_relationships_discover(handle_range + N + M)"]; * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_REL_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; * @endmsc * * @defgroup BLE_GATTC_CHAR_DISC_MSC GATTC Characteristic Discovery * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gattc_characteristics_discover(handle_range)"]; * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_DISC_RSP {SUCCESS, chars}"]; * APP=>SD [label = "sd_ble_gattc_characteristics_discover(handle_range + N)"]; * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_DISC_RSP {SUCCESS, chars}"]; * APP=>SD [label = "sd_ble_gattc_characteristics_discover(handle_range + N + M)"]; * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; * @endmsc * * @defgroup BLE_GATTC_DESC_DISC_MSC GATTC Descriptor Discovery * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gattc_descriptors_discover(handle_range)"]; * APP<PEER [label = "ATT Find Information Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Find Information Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_DESC_DISC_RSP {SUCCESS, descs}"]; * APP=>SD [label = "sd_ble_gattc_descriptors_discover(handle_range + N)"]; * APP<PEER [label = "ATT Find Information Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Find Information Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_DESC_DISC_RSP {SUCCESS, descs}"]; * APP=>SD [label = "sd_ble_gattc_descriptors_discover(handle_range + N + M)"]; * APP<PEER [label = "ATT Find Information Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_DESC_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; * @endmsc * * @defgroup BLE_GATTC_READ_UUID_MSC GATTC Read Characteristic Value by UUID * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gattc_char_value_by_uuid_read(uuid, handle_range)"]; * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP {SUCCESS, char_values}"]; * APP=>SD [label = "sd_ble_gattc_char_value_by_uuid_read(uuid, handle_range + N)"]; * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP {SUCCESS, char_values}"]; * APP=>SD [label = "sd_ble_gattc_char_value_by_uuid_read(uuid, handle_range + N + M)"]; * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP {ATTRIBUTE_NOT_FOUND}"]; * @endmsc * * @defgroup BLE_GATTC_VALUE_READ_MSC GATTC Characteristic or Descriptor Value Read * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * --- [label = " Variant #1 offset == 0 "]; * |||; * APP=>SD [label = "sd_ble_gattc_read(handle, 0)"]; * APP<PEER [label = "ATT Read Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {SUCCESS, value}"]; * |||; * --- [label = " Variant #2 offset != 0 "]; * |||; * APP=>SD [label = "sd_ble_gattc_read(handle, offset)"]; * APP<PEER [label = "ATT Read Blob Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read Blob Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {SUCCESS, value}"]; * APP=>SD [label = "sd_ble_gattc_read(handle, offset + N)"]; * APP<PEER [label = "ATT Read Blob Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read Blob Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {SUCCESS, value}"]; * APP=>SD [label = "sd_ble_gattc_read(handle, offset + N + M + 1)"]; * APP<PEER [label = "ATT Read Blob Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Error Response: Invalid Offset", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {INVALID_OFFSET}"]; * @endmsc * * @defgroup BLE_GATTC_READ_MULT_MSC GATTC Read Multiple Characteristic Values * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * --- [label = " Variant #1 Successful request "]; * |||; * APP=>SD [label = "sd_ble_gattc_char_values_read(handles)"]; * APP<PEER [label = "ATT Read Multiple Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Read Multiple Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VALS_READ_RSP {SUCCESS, char_values}"]; * |||; * --- [label = " Variant #2 Failing request (invalid handle) "]; * |||; * APP=>SD [label = "sd_ble_gattc_char_values_read(handles)"]; * APP<PEER [label = "ATT Read Multiple Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Error Response: Invalid Handle", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VALS_READ_RSP {INVALID_HANDLE, error_handle=}"]; * @endmsc * * @defgroup BLE_GATTC_VALUE_WRITE_WITHOUT_RESP_MSC GATTC Characteristic Value Write Without Response * @msc * hscale = "2"; * APP,SD,PEER; * |||; * --- [label = " Variant #1 App does not keep track of the available queue element count for writes without responses "]; * APP note PEER [label = " This variant makes it possible for APP to transmit writes without responses without keeping track of the available queue element count. However, successful queuing of writes without responses cannot be guaranteed. "]; * |||; * APP=>SD [label = "sd_ble_enable()"]; * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_1)"]; * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_2)"]; * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_3)"]; * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_4)"]; * APP<PEER [label = "ATT Write Command {value_1}", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "ATT Write Command {value_2}", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "ATT Write Command {value_4}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 3}"]; * |||; * --- [label = " Variant #2 App keeps track of the available queue element count for writes without responses "]; * APP note PEER [label = " This variant makes it possible for APP to know when successful queuing of writes without responses is guaranteed. "]; * |||; * APP=>SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTC, gattc_conn_cfg.write_cmd_tx_queue_size = 2)"]; * APP<SD [label = "sd_ble_enable()"]; * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_1)"]; * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_2)"]; * APP<PEER [label = "ATT Write Command {value_1}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 1}"]; * APP abox APP [label="available_queue_element_count += 1"]; * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_3)"]; * APP<PEER [label = "ATT Write Command {value_2}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 1}"]; * APP abox APP [label="available_queue_element_count += 1"]; * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_4)"]; * APP<PEER [label = "ATT Write Command {value_3}", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "ATT Write Command {value_4}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 2}"]; * APP abox APP [label="available_queue_element_count += 2"]; * @endmsc * * @defgroup BLE_GATTC_VALUE_WRITE_MSC GATTC Characteristic or Descriptor Value Write * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_REQ, handle, value)"]; * APP<PEER [label = "ATT Write Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_WRITE_REQ, SUCCESS}"]; * @endmsc * * @defgroup BLE_GATTC_VALUE_LONG_WRITE_MSC GATTC Characteristic or Descriptor Value Long Write * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle, offset_1, value_1)"]; * APP<PEER [label = "ATT Prepare Write Request {handle, offset_1, value_1}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Response {handle, offset_1, value_1}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_1}"]; * |||; * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle, offset_2, value_2)"]; * APP<PEER [label = "ATT Prepare Write Request {handle, offset_2, value_2}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Response {handle, offset_2, value_2}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_2}"]; * |||; * ...; * |||; * --- [label = " Variant #1 App executes the Long Write procedure "]; * |||; * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_WRITE)"]; * APP<PEER [label = "ATT Execute Write Request: flags = 0x01", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; * |||; * --- [label = " Variant #2 App cancels the Long Write procedure "]; * |||; * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_CANCEL)"]; * APP<PEER [label = "ATT Execute Write Request: flags = 0x00", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; * @endmsc * * @defgroup BLE_GATTC_VALUE_RELIABLE_WRITE_MSC GATTC Characteristic or Descriptor Value Reliable Write * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle_1, offset, value_1)"]; * APP<PEER [label = "ATT Prepare Write Request {handle_1, offset, value_1}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Response {handle_1, offset, value_1}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_1}"]; * |||; * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle_2, offset, value_2)"]; * APP<PEER [label = "ATT Prepare Write Request {handle_2, offset, value_2}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Response {handle_2, offset, value_2}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_2}"]; * |||; * ...; * |||; * --- [label = " Variant #1 App executes the Reliable Write procedure "]; * |||; * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_WRITE)"]; * APP<PEER [label = "ATT Execute Write Request: flags = 0x01", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; * |||; * --- [label = " Variant #2 App cancels the Reliable Write procedure "]; * |||; * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_CANCEL)"]; * APP<PEER [label = "ATT Execute Write Request: flags = 0x00", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; * @endmsc * * @defgroup BLE_GATTC_HVI_MSC GATTC Handle Value Indication * GATTC Handle Value Indication MSC * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * SD<:PEER [label = "ATT Handle Value Indication", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_HVX {INDICATION, data}"]; * APP=>SD [label = "sd_ble_gattc_hv_confirm(handle)"]; * APP<PEER [label = "ATT Handle Value Confirmation", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GATTC_HVN_MSC GATTC Handle Value Notification * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * SD<:PEER [label = "ATT Handle Value Notification", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTC_EVT_HVX {NOTIFICATION, data}"]; * @endmsc * * @defgroup BLE_GATTC_TIMEOUT_MSC GATTC Timeout * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP rbox PEER [label="GATTC procedure API call"]; * SD:>PEER [label = "ATT Packet", textcolor="#000080", linecolor="#000080"]; * APP note PEER [label = "No Response from Peer"]; * |||; * ...; * |||; * SD box SD [label="Timeout"]; * APP<<=SD [label = "BLE_GATTC_EVT_TIMEOUT {source}"]; * APP rbox PEER [label="No additional ATT Traffic Allowed", textbgcolour="#ff7f7f"]; * APP=>SD [label = "Any GATT procedure API call"]; * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATT, gatt_conn_cfg.att_mtu=100)"]; * APP<SD [label = "sd_ble_enable()"]; * APP<SD [label = "sd_ble_gattc_exchange_mtu_request(conn_handle, client_rx_mtu=80)"]; * APP<PEER [label = "ATT Exchange MTU Request {client_rx_mtu=80}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Exchange MTU Response {server_rx_mtu=75}", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="att_mtu=75"]; * APP<<=SD [label = "BLE_GATTC_EVT_EXCHANGE_MTU_RSP {SUCCESS, server_rx_mtu=75}"]; * @endmsc * * @} * @} */ /** * @addtogroup BLE_GATTS * @{ * @defgroup BLE_GATTS_MSC Message Sequence Charts * @{ * @defgroup BLE_GATTS_ATT_TABLE_POP_MSC GATTS ATT Table Population * @msc * hscale = "1.5"; * APP,SD; * |||; * APP=>SD [label = "sd_ble_gatts_service_add(uuid#1)"]; * APP<SD [label = "sd_ble_gatts_characteristic_add(handle_srvc#1, char_md, value)"]; * APP<SD [label = "sd_ble_gatts_descriptor_add(handle_char#1, value)"]; * APP<SD [label = "sd_ble_gatts_descriptor_add(handle_char#1, value)"]; * APP<SD [label = "sd_ble_gatts_characteristic_add(handle_srvc#1, char_md, value)"]; * APP<SD [label = "sd_ble_gatts_descriptor_add(handle_char#2, value)"]; * APP<SD [label = "sd_ble_gatts_service_add(uuid#2)"]; * APP<SD [label = "sd_ble_gatts_include_add(handle_srvc#2, handle_srvc#1)"]; * APP<PEER [label = "ATT Read Response", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GATTS_WRITE_REQ_NO_AUTH_MSC GATTS Write Request without Authorization * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * SD rbox SD [label="Value in ATT Table: current_value"]; * SD<:PEER [label = "ATT Write Request {peer_value}", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="Value in ATT Table: peer_value"]; * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {WRITE_REQ, auth_required=0, peer_value}"]; * @endmsc * * @defgroup BLE_GATTS_WRITE_CMD_NO_AUTH_MSC GATTS Write Command Without Authorization * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * SD rbox SD [label="Value in ATT Table: current_value"]; * SD<:PEER [label = "ATT Write Command {peer_value}", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="Value in ATT Table: peer_value"]; * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {WRITE_CMD, auth_required=0, peer_value}"]; * @endmsc * * @defgroup BLE_GATTS_WRITE_CMD_AUTH_MSC GATTS Write Command With Authorization * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * SD rbox SD [label="Value in ATT Table: current_value"]; * SD<:PEER [label = "ATT Write Command {peer_value}", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="Value in ATT Table: current_value"]; * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {WRITE_CMD, auth_required=1, peer_value}"]; * --- [label = " Variant #1 App Authorizes "]; * APP=>SD [label = "sd_ble_gatts_value_set(peer_value)"]; * APP<SD [label = "sd_ble_gatts_value_set(app_value)"]; * APP<SD [label = "sd_ble_gatts_rw_authorize_reply(SUCCESS, app_value)"]; * APP<PEER [label = "ATT Read Response {app_value}", textcolor="#000080", linecolor="#000080"]; * --- [label = " Variant #2 App Disallows "]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(READ_NOT_PERMITTED)"]; * APP<PEER [label = "ATT Error Response", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GATTS_WRITE_REQ_AUTH_MSC GATTS Write Request with Authorization * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * SD rbox SD [label="Value in ATT Table: current_value"]; * SD<:PEER [label = "ATT Write Request {peer_value}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, peer_value}"]; * --- [label = " Variant #1 App Authorizes "]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(SUCCESS, peer_value)"]; * APP<PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; * --- [label = " Variant #2 App Authorizes but changes value "]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(SUCCESS, app_value)"]; * APP<PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; * --- [label = " Variant #3 App Disallows "]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE_NOT_PERMITTED)"]; * APP<PEER [label = "ATT Error Response", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GATTS_QUEUED_WRITE_BUF_NOAUTH_MSC GATTS Queued Writes: Stack handled, no attributes require authorization * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #1 Attribute Values validation passed "]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_NOW}"]; * APP rbox APP [label="App parses the memory it provided"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; * |||; * --- [label = " Variant #2 Attribute Values validation failed "]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * SD:>PEER [label = "ATT Error Response {Invalid Value Length / Offset}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; * |||; * @endmsc * * @defgroup BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC GATTS Queued Writes: Stack handled, one or more attributes require authorization * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; * |||; * --- [label = " Variant #1 App Authorizes both Prepare Write and Execute Write"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; * APP rbox APP [label="App parses the memory it provided"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; * |||; * --- [label = " Variant #2 App Disallows Prepare Write and Authorizes Execute Write "]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, INSUF_AUTHORIZATION)"]; * SD:>PEER [label = "ATT Error Response {Insufficient Authorization}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; * APP rbox APP [label="App parses the memory it provided"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; * |||; * --- [label = " Variant #3 App Authorizes Prepare Write and Disallows Execute Write "]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; * APP rbox APP [label="App parses the memory it provided"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, APP_ERROR_CODE)"]; * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * SD:>PEER [label = "ATT Error Response {APP_ERROR_CODE}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; * @endmsc * * @defgroup BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC GATTS Queued Writes: App handled, no attributes require authorization * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; * |||; * --- [label = " Variant #1 Attribute values in stack memory (VLOC_STACK), attribute values validation passed "]; * APP=>SD [label = "sd_ble_gatts_value_set {handle_1, offset_1, peer_value_1}"]; * APP<SD [label = "sd_ble_gatts_value_set {handle_2, offset_2, peer_value_2}"]; * APP<SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #2 Attribute values in user memory (VLOC_USER), attribute values validation passed "]; * APP rbox APP [label="Application traverses its queue and executes the write operations (memcpy)"]; * APP rbox APP [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #3 Attribute values validation failed "]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, INVALID_OFFSET)"]; * APP rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * SD:>PEER [label = "ATT Error Response {Invalid Offset}", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC GATTS Queued Writes: App handled, one or more attributes require authorization * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP rbox APP [label="Values in ATT Table in user memory (VLOC_USER):\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; * |||; * --- [label = " Variant #1 App Authorizes both Prepare Write and Execute Write"]; * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; * APP rbox APP [label="Application traverses its queue and executes the write operations (memcpy)"]; * APP rbox APP [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #2 App Disallows Prepare Write and Authorizes Execute Write "]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, INSUF_AUTHORIZATION)"]; * SD:>PEER [label = "ATT Error Response {Insufficient Authorization}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; * APP rbox APP [label="Application traverses its queue and executes the write operations (memcpy)"]; * APP rbox APP [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #3 App Authorizes Prepare Write and Disallows Execute Write "]; * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, APP_ERROR_CODE)"]; * APP rbox APP [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * SD:>PEER [label = "ATT Error Response {APP_ERROR_CODE}", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC GATTS Queued Writes: Peer cancels operation * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; * |||; * --- [label = " Variant #1 Stack handled "]; * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Request {CANCEL}", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; * |||; * --- [label = " Variant #2 App handled "]; * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Request {CANCEL}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_CANCEL}"]; * APP rbox APP [label="App erases queue"]; * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * |||; * @endmsc * * @defgroup BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC GATTS Queued Writes: Prepare Queue Full * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; * |||; * --- [label = " Variant #1 Stack handled "]; * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "ATT Error Response {Prepare Queue Full}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_NOW}"]; * APP rbox APP [label="App parses the memory it provided"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; * |||; * --- [label = " Variant #2 App handled "]; * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, PREPARE_QUEUE_FULL)"]; * SD:>PEER [label = "ATT Error Response {Prepare Queue Full}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; * APP=>SD [label = "sd_ble_gatts_value_set {handle_1, offset_1, peer_value_1}"]; * APP<SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GATTS_QUEUED_WRITE_EXECUTE_WITHOUT_PREPARE_MSC GATTS Queued Writes: Execute Write without Prepare Write * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * |||; * SD rbox SD [label="No ATT Prepare Write Request has been received by SD"]; * |||; * --- [label = " Variant #1 Write cancelled "]; * SD<:PEER [label = "ATT Execute Write Request {CANCEL}", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_CANCEL}"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * |||; * --- [label = " Variant #2 Write now "]; * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_NOW}"]; * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GATTS_MTU_EXCHANGE GATTS ATT_MTU Exchange * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP=>SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATT, gatt_conn_cfg.att_mtu=100)"]; * APP<SD [label = "sd_ble_enable()"]; * APP<SD [label = "sd_ble_gatts_exchange_mtu_reply(conn_handle, server_rx_mtu=75)"]; * APP<PEER [label = "ATT Exchange MTU Response {server_rx_mtu=75}", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="att_mtu=75"]; * @endmsc * * @defgroup BLE_GATTS_HVI_MSC GATTS Handle Value Indication * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP rbox PEER [label="Indications Enabled in CCCD"]; * |||; * SD rbox SD [label="Value in ATT Table: current_value"]; * APP=>SD [label = "sd_ble_gatts_hvx(INDICATION, app_value)"]; * APP<PEER [label = "ATT Handle Value Indication {app_value}", textcolor="#000080", linecolor="#000080"]; * --- [label = " Variant #1 Peer Confirms "]; * SD<:PEER [label = "ATT Handle Value Confirmation", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_HVC"]; * --- [label = " Variant #2 Peer Ignores "]; * |||; * ...; * |||; * SD box SD [label="Timeout"]; * APP<<=SD [label = "BLE_GATTS_EVT_TIMEOUT"]; * @endmsc * * @defgroup BLE_GATTS_HVN_MSC GATTS Handle Value Notification * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * --- [label = " Variant #1 App does not keep track of the available queue element count for notifications "]; * APP note PEER [label = " This variant makes it possible for APP to transmit notifications without keeping track of the available queue element count. However, successful queuing of notifications cannot be guaranteed. "]; * |||; * APP=>SD [label = "sd_ble_enable()"]; * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_1)"]; * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_2)"]; * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_3)"]; * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_4)"]; * APP<PEER [label = "ATT Handle Value Notification {app_value_1}", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "ATT Handle Value Notification {app_value_2}", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "ATT Handle Value Notification {app_value_4}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {3}"]; * |||; * --- [label = " Variant #2 App keeps track of the available queue element count for notifications "]; * APP note PEER [label = " This variant makes it possible for APP to know when successful queuing of notifications is guaranteed. "]; * |||; * APP=>SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTS, gatts_conn_cfg.hvn_tx_queue_size=2)"]; * APP<SD [label = "sd_ble_enable()"]; * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_1)"]; * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_2)"]; * APP<PEER [label = "ATT Handle Value Notification {app_value_1}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {1}"]; * APP abox APP [label="available_queue_element_count += 1"]; * APP=>SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_3)"]; * APP<PEER [label = "ATT Handle Value Notification {app_value_2}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {1}"]; * APP abox APP [label="available_queue_element_count += 1"]; * APP=>SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_4)"]; * APP<PEER [label = "ATT Handle Value Notification {app_value_3}", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "ATT Handle Value Notification {app_value_4}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {2}"]; * APP abox APP [label="available_queue_element_count += 2"]; * @endmsc * * @defgroup BLE_GATTS_HVX_DISABLED_MSC GATTS Handle Value Indication or Notification disabled * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP rbox PEER [label="Indications and Notifications Disabled in CCCD"]; * |||; * SD rbox SD [label="Value in ATT Table: current_value"]; * APP=>SD [label = "sd_ble_gatts_hvx(INDICATION or NOTIFICATION, app_value)"]; * APP<SD [label = "sd_ble_gatts_hvx(INDICATION or NOTIFICATION, app_value)"]; * APP<SD [label = "sd_ble_gatts_sys_attr_set()"]; * APP<SD [label = "sd_ble_gatts_service_changed(N, M)"]; * APP<PEER [label = "ATT Handle Value Indication {N, M}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "ATT Handle Value Confirmation", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_SC_CONFIRM"]; * |||; * SD rbox PEER [label="Service Discovery"]; * @endmsc * * @defgroup BLE_GATTS_SYS_ATTRS_UNK_PEER_MSC GATTS System Attributes Handling: Unknown Peer * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established with an Unknown Peer"]; * |||; * SD<:PEER [label = "ATT Read Request {sys_attr_handle}", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GATTS_EVT_SYS_ATTR_MISSING"]; * APP=>SD [label = "sd_ble_gatts_sys_attr_set(NULL)"]; * APP<PEER [label = "ATT Read Response {sys_attr_value}", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC GATTS System Attributes Handling: Bonded Peer * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established with a Bonded Peer"]; * |||; * APP rbox PEER [label="ATT Traffic"]; * |||; * APP rbox PEER [label="Connection Terminated"]; * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {reason}"]; * |||; * APP=>SD [label = "sd_ble_gatts_sys_attr_get()"]; * APP<SD [label = "sd_ble_gatts_sys_attr_set(sys_attr_data)"]; * APP<PEER [label = "ATT Read Response {sys_attr_value}", textcolor="#000080", linecolor="#000080"]; * @endmsc * * @defgroup BLE_GATTS_TIMEOUT_MSC GATTS Timeout * @msc * hscale = "2"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP rbox PEER [label="GATTS procedure API call"]; * SD:>PEER [label = "ATT Packet", textcolor="#000080", linecolor="#000080"]; * APP note PEER [label = "No Response from Peer"]; * |||; * ...; * |||; * SD box SD [label="Timeout"]; * APP<<=SD [label = "BLE_GATTS_EVT_TIMEOUT {source}"]; * APP rbox PEER [label="No additional ATT Traffic Allowed", textbgcolour="#ff7f7f"]; * APP=>SD [label = "Any GATT procedure API call"]; * APP< * Queued Write * * Parameter * Size (octets) * Description * * * Handle * 2 * Attribute Handle * * * Offset * 2 * Value Offset * * * Length * 2 * Value Length * * * Value * Length * Attribute Value * * * * The application can parse the array of Queued Write instances at any time, but it is recommended to do so whenever an Execute Write ATT packet * has been received over the air. See the GATT Server Queued Writes MSCs for more details. * The array will be terminated by an Queued Write instance with its handle set to @ref BLE_GATT_HANDLE_INVALID. * @} */ /** * @addtogroup BLE_GATTS_SYS_ATTRS_FORMAT User memory layout for System Attributes * @{ * The following table shows the memory layout used by the SoftDevice to store a * system attribute. * * * * * * * * * * * * * * * * * * * * * * * *
System Attribute
ParameterSize (octets)Description
Handle2Attribute handle
Length2Attribute length
DataLengthAttribute data
* * The application can obtain an array of system attributes by using @c sd_ble_gatts_sys_attr_get(). * The array is terminated by a CRC-16-CCITT checksum of the data in the array. * @} * @} */ /** * @addtogroup BLE_L2CAP * @{ * @defgroup BLE_L2CAP_MSC Message Sequence Charts * @{ * @defgroup BLE_L2CAP_CH_SETUP_MSC L2CAP Channel Setup * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * --- [label = " Variant #1 Locally initiated, Establishment success "]; * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid=INVALID, le_psm, rx_mtu, rx_mps, sdu_buf: [len, p_data1])"]; * APP<PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "L2CAP LE Credit Based Connection Response: Connection successful", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP {conn_handle, local_cid, tx_mtu, tx_mps, credits}"]; * |||; * APP rbox PEER [label="L2CAP Channel Established"]; * |||; * --- [label = " Variant #2 Locally initiated, Establishment failure - PEER refusal "]; * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid=INVALID, le_psm, rx_mtu, rx_mps, sdu_buf: [len, p_data1])"]; * APP<PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "L2CAP LE Credit Based Connection Response: Connection refused - no resources available", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf: [len, p_data1]}"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REFUSED {conn_handle, local_cid, source: REMOTE, status: NO_RESOURCES}"]; * |||; * APP rbox PEER [label="L2CAP Channel NOT Established"]; * |||; * --- [label = " Variant #3 Locally initiated, Establishment failure - PEER does not respond "]; * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid=INVALID, le_psm, rx_mtu, rx_mps, sdu_buf: p_data=NULL)"]; * APP<PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; * SD abox SD [label="Timeout"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REFUSED {conn_handle, local_cid, source: LOCAL, status: TIMEOUT}"]; * |||; * APP rbox PEER [label="L2CAP Channel NOT Established"]; * |||; * --- [label = " Variant #4 Remotely initiated, Establishment success "]; * SD<:PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REQUEST {conn_handle, local_cid, le_psm, tx_mtu, tx_mps, credits}"]; * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid, rx_mtu, rx_mps, sdu_buf: [len, p_data1], status: SUCCESS)"]; * APP<PEER [label = "L2CAP LE Credit Based Connection Response: Connection successful", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox PEER [label="L2CAP Channel Established"]; * |||; * --- [label = " Variant #5 Remotely initiated, Establishment failure - APP refusal "]; * SD<:PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REQUEST {conn_handle, local_cid, le_psm, tx_mtu, tx_mps, credits}"]; * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid, status: LE_PSM_NOT_SUPPORTED)"]; * APP<PEER [label = "L2CAP LE Credit Based Connection Response: Connection refused - LE_PSM not supported", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox PEER [label="L2CAP Channel NOT Established"]; * |||; * --- [label = " Variant #6 Remotely initiated, Establishment failure - SD refusal "]; * SD<:PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="The limit of available L2CAP channels has been reached"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REFUSED {conn_handle, local_cid=INVALID, source: LOCAL, status: NO_RESOURCES}"]; * SD:>PEER [label = "L2CAP LE Credit Based Connection Response: Connection refused - no resources available", textcolor="#000080", linecolor="#000080"]; * |||; * APP rbox PEER [label="L2CAP Channel NOT Established"]; * |||; * @endmsc * * @defgroup BLE_L2CAP_CH_RELEASE_MSC L2CAP Channel Release * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP rbox PEER [label="Connection Established"]; * |||; * APP rbox PEER [label="L2CAP Channel Established"]; * |||; * --- [label = " Variant #1 Locally initiated, PEER responds "]; * APP=>SD [label = "sd_ble_l2cap_ch_release(conn_handle, local_cid)"]; * APP<PEER [label = "L2CAP Disconnection Request", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "L2CAP Disconnection Response", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="SD currently has three SDU data buffers supplied by APP"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf1}"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf2}"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf3}"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RELEASED {conn_handle, local_cid}"]; * |||; * --- [label = " Variant #2 Locally initiated, PEER does not respond "]; * APP=>SD [label = "sd_ble_l2cap_ch_release(conn_handle, local_cid)"]; * APP<PEER [label = "L2CAP Disconnection Request", textcolor="#000080", linecolor="#000080"]; * SD abox SD [label="Timeout"]; * SD rbox SD [label="SD does not currently have SDU data buffers supplied by APP"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RELEASED {conn_handle, local_cid}"]; * |||; * --- [label = " Variant #3 Remotely initiated "]; * SD<:PEER [label = "L2CAP Disconnection Request", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="SD does not currently have SDU data buffers supplied by APP"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RELEASED {conn_handle, local_cid}"]; * SD:>PEER [label = "L2CAP Disconnection Response", textcolor="#000080", linecolor="#000080"]; * |||; * @endmsc * * @defgroup BLE_L2CAP_CH_TX_MSC L2CAP Channel SDU Transmit * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * --- [label = " Variant #1 App ignores transmit credits, SD will transmit data as soon as possible "]; * APP rbox PEER [label="L2CAP Channel Established, tx_queue_size=2, tx_mps=100, credits=2"]; * |||; * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=140, p_data1])"]; * APP<SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=80, p_data2])"]; * APP<SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=280, p_data3])"]; * APP<PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=140, p_data1]}"]; * APP abox APP [label="App releases memory pointed by p_data1"]; * SD rbox SD [label="All credits consumed"]; * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=280, p_data3])"]; * APP<PEER [label = "SDU 2, Segment 1", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=80, p_data2]}"]; * APP abox APP [label="App releases memory pointed by p_data2"]; * SD:>PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; * SD rbox SD [label="All credits consumed"]; * ...; * SD<:PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_CREDIT {conn_handle, local_cid, credits=2}"]; * SD:>PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=280, p_data3]}"]; * APP abox APP [label="App releases memory pointed by p_data3"]; * |||; * --- [label = " Variant #2 App keeps track of transmission credits and transmits only if credits are available "]; * APP rbox PEER [label="L2CAP Channel Established, tx_queue_size=2, tx_mps=100, credits=2"]; * APP abox APP [label="available_credits = 2"]; * |||; * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=140, p_data1])"]; * APP<PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=140, p_data1]}"]; * APP abox APP [label="App releases memory pointed by p_data1"]; * ...; * SD<:PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_CREDIT {conn_handle, local_cid, credits=2}"]; * APP abox APP [label="available_credits += 2\n// available_credits == 2"]; * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=80, p_data2])"]; * APP<SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=280, p_data3])"]; * APP<PEER [label = "SDU 2, Segment 1", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=80, p_data2]}"]; * APP abox APP [label="App releases memory pointed by p_data2"]; * SD:>PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; * ...; * SD<:PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_CREDIT {conn_handle, local_cid, credits=2}"]; * APP abox APP [label="available_credits += 2\n// available_credits == 0"]; * SD:>PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=280, p_data3]}"]; * APP abox APP [label="App releases memory pointed by p_data3"]; * |||; * @endmsc * * @defgroup BLE_L2CAP_CH_RX_MSC L2CAP Channel SDU Receive * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP=>SD [label = "sd_ble_l2cap_ch_setup(rx_mtu=1000, rx_mps=100, sdu_buf: [len=1000, p_data1])"]; * APP<PEER [label = "L2CAP LE Credit Based Connection Request (Initial Credits=1)", textcolor="#000080", linecolor="#000080"]; * APP rbox PEER [label="L2CAP Channel Established, rx_queue_size=2, rx_mtu=1000, rx_mps=100"]; * |||; * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data2])"]; * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; * PEER rbox PEER [label="1 credit left"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=140, sdu_buf: [len=1000, p_data1]}"]; * APP abox APP [label="App can process data and release memory pointed by p_data1"]; * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data3])"]; * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 2, Segment 1", textcolor="#000080", linecolor="#000080"]; * PEER rbox PEER [label="1 credit left"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=80, sdu_buf: [len=1000, p_data2]}"]; * APP abox APP [label="App can process data and release memory pointed by p_data2"]; * SD<:PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; * PEER rbox PEER [label="All credits consumed"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=280, sdu_buf: [len=1000, p_data3]}"]; * APP abox APP [label="App can process data and release memory pointed by p_data3"]; * |||; * @endmsc * * @defgroup BLE_L2CAP_CH_FLOW_CONTROL_MSC L2CAP Channel advanced SDU reception flow control * @msc * hscale = "1.5"; * APP,SD,PEER; * |||; * APP=>SD [label = "sd_ble_l2cap_ch_setup(rx_mtu=1000, rx_mps=100, sdu_buf: p_data=NULL)"]; * APP<PEER [label = "L2CAP LE Credit Based Connection Request (Initial Credits=0)", textcolor="#000080", linecolor="#000080"]; * APP rbox PEER [label="L2CAP Channel Established, rx_queue_size=2, rx_mtu=1000, rx_mps=100"]; * |||; * --- [label = " Variant #1 App overwrites number of credits peer should have at the start of a SDU "]; * APP=>SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=8)"]; * APP<SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data1])"]; * APP<PEER [label = "LE Flow Control Credit (credits=8)", textcolor="#000080", linecolor="#000080"]; * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data2])"]; * APP<PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; * PEER rbox PEER [label="8 credits left"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=140, sdu_buf: [len=1000, p_data1]}"]; * APP abox APP [label="App can process data and release memory pointed by p_data1"]; * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data3])"]; * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; * PEER rbox PEER [label="8 credits left"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=80, sdu_buf: [len=1000, p_data2]}"]; * APP abox APP [label="App can process data and release memory pointed by p_data2"]; * SD<:PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; * PEER rbox PEER [label="5 credits left"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=280, sdu_buf: [len=1000, p_data3]}"]; * APP abox APP [label="App can process data and release memory pointed by p_data3"]; * APP rbox APP [label="Peer has credits remaining so application must provide new reception buffer as soon as possible."]; * |||; * --- [label = " Variant #2 App pauses traffic on a L2CAP Channel "]; * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data1])"]; * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data2])"]; * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; * PEER rbox PEER [label="1 credit left"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=140, sdu_buf: [len=1000, p_data1]}"]; * APP abox APP [label="App can process data and release memory pointed by p_data1"]; * APP=>SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=0)"]; * APP<SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data3])"]; * APP<SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=0)"]; * APP<SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=BLE_L2CAP_CREDITS_DEFAULT)"]; * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; * SD:>PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; * PEER rbox PEER [label="All credits consumed"]; * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=280, sdu_buf: [len=1000, p_data3]}"]; * APP abox APP [label="App can process data and release memory pointed by p_data3"]; * |||; * @endmsc * @} * @} */