From 84bfdac1c9c1d6c82141fbe9f28861a127b9a22b Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Mon, 9 Oct 2000 19:11:21 +0000 Subject: Added experimental reset for packet() --- ncpd/link.cc | 1 + ncpd/packet.cc | 14 ++++++++++++++ ncpd/packet.h | 1 + 3 files changed, 16 insertions(+) diff --git a/ncpd/link.cc b/ncpd/link.cc index 9b0e5f3..fac136b 100644 --- a/ncpd/link.cc +++ b/ncpd/link.cc @@ -61,6 +61,7 @@ reset() { somethingToSend = false; timesSent = 0; failed = false; +// p->reset(); } short int link:: diff --git a/ncpd/packet.cc b/ncpd/packet.cc index 53774d6..2aa0509 100644 --- a/ncpd/packet.cc +++ b/ncpd/packet.cc @@ -62,6 +62,20 @@ iow(_iow) iow.addIO(fd); } +void packet::reset() +{ + iow.remIO(fd); + ser_exit(fd); + usleep(100000); + inLen = outLen = termLen = 0; + foundSync = 0; + esc = false; + crcIn = crcOut = 0; + + fd = init_serial(devname, baud, 0); + iow.addIO(fd); +} + short int packet:: getVerbose() { diff --git a/ncpd/packet.h b/ncpd/packet.h index 5c4bb4f..19385d3 100644 --- a/ncpd/packet.h +++ b/ncpd/packet.h @@ -45,6 +45,7 @@ class packet { void setVerbose(short int); short int getVerbose(); bool linkFailed(); + void reset(); private: bool terminated(); -- cgit v1.2.3