Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/net/echo_client/src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ void stop_tcp(void);

struct net_pkt *prepare_send_pkt(struct net_app_ctx *ctx,
const char *name,
int expecting_len);
int *expecting_len);
void panic(const char *msg);
12 changes: 3 additions & 9 deletions samples/net/echo_client/src/echo-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,16 @@ static inline int init_app(void)

struct net_pkt *prepare_send_pkt(struct net_app_ctx *ctx,
const char *name,
int expecting_len)
int *expecting_len)
{
struct net_pkt *send_pkt;
bool status;

send_pkt = net_app_get_net_pkt(ctx, AF_UNSPEC, K_FOREVER);

NET_ASSERT(send_pkt);

status = net_pkt_append_all(send_pkt, expecting_len, lorem_ipsum,
K_FOREVER);
if (!status) {
NET_ERR("%s: cannot create send pkt", name);
net_pkt_unref(send_pkt);
return NULL;
}
*expecting_len = net_pkt_append(send_pkt, *expecting_len, lorem_ipsum,
K_FOREVER);

return send_pkt;
}
Expand Down
2 changes: 1 addition & 1 deletion samples/net/echo_client/src/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static void send_tcp_data(struct net_app_ctx *ctx,

data->received_tcp = 0;

pkt = prepare_send_pkt(ctx, data->proto, data->expecting_tcp);
pkt = prepare_send_pkt(ctx, data->proto, &data->expecting_tcp);
if (!pkt) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion samples/net/echo_client/src/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void send_udp_data(struct net_app_ctx *ctx, struct data *data)

data->expecting_udp = sys_rand32_get() % ipsum_len;

pkt = prepare_send_pkt(ctx, data->proto, data->expecting_udp);
pkt = prepare_send_pkt(ctx, data->proto, &data->expecting_udp);
if (!pkt) {
return;
}
Expand Down