/**
 * @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 = "NRF_SUCCESS"];
 * |||;
 * --- [label = " Determine the region of memory required by the SoftDevice"];
 * APP rbox APP [label="Set enable_params to the required settings"];
 * APP rbox APP [label="Set *p_app_ram_base to 0x00000000"];
 * APP=>SD [label = "sd_ble_enable(p_enable_params, p_app_ram_base);"];
 * APP<<SD [label = "NRF_ERROR_DATA_SIZE"];
 * APP rbox APP [label="*p_app_ram_base filled by the SoftDevice with 0x2000xxxx"];
 * @endmsc
 * @msc
 * hscale = "1.5";
 * APP,SD;
 * |||;
 * APP abox APP [label="App sets 0x2000xxxx as its RAM starting point and rebuilds", textbgcolor="#7fff7f"];
 * |||;
 * APP=>SD [label = "sd_softdevice_enable(clock, assertion_handler);"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * --- [label = " Enable the BLE Stack."];
 * APP rbox APP [label="Set enable_params to the required settings"];
 * APP rbox APP [label="Set *p_app_ram_base to 0x2000xxxx"];
 * APP=>SD [label = "sd_ble_enable(p_enable_params, p_app_ram_base);"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * @endmsc
 * @}
 *
 * @defgroup BLE_COMMON_CONF_BW Connection Bandwidth Configuration
 * @{
 * @msc
 * hscale = "1.5";
 * APP,SD;
 * |||;
 * APP=>SD [label = "sd_softdevice_enable(clock, assertion_handler);"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * --- [label = " Configure the memory pools available for application packets"];
 * APP rbox APP [label="Configure conn_bw_counts in enable_params (along with others)"];
 * APP=>SD [label = "sd_ble_enable(p_enable_params, p_app_ram_base);"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * @endmsc
 * @msc
 * hscale = "1.5";
 * APP,SD;
 * |||;
 * --- [label = " Configure the bandwidth for each connection"];
 * APP rbox APP [label="Set the conn_bw in common_opt to the desired bandwidth configuration "];
 * APP=>SD [label = "sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, p_opt);"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_gap_adv_start(params);"];
 * SD rbox SD [label="The bandwidth configuration is set"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * APP rbox APP [label="Configure bandwidth if different from the currently active one"];
 * APP=>SD [label = "sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, p_opt);"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_gap_connect(params);"];
 * SD rbox SD [label="The bandwidth configuration is set"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * APP note SD [label = " A connection cannot be established if the bandwidth configuration requires more memory than what's left of the initial configuration"];
 * |||;
 * --- [label = " Configure bandwidth that cannot be satisfied by the remaining memory pool"];
 * |||;
 * APP=>SD [label = "sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, p_opt);"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_gap_connect(params);"];
 * SD rbox SD [label="Not enough memory for the requested bandwidth configuration"];
 * APP<<SD [label = "NRF_ERROR_NO_MEM"];
 * @endmsc
 * @}
 * @defgroup BLE_COMMON_IRQ_EVT_MSC Interrupt-driven Event Retrieval
 * @msc
 * hscale = "1.5";
 * APP,SD;
 * |||;
 * APP=>SD [label = "sd_softdevice_enable(clock, assertion_handler);"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_nvic_EnableIRQ(SD_EVT_IRQn)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * APP rbox SD [label="Application runs and uses SD API"];
 * |||;
 * SD rbox SD [label="Event Available for the App"];
 * |||;
 * APP<-SD [label = "SD_EVT_IRQn", textcolor="#800080", linecolor="#800080"];
 * APP=>APP [label = "SD_EVT_IRQHandler()"];
 * APP=>SD [label = "sd_ble_evt_get(buffer);"];
 * APP<<SD [label = "{NRF_SUCCESS, event}"];
 * |||;
 * @endmsc
 *
 * @defgroup BLE_COMMON_THREAD_EVT_MSC Thread Mode Event Retrieval
 * @msc
 * hscale = "1.5";
 * APP,SD;
 * |||;
 * APP=>SD [label = "sd_softdevice_enable(clock, assertion_handler);"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * 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 = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_evt_get(buffer);"];
 * APP<<SD [label = "{NRF_SUCCESS, event}"];
 * 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 = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_evt_get(buffer);"];
 * APP<<SD [label = "{NRF_SUCCESS, event}"];
 * APP=>SD [label = "sd_app_evt_wait(void);"];
 * APP rbox APP [label="App Thread Mode blocked, CPU in low power mode"];
 * |||;
 * ...;
 * |||;
 * @endmsc
 *
 * @defgroup BLE_COMMON_APP_BUFF_MSC App TX Packet Management
 * @msc
 * hscale = "1.5";
 * APP,SD,PEER;
 * |||;
 * APP rbox PEER [label="Connection Established"];
 * |||;
 * APP=>SD [label = "sd_ble_tx_packet_count_get(conn_handle);"];
 * APP<<SD [label = "{NRF_SUCCESS, N}"];
 * APP rbox APP [label="available = N"];
 * |||;
 * APP=>SD [label = "sd_ble_gattc_write(conn_handle, value)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP rbox APP [label="available--"];
 * SD:>PEER [label = "ATT Write Command", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_EVT_TX_COMPLETE {1}"];
 * APP rbox APP [label="available += 1"];
 * |||;
 * ...;
 * |||;
 * APP abox APP [label="available >= 2 \n\n successful queuing of a transmission is guaranteed for at least two packets"];
 * |||;
 * APP=>SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP rbox APP [label="available--"];
 * SD:>PEER [label = "ATT Handle Value Notification", textcolor="#000080", linecolor="#000080"];
 * APP=>SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP rbox APP [label="available--"];
 * SD:>PEER [label = "ATT Handle Value Notification", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_EVT_TX_COMPLETE {2}"];
 * APP rbox APP [label="available += 2"];
 * |||;
 * ...;
 * |||;
 * APP abox APP [label="available == 0 \n\n successful queuing of a transmission is not guaranteed anymore"];
 * |||;
 * APP=>SD [label = "sd_ble_gattc_write(conn_handle, value)"];
 * APP<<SD [label = "BLE_ERROR_NO_TX_PACKETS"];
 * APP abox APP [label="available unchanged"];
 * |||;
 * APP=>SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP rbox APP [label="available--"];
 * SD:>PEER [label = "ATT Handle Value Notification", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_EVT_TX_COMPLETE {1}"];
 * APP rbox APP [label="available += 1"];
 * |||;
 * ...;
 * |||;
 * APP rbox PEER [label="Terminate Connection"];
 * |||;
 * APP abox APP [label="available is not valid anymore"];
 * |||;
 * @endmsc
 * @}
 * @}
 */

/**
 * @addtogroup BLE_GAP 
 * @{
 * @defgroup BLE_GAP_MSC Message Sequence Charts
 * @{
 * @defgroup BLE_GAP_ADV_MSC Advertising
 * @msc
 * hscale = "1.5";
 * APP,SD,SCANNERS;
 * |||;
 * APP=>SD [label = "sd_ble_gap_address_set(addr)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_gap_adv_data_set(adv, sr)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_gap_adv_start(params)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD->SCANNERS [label = "ADV packet", textcolor="#000080", linecolor="#000080"];
 * SD->SCANNERS [label = "ADV packet", textcolor="#000080", linecolor="#000080"];
 * SD->SCANNERS [label = "ADV packet", textcolor="#000080", linecolor="#000080"];
 * ...;
 * SD->SCANNERS [label = "ADV packet", textcolor="#000080", linecolor="#000080"];
 * |||;
 * --- [label = " Variant #1 App Stops Advertisement "];
 * APP=>SD [label = "sd_ble_gap_adv_stop()"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * --- [label = " Variant #2 Advertisement Timeout "];
 * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT"];
 * @endmsc
 *
 * @defgroup BLE_GAP_CONN_MSC Peripheral Connection Establishment and Termination
 * @msc
 * hscale = "1.5";
 * APP,SD,CENTRAL;
 * |||;
 * APP rbox CENTRAL [label="Start Connectable Advertising"];
 * |||;
 * SD<:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>CENTRAL [label = "L2CAP CPU Request", textcolor="#000080", linecolor="#000080"];
 * |||;
 * --- [label = " Variant #1 Central Accepts "];
 * |||;
 * SD<:CENTRAL [label = "L2CAP CPU Response: Accepted", textcolor="#000080", linecolor="#000080"];
 * |||;
 * SD<:CENTRAL [label = "Connection Update Start", textcolor="#000080", linecolor="#000080"];
 * SD:>CENTRAL [label = "Connection Update Complete", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#2}"];
 * |||;
 * --- [label = " Variant #2 Central Rejects "];
 * |||;
 * SD<:CENTRAL [label = "L2CAP CPU 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 = "NRF_SUCCESS"];
 * |||;
 * SD<-PEER [label = "RSSI Sample", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_RSSI_CHANGED {RSSI#1}"];
 * |||;
 * SD<-PEER [label = "RSSI Sample", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_RSSI_CHANGED {RSSI#2}"];
 * |||;
 * SD<-PEER [label = "RSSI Sample", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_RSSI_CHANGED {RSSI#3}"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_rssi_stop()"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * --- [label = " Variant #2: Only trigger event if RSSI changes by 5 dBm or more."];
 * |||;
 * APP=>SD [label = "sd_ble_gap_rssi_start(conn_handle, 0x05, 0x00)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD<-PEER [label = "RSSI Sample=0x00", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_RSSI_CHANGED {RSSI#1}"];
 * |||;
 * SD<-PEER [label = "RSSI Sample=0x04", textcolor="#000080", linecolor="#000080"];
 * |||;
 * SD<-PEER [label = "RSSI Sample=0x03", textcolor="#000080", linecolor="#000080"];
 * |||;
 * SD<-PEER [label = "RSSI Sample>=0x05", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_RSSI_CHANGED {RSSI#2}"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_rssi_stop()"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * --- [label = " Variant #3: Only trigger event if more than 3 RSSI samples have deviated from the last reported RSSI by 5 dBm or more."];
 * |||;
 * APP=>SD [label = "sd_ble_gap_rssi_start(conn_handle, 0x05, 0x03)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD<-PEER [label = "RSSI Sample=0x00", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_RSSI_CHANGED {RSSI#1}"];
 * |||;
 * SD<-PEER [label = "RSSI Sample=0x04", textcolor="#000080", linecolor="#000080"];
 * |||;
 * SD<-PEER [label = "RSSI Sample=0x0A", textcolor="#000080", linecolor="#000080"];
 * |||;
 * SD<-PEER [label = "RSSI Sample>=0x06", textcolor="#000080", linecolor="#000080"];
 * |||;
 * SD<-PEER [label = "RSSI Sample>=0x09", textcolor="#000080", linecolor="#000080"];
 * |||;
 * SD<-PEER [label = "RSSI Sample>=0x07", textcolor="#000080", linecolor="#000080"];
 * |||;
 * APP<<=SD [label = "BLE_GAP_EVT_RSSI_CHANGED {RSSI#2}"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_rssi_stop()"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * @endmsc
 *
 * @defgroup BLE_GAP_CENTRAL_RSSI_READ_MSC RSSI get sample
 * @msc
 * hscale = "1.5";
 * APP,SD,PEER;
 * |||;
 * APP rbox PEER [label="Connection Established"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi)"];
 * APP<<SD [label = "NRF_ERROR_INVALID_STATE"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_rssi_start(conn_handle, BLE_GAP_RSSI_THRESHOLD_INVALID, 0x00)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi)"];
 * APP<<SD [label = "NRF_ERROR_NOT_FOUND"];
 * ...;
 * ...;
 * APP rbox PEER [label="Connection events"];
 * ...;
 * ...;
 * |||;
 * SD<-PEER [label = "RSSI Sample=0x03 [dBm]", textcolor="#000080", linecolor="#000080"];
 * APP=>SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi)"];
 * APP<<SD [label = "NRF_SUCCESS, *p_rssi=0x03 [dBm]"];
 * APP=>SD [label = "sd_ble_gap_rssi_stop()"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * @endmsc
 *
 * @defgroup BLE_GAP_PERIPH_SEC_MSC Peripheral Security Procedures
 * @{
 *
 * @defgroup BLE_GAP_PERIPH_SEC_REQ_MSC Peripheral Security Request
 * @msc
 * hscale = "1.5";
 * APP,SD,CENTRAL;
 * |||;
 * APP rbox CENTRAL [label="Connection Established"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_authenticate(params)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>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_TIMEOUT {error_src: BLE_GAP_TIMEOUT_SRC_SECURITY_REQUEST}"];
 * |||;
 * @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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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 = "NRF_SUCCESS"];
 * |||;
 * 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_STATIC_PK_MSC Bonding: Passkey Entry with static passkey
 * @msc
 * hscale = "2";
 * APP,SD,CENTRAL;
 * |||;
 * 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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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 = "NRF_SUCCESS"];
 * |||;
 * 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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: num comp failure, error_src: local}"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"];
 * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"];
 * |||;
 * --- [label = ""];
 * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * 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<<SD [label = "NRF_SUCCESS"];
 * SD:>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_address_set(addr)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_gap_lesc_oob_data_get(p_pk_own, p_oobd_own)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP abox CENTRAL [label="OOB communication: oobd_own sent and/or oobd_peer received", textbgcolor="silver"];
 * |||;
 * 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, oob}"];
 * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, oob, keyset with p_pk_own)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD:>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 = "NRF_SUCCESS"];
 * |||;
 * 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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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(<code from application>)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: <code from application>, 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<<SD [label = "NRF_SUCCESS"];
 * SD:>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: <remote_reason>, 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<<SD [label = "NRF_SUCCESS"];
 * SD:>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", 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<<SD [label = "NRF_SUCCESS"];
 * SD:>CENTRAL [label = "LL Encryption Response", 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<<SD [label = "NRF_SUCCESS"];
 * SD:>CENTRAL [label = "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<<SD [label = "NRF_SUCCESS"];
 * SD:>CENTRAL [label = "LL Encryption Response", textcolor="#000080", linecolor="#000080"];
 * SD<:CENTRAL [label = "Connection Termination", textcolor="#000080", linecolor="#000080"];
 * APP rbox CENTRAL [label = "Link Terminated"];
 * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {MIC Failure}"];
 * @endmsc
 * @}
 *
 *
 *
 * @defgroup BLE_GAP_SCAN_MSC Scanning
 * @msc
 * hscale = "1.5";
 * APP,SD,ADVERTISERS;
 * |||;
 * APP=>SD [label = "sd_ble_gap_scan_start(params)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD<-ADVERTISERS [label = "ADV packet", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {bdaddr, rssi, data}"];
 * SD<-ADVERTISERS [label = "ADV packet", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {bdaddr, rssi, data}"];
 * SD<-ADVERTISERS [label = "ADV packet", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {bdaddr, rssi, data}"];
 * ...;
 * SD<-ADVERTISERS [label = "ADV packet", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {bdaddr, rssi, data}"];
 * |||;
 * --- [label = " Variant #1 App Stops Scanning "];
 * APP=>SD [label = "sd_ble_gap_scan_stop()"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * --- [label = " Variant #2 Scanning Timeout "];
 * |||;
 * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"];
 * @endmsc
 *
 * @defgroup BLE_GAP_CENTRAL_CONN_MSC Central Connection Establishment and Termination
 * @msc
 * hscale = "1.5";
 * APP,SD,PERIPHERAL;
 * |||;
 * PERIPHERAL rbox PERIPHERAL [label="Peripheral Start Connectable Advertising"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_connect(params)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>PERIPHERAL [label = "Scanning", textcolor="#000080", linecolor="#000080"];
 * |||;
 * --- [label = " Variant #1 Connection Established "];
 * SD<:>PERIPHERAL [label = "Connection Establishment", 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 = "NRF_SUCCESS"];
 * |||;
 * --- [label = " Variant #3 Connection Timeout "];
 * |||;
 * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_CONN}"];
 * @endmsc
 *
 * @defgroup BLE_GAP_CENTRAL_CPU_MSC Central Connection Parameter Update
 * @msc
 * hscale = "1.5";
 * APP,SD,PERIPHERAL;
 * |||;
 * APP rbox PERIPHERAL [label="Connection Established with conn. params. CP#1"];
 * |||;
 * --- [label = " Unsolicited procedure"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_conn_param_update(CP#2)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD:>PERIPHERAL [label = "Connection Update Start", textcolor="#000080", linecolor="#000080"];
 * SD<:PERIPHERAL [label = "Connection Update Complete", textcolor="#000080", linecolor="#000080"];
 * |||;
 * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#2}"];
 * |||;
 * --- [label = " Peripheral Solicited procedure"];
 * |||;
 * SD<:PERIPHERAL [label = "L2CAP CPU 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<<SD [label = "NRF_SUCCESS"];
 * SD:>PERIPHERAL [label = "L2CAP CPU Response: Accepted", textcolor="#000080", linecolor="#000080"];
 * SD:>PERIPHERAL [label = "Connection Update Start", textcolor="#000080", linecolor="#000080"];
 * SD<:PERIPHERAL [label = "Connection Update Complete", 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<<SD [label = "NRF_SUCCESS"];
 * SD:>PERIPHERAL [label = "L2CAP CPU 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 = "NRF_SUCCESS"];
 * |||;
 * APP rbox PERIPHERAL [label = "Encrypted with LTK"];
 * |||;
 * --- [label = " Variant #2 Central Triggers pairing or bonding "];
 * |||;
 * APP=>SD [label = "sd_ble_gap_authenticate(params)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * APP rbox PERIPHERAL [label = "Pairing procedure"];
 * |||;
 * --- [label = " Variant #3 Central rejects the Security Request "];
 * |||;
 * APP=>SD [label = "sd_ble_gap_authenticate(NULL)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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 = "NRF_SUCCESS"];
 * |||;
 * 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_LESC_MSC Central LESC Pairing
 * @{
 * @defgroup BLE_GAP_CENTRAL_LESC_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(lesc, no_bond, no_mitm, no_io_caps)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD:>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 = "NRF_SUCCESS"];
 * |||;
 * APP abox APP [label="App completes DHKey calculation"];
 * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: num comp failure, error_src: local}"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * |||;
 * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"];
 * APP rbox APP [label="Passkey displayed to the user"];
 * |||;
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * |||;
 * APP<<=SD [label = "BLE_GAP_EVT_AUTH_KEY_REQUEST {passkey}"];
 * APP rbox APP [label="User enters Passkey"];
 * |||;
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"];
 * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"];
 * |||;
 * --- [label = ""];
 * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * 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<<SD [label = "NRF_SUCCESS"];
 * SD:>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_address_set(addr)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_gap_lesc_oob_data_get(p_pk_own, p_oobd_own)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP abox PERIPHERAL [label="OOB communication: oobd_own sent and/or oobd_peer received", textbgcolor="silver"];
 * |||;
 * APP rbox PERIPHERAL [label="Connection Established"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_authenticate(lesc, bond, oob)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD:>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 = "NRF_SUCCESS"];
 * |||;
 * 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<<SD [label = "NRF_SUCCESS"];
 * SD:>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_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<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD:>PERIPHERAL [label = "LL Encryption Request", textcolor="#000080", linecolor="#000080"];
 * |||;
 * --- [label = " Variant #1 Peripheral replies with keys "];
 * |||;
 * PERIPHERAL rbox PERIPHERAL [label = "Peripheral Loads Keys"];
 * SD<:PERIPHERAL [label = "LL Encryption Response", 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: 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", textcolor="#000080", linecolor="#000080"];
 * SD:>PERIPHERAL [label = "Connection Termination", textcolor="#000080", linecolor="#000080"];
 * APP rbox PERIPHERAL [label = "Link Terminated"];
 * 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<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD:>PEER [label = "Encryption Start", textcolor="#000080", linecolor="#000080"];
 * |||;
 * APP note SD [label = " Encryption in progress, authentication disallowed"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_authenticate()"];
 * APP<<SD [label = "NRF_ERROR_INVALID_STATE"];
 * |||;
 * SD<:PEER [label = "Encryption Complete", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE "];
 * |||;
 * APP=>SD [label = "sd_ble_gap_conn_param_update()"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD:>PEER [label = "Connection Update Start", textcolor="#000080", linecolor="#000080"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD rbox SD [label="Encryption queued"];
 * |||;
 * APP note SD [label = " Encryption queued, authentication disallowed"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_authenticate()"];
 * APP<<SD [label = "NRF_ERROR_INVALID_STATE"];
 * |||;
 * SD<:PEER [label = "Connection Update Complete", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE"];
 * |||;
 * SD:>PEER [label = "Encryption Start", textcolor="#000080", linecolor="#000080"];
 * SD<:PEER [label = "Encryption Complete", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE "];
 * |||;
 * APP=>SD [label = "sd_ble_gap_authenticate()"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * APP note SD [label = " Authentication in progress, encryption disallowed"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"];
 * APP<<SD [label = "NRF_ERROR_INVALID_STATE"];
 * @endmsc
 * @}
 *
 * @defgroup BLE_GAP_MULTILINK_CPU_MSC Central Connection Parameter Update 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 CPU 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 = " Unsolicited procedure on links #3 and #1"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_3, CP#3)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD:>PERIPHERALS [label = "Connection Update Start on link #3", textcolor="#000080", linecolor="#000080"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_1, CP#1)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * APP note PERIPHERALS [label = " Respond to solicited procedure on link #2"];
 * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_2, CP#2)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>PERIPHERALS [label = "L2CAP CPU 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<<SD [label = "NRF_ERROR_BUSY"];
 * |||;
 * APP note PERIPHERALS [label = " Note: the order of execution is not guaranteed"];
 * |||;
 * SD<:PERIPHERALS [label = "Connection Update Complete on link #3", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_3, CP#3}"];
 * |||;
 * SD:>PERIPHERALS [label = "Connection Update Start 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 on link #2", textcolor="#000080", linecolor="#000080"];
 * |||;
 * APP note PERIPHERALS [label = " Peripheral solicited procedure on link #4"];
 * |||;
 * SD<:PERIPHERALS [label = "L2CAP CPU 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<<SD [label = "NRF_SUCCESS"];
 * SD:>PERIPHERALS [label = "L2CAP CPU 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", 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 CPU 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<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD:>PERIPHERALS [label = "Encryption Start 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 = "NRF_SUCCESS"];
 * |||;
 * APP note PERIPHERALS [label = " Respond to solicited procedure on link #2"];
 * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_2, CP#2)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>PERIPHERALS [label = "L2CAP CPU 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<<SD [label = "NRF_SUCCESS"];
 * |||;
 * APP note PERIPHERALS [label = " Note: the order of execution is not guaranteed, but encryption always has priority"];
 * |||;
 * SD<:PERIPHERALS [label = "Encryption Complete on link #3", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {conn_handle_3}"];
 * |||;
 * SD:>PERIPHERALS [label = "Encryption Start on link #4", textcolor="#000080", linecolor="#000080"];
 * SD<:PERIPHERALS [label = "Encryption Complete 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 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 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_data_set(adv, sr)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_gap_adv_start(fp = CONNREQ, WL#1)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD rbox SD [label="Advertising with Whitelist #1"];
 * |||;
 * APP note APP [label = "Unable to change whitelist while adv in progress"];
 * APP=>SD [label = "sd_ble_gap_scan_start(selective = 1, WL#2)"];
 * APP<<SD [label = "BLE_ERROR_GAP_WHITELIST_IN_USE"];
 * |||;
 * APP note APP [label = "Scan with the current active whitelist"];
 * APP=>SD [label = "sd_ble_gap_scan_start(selective = 1, NULL)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD rbox SD [label="Advertising and scanning with Whitelist #1"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_adv_stop()"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD rbox SD [label="Scanning with Whitelist #1"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_scan_stop()"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * APP=>SD [label = "sd_ble_gap_scan_start(selective = 1, WL#2)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD rbox SD [label="Scanning with Whitelist #2"];
 * |||;
 * APP note APP [label = "Connect with the current active whitelist"];
 * APP=>SD [label = "sd_ble_gap_connect(selective = 1, NULL)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * SD note SD [label = "Scanning is automatically stopped"];
 * SD rbox SD [label="Connecting with Whitelist #2"];
 * |||;
 * @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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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=<invalid handle>}"];
 * @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"];
 * |||;
 * --- [label = " Variant #1 write_op == BLE_GATT_OP_WRITE_CMD "];
 * |||;
 * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>PEER [label = "ATT Write Command", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_EVT_TX_COMPLETE"];
 * |||;
 * --- [label = " Variant #2 write_op == BLE_GATT_OP_WRITE_REQ "];
 * |||;
 * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_REQ, handle, value)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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
 * <b> GATTC Handle Value Indication MSC </b>
 * @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<<SD [label = "NRF_SUCCESS"];
 * SD:>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="Any GATTC API used"];
 * 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 API call"];
 * APP<<SD [label = "NRF_ERROR_BUSY"];
 * @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 = "{NRF_SUCCESS, handle_srvc#1}"];
 * APP=>SD [label = "sd_ble_gatts_characteristic_add(handle_srvc#1, char_md, value)"];
 * APP<<SD [label = "{NRF_SUCCESS, handle_char#1, ...}"];
 * APP=>SD [label = "sd_ble_gatts_descriptor_add(handle_char#1, value)"];
 * APP<<SD [label = "{NRF_SUCCESS, handle_desc#1}"];
 * APP=>SD [label = "sd_ble_gatts_descriptor_add(handle_char#1, value)"];
 * APP<<SD [label = "{NRF_SUCCESS, handle_desc#2}"];
 * APP=>SD [label = "sd_ble_gatts_characteristic_add(handle_srvc#1, char_md, value)"];
 * APP<<SD [label = "{NRF_SUCCESS, handle_char#2, ...}"];
 * APP=>SD [label = "sd_ble_gatts_descriptor_add(handle_char#2, value)"];
 * APP<<SD [label = "{NRF_SUCCESS, handle_desc#3}"];
 * APP=>SD [label = "sd_ble_gatts_service_add(uuid#2)"];
 * APP<<SD [label = "{NRF_SUCCESS, handle_srvc#2}"];
 * APP=>SD [label = "sd_ble_gatts_include_add(handle_srvc#2, handle_srvc#1)"];
 * APP<<SD [label = "{NRF_SUCCESS, handle_inc#1}"];
 * |||;
 * ...;
 * |||;
 * @endmsc
 *
 * @defgroup BLE_GATTS_READ_REQ_NO_AUTH_MSC GATTS Read Request without Authorization
 * @msc
 * hscale = "1.5";
 * APP,SD,PEER;
 * |||;
 * APP rbox PEER [label="Connection Established"];
 * |||;
 * SD<:PEER [label = "ATT Read Request", textcolor="#000080", linecolor="#000080"];
 * SD:>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 = "NRF_SUCCESS"];
 * SD rbox SD [label="Value in ATT Table: peer_value"];
 * --- [label = " Variant #2 App Authorizes but changes value "];
 * APP=>SD [label = "sd_ble_gatts_value_set(app_value)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD rbox SD [label="Value in ATT Table: app_value"];
 * --- [label = " Variant #3 App ignores the incoming operation "];
 * SD rbox SD [label="Value in ATT Table: current_value"];
 * @endmsc
 *
 * @defgroup BLE_GATTS_READ_REQ_AUTH_MSC GATTS Read 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 Read Request", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {READ, current_value}"];
 * --- [label = " Variant #1 App Authorizes "];
 * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(SUCCESS, app_value)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD rbox SD [label="Value in ATT Table: app_value"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD rbox SD [label="Value in ATT Table: peer_value"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD rbox SD [label="Value in ATT Table: app_value"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD rbox SD [label="Value in ATT Table: current_value"];
 * SD:>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}"];
 * |||;
 * --- [label = " Variant #3 Peer cancels operation "];
 * 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}"];
 * |||;
 * @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 = "NRF_SUCCESS"];
 * APP=>SD [label = "sd_ble_gatts_value_set {handle_2, offset_2, peer_value_2}"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD rbox SD [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 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_PEER_CANCEL_MSC GATTS Queued Writes: App handled, peer cancels operation
 * @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 {CANCEL}", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_CANCEL}"];
 * APP rbox APP [label="Queue Erased\nValues 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_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_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 = "NRF_SUCCESS"];
 * 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_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<<SD [label = "NRF_SUCCESS"];
 * SD rbox SD [label="Value in ATT Table: app_value"];
 * SD:>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;
 * |||;
 * APP rbox PEER [label="Connection Established"];
 * |||;
 * APP rbox PEER [label="Notifications Enabled in CCCD"];
 * |||;
 * SD rbox SD [label="Value in ATT Table: current_value"];
 * APP=>SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD rbox SD [label="Value in ATT Table: app_value"];
 * SD:>PEER [label = "ATT Handle Value Notification {app_value}", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_EVT_TX_COMPLETE"];
 * @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 = "NRF_ERROR_INVALID_STATE"];
 * SD rbox SD [label="Value in ATT Table: current_value"];
 * @endmsc
 *
 * @defgroup BLE_GATTS_HVX_SYS_ATTRS_MISSING_MSC GATTS Handle Value Indication or Notification with System Attributes Missing
 * @msc
 * hscale = "1.5";
 * APP,SD,PEER;
 * |||;
 * APP rbox PEER [label="Connection Established"];
 * |||;
 * APP rbox PEER [label="System Attributes Uninitialized"];
 * |||;
 * 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 = "BLE_ERROR_GATTS_SYS_ATTR_MISSING"];
 * SD rbox SD [label="Value in ATT Table: current_value"];
 * APP=>SD [label = "sd_ble_gatts_sys_attr_set()"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * ...;
 * @endmsc
 *
 * @defgroup BLE_GATTS_SC_MSC GATTS Service Changed
 * @msc
 * hscale = "1.5";
 * APP,SD,PEER;
 * |||;
 * APP rbox SD [label="Entries added to the ATT Table between handles N and M"];
 * |||;
 * APP rbox PEER [label="Connection Established with a Bonded Peer"];
 * |||;
 * APP=>SD [label = "sd_ble_gatts_service_changed(N, M)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>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<<SD [label = "NRF_SUCCESS"];
 * SD:>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 = "{NRF_SUCCESS, sys_attr_data}"];
 * APP rbox APP [label="Store System Attributes"];
 * |||;
 * APP rbox SD [label="Shut down IC"];
 * |||;
 * APP rbox SD [label="Power up IC"];
 * |||;
 * APP rbox PEER [label="Connection Established with the Bonded Peer"];
 * SD<:PEER [label = "ATT Read Request {sys_attr_handle}", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_GATTS_EVT_SYS_ATTR_MISSING"];
 * APP rbox APP [label="Load System Attributes"];
 * APP=>SD [label = "sd_ble_gatts_sys_attr_set(sys_attr_data)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>PEER [label = "ATT Read Response {sys_attr_value}", textcolor="#000080", linecolor="#000080"];
 * @endmsc
 * @}
 *
 * @addtogroup BLE_GATTS_QUEUED_WRITES_USER_MEM User memory layout for Queued Writes
 * @{ 
 *  The following table shows the memory layout used by the SoftDevice to queue a Queued Write operation (Prepare Write ATT packet) in user memory:
 *
 *  <table style="border:1px solid black;border-collapse:collapse;">
 *  <caption>Queued Write</caption>
 *  <tr>
 *  <th style="border:1px solid black;padding:5px;">Parameter</th>
 *  <th style="border:1px solid black;padding:5px;">Size (octets)</th>
 *  <th style="border:1px solid black;padding:5px;">Description</th>
 *  </tr>
 *  <tr>
 *  <td style="border:1px solid black;padding:5px;">Handle</td>
 *  <td style="border:1px solid black;padding:5px;">2</td>
 *  <td style="border:1px solid black;padding:5px;">Attribute Handle</td>
 *  </tr>
 *  <tr>
 *  <td style="border:1px solid black;padding:5px;">Offset</td>
 *  <td style="border:1px solid black;padding:5px;">2</td>
 *  <td style="border:1px solid black;padding:5px;">Value Offset</td>
 *  </tr>
 *  <tr>
 *  <td style="border:1px solid black;padding:5px;">Length</td>
 *  <td style="border:1px solid black;padding:5px;">2</td>
 *  <td style="border:1px solid black;padding:5px;">Value Length</td>
 *  </tr>
 *  <tr>
 *  <td style="border:1px solid black;padding:5px;">Value</td>
 *  <td style="border:1px solid black;padding:5px;">Length</td>
 *  <td style="border:1px solid black;padding:5px;">Attribute Value</td>
 *  </tr>
 *  </table>
 *
 *  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.
  *
  *   <table style="border:1px solid black;border-collapse:collapse;">
  *   <caption>System Attribute</caption>
  *   <tr>
  *     <th style="border:1px solid black;padding:5px;">Parameter</th>
  *     <th style="border:1px solid black;padding:5px;">Size (octets)</th>
  *     <th style="border:1px solid black;padding:5px;">Description</th>
  *   </tr>
  *   <tr>
  *     <td style="border:1px solid black;padding:5px;">Handle</td>
  *     <td style="border:1px solid black;padding:5px;">2</td>
  *     <td style="border:1px solid black;padding:5px;">Attribute handle</td>
  *   </tr>
  *   <tr>
  *     <td style="border:1px solid black;padding:5px;">Length</td>
  *     <td style="border:1px solid black;padding:5px;">2</td>
  *     <td style="border:1px solid black;padding:5px;">Attribute length</td>
  *   </tr>
  *   <tr>
  *     <td style="border:1px solid black;padding:5px;">Data</td>
  *     <td style="border:1px solid black;padding:5px;">Length</td>
  *     <td style="border:1px solid black;padding:5px;">Attribute data</td>
  *   </tr>
  *   </table>
  *
  *  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_API_MSC L2CAP API
 * @msc
 * hscale = "1.5";
 * APP,SD,PEER;
 * |||;
 * APP=>SD [label = "sd_ble_l2cap_cid_register(cid)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * |||;
 * APP rbox PEER [label="Connection Established"];
 * |||;
 * APP=>SD [label = "sd_ble_l2cap_tx(data)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>PEER [label = "L2CAP packet", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_EVT_TX_COMPLETE"];
 * SD<:PEER [label = "L2CAP packet", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_L2CAP_EVT_RX"];
 * SD<:PEER [label = "L2CAP packet", textcolor="#000080", linecolor="#000080"];
 * APP<<=SD [label = "BLE_L2CAP_EVT_RX"];
 * |||;
 * APP=>SD [label = "sd_ble_l2cap_tx(data)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * SD:>PEER [label = "L2CAP packet", textcolor="#000080", linecolor="#000080"];
 * SD=>>APP [label = "BLE_EVT_TX_COMPLETE"];
 * |||;
 * APP rbox PEER [label="Terminate Connection"];
 * |||;
 * APP=>SD [label = "sd_ble_l2cap_cid_unregister(cid)"];
 * APP<<SD [label = "NRF_SUCCESS"];
 * @endmsc
 * @}
 * @}
 */
