From 7d472c3c3851b2352ee7a52b95c3b125ad5162ac Mon Sep 17 00:00:00 2001 From: Trond Einar Snekvik Date: Mon, 19 Aug 2019 09:41:04 +0200 Subject: [PATCH] Bluetooth: Mesh: Use define for no prov pdu Adds a prov PDU type define for cases when no PDU is expected. Signed-off-by: Trond Einar Snekvik --- subsys/bluetooth/mesh/prov.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/prov.c b/subsys/bluetooth/mesh/prov.c index b1546738e02..dded2ab4c59 100644 --- a/subsys/bluetooth/mesh/prov.c +++ b/subsys/bluetooth/mesh/prov.c @@ -77,6 +77,8 @@ #define PROV_COMPLETE 0x08 #define PROV_FAILED 0x09 +#define PROV_NO_PDU 0xff + #define PROV_ALG_P256 0x00 #define GPCF(gpc) (gpc & 0x03) @@ -895,7 +897,7 @@ static void send_pub_key(const u8_t dhkey[32]) } if (atomic_test_bit(link.flags, WAIT_NUMBER) || atomic_test_bit(link.flags, WAIT_STRING)) { - link.expect = 0xff; /* Don't expect any packets until after input */ + link.expect = PROV_NO_PDU; /* Wait for input */ } else { link.expect = PROV_CONFIRM; } @@ -1081,7 +1083,7 @@ static void prov_data(const u8_t *data) } /* Ignore any further PDUs on this link */ - link.expect = 0U; + link.expect = PROV_NO_PDU; /* Store info, since bt_mesh_provision() will end up clearing it */ if (IS_ENABLED(CONFIG_BT_MESH_GATT_PROXY)) {