2020-09-10 13:57:44 +10:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020 The ZMK Contributors
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*/
|
2020-05-18 23:11:46 +10:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <zmk/keys.h>
|
2020-09-09 13:26:00 +10:00
|
|
|
#include <zmk/ble/profile.h>
|
2020-08-29 04:15:16 +10:00
|
|
|
|
2022-01-02 15:55:30 +11:00
|
|
|
#define ZMK_BLE_IS_CENTRAL \
|
|
|
|
(IS_ENABLED(CONFIG_ZMK_SPLIT) && IS_ENABLED(CONFIG_ZMK_BLE) && \
|
|
|
|
IS_ENABLED(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL))
|
|
|
|
|
|
|
|
#if ZMK_BLE_IS_CENTRAL
|
|
|
|
#define ZMK_BLE_PROFILE_COUNT (CONFIG_BT_MAX_PAIRED - 1)
|
|
|
|
#define ZMK_BLE_SPLIT_PERIPHERAL_COUNT 1
|
|
|
|
#else
|
|
|
|
#define ZMK_BLE_PROFILE_COUNT CONFIG_BT_MAX_PAIRED
|
|
|
|
#endif
|
|
|
|
|
2020-09-02 13:22:30 +10:00
|
|
|
int zmk_ble_clear_bonds();
|
2020-09-09 13:26:00 +10:00
|
|
|
int zmk_ble_prof_next();
|
|
|
|
int zmk_ble_prof_prev();
|
2020-12-03 03:41:57 +11:00
|
|
|
int zmk_ble_prof_select(uint8_t index);
|
2020-09-09 13:26:00 +10:00
|
|
|
|
2020-09-01 00:18:19 +10:00
|
|
|
int zmk_ble_active_profile_index();
|
2020-09-09 13:26:00 +10:00
|
|
|
bt_addr_le_t *zmk_ble_active_profile_addr();
|
2020-09-01 00:18:19 +10:00
|
|
|
bool zmk_ble_active_profile_is_open();
|
2020-10-25 05:39:02 +11:00
|
|
|
bool zmk_ble_active_profile_is_connected();
|
2020-09-09 13:26:00 +10:00
|
|
|
char *zmk_ble_active_profile_name();
|
2020-08-29 04:15:16 +10:00
|
|
|
|
2020-08-19 01:20:15 +10:00
|
|
|
int zmk_ble_unpair_all();
|
2020-08-29 04:15:16 +10:00
|
|
|
|
|
|
|
#if IS_ENABLED(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL)
|
|
|
|
void zmk_ble_set_peripheral_addr(bt_addr_le_t *addr);
|
2022-01-25 05:43:45 +11:00
|
|
|
#endif /* IS_ENABLED(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL) */
|