This commit is contained in:
Okke Formsma 2021-10-22 12:52:13 -07:00 committed by GitHub
commit bcba27eea3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -110,7 +110,7 @@ bool zmk_ble_active_profile_is_open() {
}
void set_profile_address(uint8_t index, const bt_addr_le_t *addr) {
char setting_name[15];
char setting_name[17];
char addr_str[BT_ADDR_LE_STR_LEN];
bt_addr_le_to_str(addr, addr_str, sizeof(addr_str));

View file

@ -29,7 +29,7 @@ static int start_scan(void);
static struct bt_conn *default_conn;
static struct bt_uuid_128 uuid = BT_UUID_INIT_128(ZMK_SPLIT_BT_SERVICE_UUID);
static struct bt_uuid uuid = {.type = BT_UUID_TYPE_128};
static struct bt_gatt_discover_params discover_params;
static struct bt_gatt_subscribe_params subscribe_params;
@ -116,8 +116,8 @@ static uint8_t split_central_discovery_func(struct bt_conn *conn, const struct b
LOG_DBG("[ATTRIBUTE] handle %u", attr->handle);
if (!bt_uuid_cmp(discover_params.uuid, BT_UUID_DECLARE_128(ZMK_SPLIT_BT_SERVICE_UUID))) {
memcpy(&uuid, BT_UUID_DECLARE_128(ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID), sizeof(uuid));
discover_params.uuid = &uuid.uuid;
uuid.type = BT_UUID_TYPE_128;
discover_params.uuid = &uuid;
discover_params.start_handle = attr->handle + 1;
discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC;
@ -127,8 +127,8 @@ static uint8_t split_central_discovery_func(struct bt_conn *conn, const struct b
}
} else if (!bt_uuid_cmp(discover_params.uuid,
BT_UUID_DECLARE_128(ZMK_SPLIT_BT_CHAR_POSITION_STATE_UUID))) {
memcpy(&uuid, BT_UUID_GATT_CCC, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
uuid.type = BT_UUID_TYPE_16;
discover_params.uuid = &uuid;
discover_params.start_handle = attr->handle + 2;
discover_params.type = BT_GATT_DISCOVER_DESCRIPTOR;
subscribe_params.value_handle = bt_gatt_attr_value_handle(attr);
@ -162,7 +162,7 @@ static void split_central_process_connection(struct bt_conn *conn) {
}
if (conn == default_conn && !subscribe_params.value) {
discover_params.uuid = &uuid.uuid;
discover_params.uuid = &uuid;
discover_params.func = split_central_discovery_func;
discover_params.start_handle = 0x0001;
discover_params.end_handle = 0xffff;