Skip to content

Commit

Permalink
samples: mgmt: mcumgr: smp_svr: Fix re-advertise issue on connection
Browse files Browse the repository at this point in the history
Fixes an issue introduced with commit
c6ad4a7 which wrong restarts
advertising after a device connects when it should only restart
advertising if a device fails to connect

Signed-off-by: Jamie McCrae <[email protected]>
(cherry picked from commit 655be99)
  • Loading branch information
nordicjm authored and nashif committed Jan 7, 2025
1 parent d790dcc commit 7c0a74e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions samples/subsys/mgmt/mcumgr/smp_svr/src/bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ static void connected(struct bt_conn *conn, uint8_t err)
{
if (err) {
LOG_ERR("Connection failed (err 0x%02x)", err);
k_work_submit(&advertise_work);
} else {
LOG_INF("Connected");
}

k_work_submit(&advertise_work);
}

static void disconnected(struct bt_conn *conn, uint8_t reason)
Expand Down

0 comments on commit 7c0a74e

Please sign in to comment.