Skip to content

Commit 37f84c6

Browse files
committed
uplink: handle downlink start error
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
1 parent 2ba86f1 commit 37f84c6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/bt/uplink.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ void pouch_gateway_uplink_start(struct bt_conn *conn)
134134
struct pouch_gateway_node_info *node = pouch_gateway_get_node_info(conn);
135135

136136
struct pouch_gateway_downlink_context *downlink = pouch_gateway_downlink_start(conn);
137+
if (downlink == NULL)
138+
{
139+
LOG_ERR("Failed to start downlink");
140+
pouch_gateway_bt_finished(conn);
141+
return;
142+
}
137143

138144
node->uplink = pouch_gateway_uplink_open(downlink, uplink_end_cb, conn);
139145
if (node->uplink == NULL)

0 commit comments

Comments
 (0)