Reset Timer T1, TX slots w/patty_ax25_sock_reset()

Make patty_ax25_sock_reset() reset Timer T1 and zero out the len and ack
fields of each TX slot
This commit is contained in:
XANTRONIX Development 2020-08-20 22:50:50 -05:00 committed by XANTRONIX Industrial
parent 56b8b90727
commit 645e2a465f

View file

@ -248,6 +248,9 @@ void patty_ax25_sock_init(patty_ax25_sock *sock) {
* AX.25 v2.2, Section 6.5 "Resetting Procedure"
*/
void patty_ax25_sock_reset(patty_ax25_sock *sock) {
int i,
slots = tx_slots(sock);
sock->flow = PATTY_AX25_SOCK_READY;
sock->vs = 0;
sock->vr = 0;
@ -255,7 +258,14 @@ void patty_ax25_sock_reset(patty_ax25_sock *sock) {
sock->retries = sock->n_retry;
sock->rx_pending = 0;
patty_timer_clear(&sock->timer_t1);
for (i=0; i<slots; i++) {
struct slot *slot = tx_slot(sock, i);
slot->len = 0;
slot->ack = 0;
}
patty_timer_start(&sock->timer_t1);
patty_timer_clear(&sock->timer_t2);
patty_timer_clear(&sock->timer_t3);
}