diff options
Diffstat (limited to 'ncpd')
-rw-r--r-- | ncpd/link.cc | 1 | ||||
-rw-r--r-- | ncpd/packet.cc | 14 | ||||
-rw-r--r-- | ncpd/packet.h | 1 |
3 files changed, 16 insertions, 0 deletions
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(); |