Handle incrementing seq_send elsewhere

This commit is contained in:
XANTRONIX Development 2020-07-08 16:40:40 -04:00 committed by XANTRONIX Industrial
parent 0bfd5795ad
commit a7cab09e47

View file

@ -211,15 +211,11 @@ ssize_t patty_ax25_sock_send(patty_ax25_sock *sock,
if (sock->mode == PATTY_AX25_SOCK_SABME) { if (sock->mode == PATTY_AX25_SOCK_SABME) {
buf[offset++] = (control & 0xff00) >> 8; buf[offset++] = (control & 0xff00) >> 8;
buf[offset++] = control & 0x00ff; buf[offset++] = control & 0x00ff;
sock->seq_send = (sock->seq_send + 1) & 0x07;
} else { } else {
buf[offset++] = control; buf[offset++] = control;
sock->seq_send = (sock->seq_send + 1) & 0x7f;
} }
if (PATTY_AX25_CONTROL_INFO(control)) { if (info) {
buf[offset++] = (uint8_t)sock->proto; buf[offset++] = (uint8_t)sock->proto;
memcpy(buf + offset, info, infolen); memcpy(buf + offset, info, infolen);
@ -275,6 +271,8 @@ ssize_t patty_ax25_sock_write(patty_ax25_sock *sock,
goto error_send; goto error_send;
} }
patty_ax25_sock_seq_send_incr(sock);
return len; return len;
error_send: error_send: