Пример #1
0
static inline bool telnet_send(void)
{
	struct line_buf *lb = telnet_rb_get_line_out();

	if (lb) {
		if (net_context_send_new(client_cnx,
					 (u8_t *)lb->buf, lb->len,
					 telnet_sent_cb,
					 K_FOREVER, NULL, NULL)) {
			return false;
		}

		/* We reinitialize the line buffer */
		lb->len = 0U;
	}

	return true;
}
Пример #2
0
static inline bool telnet_send(void)
{
	struct line_buf *lb = telnet_rb_get_line_out();

	if (lb) {
		net_pkt_append_all(out_pkt, lb->len, lb->buf, K_FOREVER);

		/* We reinitialize the line buffer */
		lb->len = 0;

		if (net_context_send(out_pkt, telnet_sent_cb,
				     K_NO_WAIT, NULL, NULL) ||
		    telnet_setup_out_pkt(client_cnx)) {
			return false;
		}
	}

	return true;
}