Commit 838cc543 authored by Emil Gydesen's avatar Emil Gydesen Committed by Alberto Escolar
Browse files

Bluetooth: Services: Set IAS alert level before callback



Fix the order of setting the alert level before the callback.
Without this fix, the alert level would be incorrect if
the upper layers ever tried to perform any other IAS operations
in the callback.

Signed-off-by: default avatarEmil Gydesen <emil.gydesen@nordicsemi.no>
parent c70f4027
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ static void set_alert_level(void)
		return;
	}

	curr_lvl = alert_level;

	if (alert_level == BT_IAS_ALERT_LVL_HIGH_ALERT) {
		STRUCT_SECTION_FOREACH(bt_ias_cb, cb) {
			if (cb->high_alert) {
@@ -75,7 +77,6 @@ static void set_alert_level(void)
		}
		LOG_DBG("No alert");
	}
	curr_lvl = alert_level;
}

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