diff options
author | Fritz Elfert <felfert@to.com> | 2000-10-09 19:11:21 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2000-10-09 19:11:21 +0000 |
commit | 84bfdac1c9c1d6c82141fbe9f28861a127b9a22b (patch) | |
tree | 930ebd812b99496a19367ba2172f4701d133577a | |
parent | 64535f8c1600f3501bec9aab107199a2c1293df6 (diff) | |
download | plptools-84bfdac1c9c1d6c82141fbe9f28861a127b9a22b.tar.gz plptools-84bfdac1c9c1d6c82141fbe9f28861a127b9a22b.tar.bz2 plptools-84bfdac1c9c1d6c82141fbe9f28861a127b9a22b.zip |
Added experimental reset for packet()
-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(); |