1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-27 08:58:28 +00:00
trezor-firmware/core/embed/ble_firmware/connection.c
tychovrahe 48fa5b6862 NRF
2023-06-15 22:46:20 +02:00

18 lines
473 B
C

#include "ble_gap.h"
#include "connection.h"
static uint16_t m_conn_handle =
BLE_CONN_HANDLE_INVALID; /**< Handle of the current connection. */
void set_connection_handle(uint16_t val) { m_conn_handle = val; }
uint16_t get_connection_handle(void) { return m_conn_handle; }
void disconnect(void) {
if (m_conn_handle != BLE_CONN_HANDLE_INVALID) {
sd_ble_gap_disconnect(m_conn_handle,
BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
}
}