Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 53d58f3

Browse files
author
iwahdan88
committed
[PYFW-324] Updated Char max length to correspond to MTU #close
# Conflicts: # esp32/mods/modbt.c
1 parent 30053c5 commit 53d58f3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

esp32/mods/modbt.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
******************************************************************************/
5959
#define BT_SCAN_QUEUE_SIZE_MAX (16)
6060
#define BT_GATTS_QUEUE_SIZE_MAX (2)
61-
#define BT_CHAR_VALUE_SIZE_MAX (20)
61+
#define BT_MTU_SIZE_MAX (200)
62+
#define BT_CHAR_VALUE_SIZE_MAX (BT_MTU_SIZE_MAX - 3)
6263

6364
#define MOD_BT_CLIENT_APP_ID (0)
6465
#define MOD_BT_SERVER_APP_ID (1)
@@ -454,6 +455,7 @@ static void gattc_events_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc
454455
bt_obj.busy = false;
455456
// intentional fall through
456457
case ESP_GATTC_CLOSE_EVT:
458+
case ESP_GATTC_DISCONNECT_EVT:
457459
close_connection(p_data->close.conn_id);
458460
break;
459461
default:
@@ -687,7 +689,7 @@ static mp_obj_t bt_init_helper(bt_obj_t *self, const mp_arg_val_t *args) {
687689
esp_ble_gattc_app_register(MOD_BT_CLIENT_APP_ID);
688690
esp_ble_gatts_app_register(MOD_BT_SERVER_APP_ID);
689691

690-
esp_ble_gatt_set_local_mtu(500);
692+
esp_ble_gatt_set_local_mtu(BT_MTU_SIZE_MAX);
691693

692694
self->init = true;
693695
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy