From 5c5ba9f740f2d1c985ab75d92e8efc97d0ea4038 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Thu, 23 Jan 2020 17:16:29 +0100 Subject: [PATCH] pkg/nimble/netif: add ACCEPT_STOP event --- pkg/nimble/netif/include/nimble_netif.h | 1 + pkg/nimble/netif/nimble_netif.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/nimble/netif/include/nimble_netif.h b/pkg/nimble/netif/include/nimble_netif.h index 9ff6af513d..5ff8000933 100644 --- a/pkg/nimble/netif/include/nimble_netif.h +++ b/pkg/nimble/netif/include/nimble_netif.h @@ -120,6 +120,7 @@ enum { */ typedef enum { NIMBLE_NETIF_ACCEPTING, /**< accepting incoming connections */ + NIMBLE_NETIF_ACCEPT_STOP, /**< stop accepting incoming connections */ NIMBLE_NETIF_INIT_MASTER, /**< conn. procedure started (as mater) */ NIMBLE_NETIF_INIT_SLAVE, /**< conn. procedure started (as slave) */ NIMBLE_NETIF_CONNECTED_MASTER, /**< connection established as master */ diff --git a/pkg/nimble/netif/nimble_netif.c b/pkg/nimble/netif/nimble_netif.c index d35ad68d5a..0a69520640 100644 --- a/pkg/nimble/netif/nimble_netif.c +++ b/pkg/nimble/netif/nimble_netif.c @@ -621,7 +621,7 @@ int nimble_netif_accept(const uint8_t *ad, size_t ad_len, adv_params, _on_gap_slave_evt, (void *)handle); assert(res == 0); - _notify(handle, NIMBLE_NETIF_ACCEPTING, NULL); + _notify(handle, NIMBLE_NETIF_ACCEPTING, _nimble_netif->l2addr); return NIMBLE_NETIF_OK; } @@ -637,6 +637,7 @@ int nimble_netif_accept_stop(void) assert(res == 0); (void)res; nimble_netif_conn_free(handle, NULL); + _notify(handle, NIMBLE_NETIF_ACCEPT_STOP, _nimble_netif->l2addr); return NIMBLE_NETIF_OK; }