diff options
author | Prathyusha N <prathyusha.n@samsung.com> | 2020-03-25 00:57:17 +0530 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2020-03-25 10:31:14 -0700 |
commit | 424f88e7b8c57adc134dbbe949395f678f5468db (patch) | |
tree | aeb53f6b5ec4ec458608171c9b68a55f764f6e2e /mesh/prov-acceptor.c | |
parent | 936122a230d85c5b5a12abe5b04bbead25745366 (diff) | |
download | bluez-424f88e7b8c57adc134dbbe949395f678f5468db.tar.gz |
mesh: Handle close for Acceptor
Provision complete callback is handled in provision failure case.
If link closed received abruptly with reason success, triggered
provision complete callback. Removed session timeout and session
free as they are handled in pb_adv_unreg.
Diffstat (limited to 'mesh/prov-acceptor.c')
-rw-r--r-- | mesh/prov-acceptor.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c index 903abc2ff..5231616ee 100644 --- a/mesh/prov-acceptor.c +++ b/mesh/prov-acceptor.c @@ -120,7 +120,18 @@ static void acceptor_free(void) static void acp_prov_close(void *user_data, uint8_t reason) { - /* TODO: Handle Close */ + struct mesh_prov_acceptor *rx_prov = user_data; + + if (rx_prov != prov) + return; + + if (reason == PROV_ERR_SUCCESS) + reason = PROV_ERR_UNEXPECTED_ERR; + + if (prov->cmplt) + prov->cmplt(prov->caller_data, reason, NULL); + + prov->cmplt = NULL; acceptor_free(); } |