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 dkalowsk committed Dec 27, 2024
1 parent fe8dc82 commit d70bbe0
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 @@ -43,11 +43,10 @@ static void connected(struct bt_conn *conn, uint8_t err)
{
if (err) {
LOG_ERR("Connection failed, err 0x%02x %s", err, bt_hci_err_to_str(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 d70bbe0

Please sign in to comment.