Added a new event to the ble_service_state_change event callback function to be able to detect when a BLE master device subscribed to a particular characteristic. Also reworked the allocated buffers for the BLE stack, because of a strage issue, where it is hard for the phone to reconnect to the watch.
This commit is contained in:
parent
cfc42779dd
commit
92de986dba
@ -660,6 +660,12 @@ static int ble_gap_event_cb(struct ble_gap_event *event, void *arg)
|
|||||||
event->subscribe.cur_notify,
|
event->subscribe.cur_notify,
|
||||||
event->subscribe.prev_notify
|
event->subscribe.prev_notify
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(gatt_nus_char_tx_handle == event->subscribe.attr_handle && (event->subscribe.cur_notify || event->subscribe.cur_indicate))
|
||||||
|
{
|
||||||
|
//We call the state change callback if registered
|
||||||
|
if(_ble_service_state_change_cb)_ble_service_state_change_cb(BLE_SERVICE_MODE_SUBSCRIBED);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case BLE_GAP_EVENT_MTU:
|
case BLE_GAP_EVENT_MTU:
|
||||||
TLS_BT_APPL_TRACE_VERBOSE("MTU update : %u"NEW_LINE, event->mtu.value);
|
TLS_BT_APPL_TRACE_VERBOSE("MTU update : %u"NEW_LINE, event->mtu.value);
|
||||||
|
@ -15,6 +15,7 @@ typedef enum
|
|||||||
BLE_SERVICE_MODE_IDLE,
|
BLE_SERVICE_MODE_IDLE,
|
||||||
BLE_SERVICE_MODE_ADVERTISING,
|
BLE_SERVICE_MODE_ADVERTISING,
|
||||||
BLE_SERVICE_MODE_CONNECTED,
|
BLE_SERVICE_MODE_CONNECTED,
|
||||||
|
BLE_SERVICE_MODE_SUBSCRIBED,
|
||||||
BLE_SERVICE_MODE_INDICATING,
|
BLE_SERVICE_MODE_INDICATING,
|
||||||
BLE_SERVICE_MODE_EXITING
|
BLE_SERVICE_MODE_EXITING
|
||||||
} ble_service_state_e;
|
} ble_service_state_e;
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MYNEWT_VAL_MSYS_1_BLOCK_SIZE
|
#ifndef MYNEWT_VAL_MSYS_1_BLOCK_SIZE
|
||||||
#define MYNEWT_VAL_MSYS_1_BLOCK_SIZE (100) // Default 292
|
#define MYNEWT_VAL_MSYS_1_BLOCK_SIZE (150) // Default 292
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MYNEWT_VAL_MSYS_1_SANITY_MIN_COUNT
|
#ifndef MYNEWT_VAL_MSYS_1_SANITY_MIN_COUNT
|
||||||
@ -925,7 +925,7 @@
|
|||||||
|
|
||||||
/*** @apache-mynewt-nimble/nimble/transport/socket */
|
/*** @apache-mynewt-nimble/nimble/transport/socket */
|
||||||
#ifndef MYNEWT_VAL_BLE_ACL_BUF_COUNT
|
#ifndef MYNEWT_VAL_BLE_ACL_BUF_COUNT
|
||||||
#define MYNEWT_VAL_BLE_ACL_BUF_COUNT (8) // Default 36
|
#define MYNEWT_VAL_BLE_ACL_BUF_COUNT (15) // Default 36
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MYNEWT_VAL_BLE_ACL_BUF_SIZE
|
#ifndef MYNEWT_VAL_BLE_ACL_BUF_SIZE
|
||||||
@ -947,11 +947,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MYNEWT_VAL_BLE_HCI_EVT_HI_BUF_COUNT
|
#ifndef MYNEWT_VAL_BLE_HCI_EVT_HI_BUF_COUNT
|
||||||
#define MYNEWT_VAL_BLE_HCI_EVT_HI_BUF_COUNT (5) // Default 16
|
#define MYNEWT_VAL_BLE_HCI_EVT_HI_BUF_COUNT (10) // Default 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MYNEWT_VAL_BLE_HCI_EVT_LO_BUF_COUNT
|
#ifndef MYNEWT_VAL_BLE_HCI_EVT_LO_BUF_COUNT
|
||||||
#define MYNEWT_VAL_BLE_HCI_EVT_LO_BUF_COUNT (5) // Default 96
|
#define MYNEWT_VAL_BLE_HCI_EVT_LO_BUF_COUNT (20) // Default 96
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MYNEWT_VAL_BLE_SOCK_CLI_SYSINIT_STAGE
|
#ifndef MYNEWT_VAL_BLE_SOCK_CLI_SYSINIT_STAGE
|
||||||
|
Loading…
Reference in New Issue
Block a user