Skip to content

Commit e524e7f

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

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
@@ -139,6 +139,12 @@ void pouch_gateway_uplink_start(struct bt_conn *conn)
139139
struct pouch_gateway_node_info *node = pouch_gateway_get_node_info(conn);
140140

141141
struct pouch_gateway_downlink_context *downlink = pouch_gateway_downlink_start(conn);
142+
if (downlink == NULL)
143+
{
144+
LOG_ERR("Failed to start downlink");
145+
pouch_gateway_bt_finished(conn);
146+
return;
147+
}
142148

143149
node->uplink = pouch_gateway_uplink_open(downlink, uplink_end_cb, conn);
144150
if (node->uplink == NULL)

0 commit comments

Comments
 (0)