zephyr/modusocket: Switch to net_pkt_append() returning length.
Requires patch in review.
This commit is contained in:
parent
39d3335606
commit
69f0b4ad5b
@ -316,9 +316,9 @@ STATIC mp_uint_t sock_write(mp_obj_t self_in, const void *buf, mp_uint_t size, i
|
|||||||
len = size;
|
len = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!net_pkt_append(send_pkt, len, buf, K_FOREVER)) {
|
// TODO: Return value of 0 is a hard case (as we wait forever, should
|
||||||
len = net_pkt_get_len(send_pkt);
|
// not happen).
|
||||||
}
|
len = net_pkt_append(send_pkt, len, buf, K_FOREVER);
|
||||||
|
|
||||||
int err = net_context_send(send_pkt, /*cb*/NULL, K_FOREVER, NULL, NULL);
|
int err = net_context_send(send_pkt, /*cb*/NULL, K_FOREVER, NULL, NULL);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user