tests/net/lib/mqtt_subscriber/src/test_mqtt_subscribe.c
/* In this routine we block until the connected variable is 1 */
In this routine we block until the connected variable is 1
In this routine we block until the connected variable is 1
static int try_to_connect(struct mqtt_client_ctx *client_ctx)
{
	int i = 0;
	while (i++ < APP_CONNECT_TRIES && !client_ctx->mqtt_ctx.connected) {
		int rc;
		rc = mqtt_tx_connect(&client_ctx->mqtt_ctx,
				     &client_ctx->connect_msg);
		k_sleep(APP_SLEEP_MSECS);
		if (rc != 0) {
			continue;
		}
	}
	if (client_ctx->mqtt_ctx.connected) {
		return TC_PASS;
	}
	return TC_FAIL;
}
static int try_to_connect ( struct mqtt_client_ctx * client_ctx ) { int i = 0 ; while ( i ++ < APP_CONNECT_TRIES && ! client_ctx -> mqtt_ctx . connected ) { int rc ; rc = mqtt_tx_connect ( & client_ctx -> mqtt_ctx , & client_ctx -> connect_msg ) ; k_sleep ( APP_SLEEP_MSECS ) ; if ( rc != 0 ) { continue ; } } if ( client_ctx -> mqtt_ctx . connected ) { return TC_PASS ; } return TC_FAIL ; }
In this routine we block until the connected variable is 1
In this routine we block until the connected variable is 1