pkg/nimble/netif: add ACCEPT_STOP event

This commit is contained in:
Hauke Petersen 2020-01-23 17:16:29 +01:00
parent 309995513e
commit 5c5ba9f740
2 changed files with 3 additions and 1 deletions

View File

@ -120,6 +120,7 @@ enum {
*/ */
typedef enum { typedef enum {
NIMBLE_NETIF_ACCEPTING, /**< accepting incoming connections */ 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_MASTER, /**< conn. procedure started (as mater) */
NIMBLE_NETIF_INIT_SLAVE, /**< conn. procedure started (as slave) */ NIMBLE_NETIF_INIT_SLAVE, /**< conn. procedure started (as slave) */
NIMBLE_NETIF_CONNECTED_MASTER, /**< connection established as master */ NIMBLE_NETIF_CONNECTED_MASTER, /**< connection established as master */

View File

@ -621,7 +621,7 @@ int nimble_netif_accept(const uint8_t *ad, size_t ad_len,
adv_params, _on_gap_slave_evt, (void *)handle); adv_params, _on_gap_slave_evt, (void *)handle);
assert(res == 0); assert(res == 0);
_notify(handle, NIMBLE_NETIF_ACCEPTING, NULL); _notify(handle, NIMBLE_NETIF_ACCEPTING, _nimble_netif->l2addr);
return NIMBLE_NETIF_OK; return NIMBLE_NETIF_OK;
} }
@ -637,6 +637,7 @@ int nimble_netif_accept_stop(void)
assert(res == 0); assert(res == 0);
(void)res; (void)res;
nimble_netif_conn_free(handle, NULL); nimble_netif_conn_free(handle, NULL);
_notify(handle, NIMBLE_NETIF_ACCEPT_STOP, _nimble_netif->l2addr);
return NIMBLE_NETIF_OK; return NIMBLE_NETIF_OK;
} }