aboutsummaryrefslogtreecommitdiffstats
path: root/ncpd
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2000-10-09 19:11:21 +0000
committerFritz Elfert <felfert@to.com>2000-10-09 19:11:21 +0000
commit84bfdac1c9c1d6c82141fbe9f28861a127b9a22b (patch)
tree930ebd812b99496a19367ba2172f4701d133577a /ncpd
parent64535f8c1600f3501bec9aab107199a2c1293df6 (diff)
downloadplptools-84bfdac1c9c1d6c82141fbe9f28861a127b9a22b.tar.gz
plptools-84bfdac1c9c1d6c82141fbe9f28861a127b9a22b.tar.bz2
plptools-84bfdac1c9c1d6c82141fbe9f28861a127b9a22b.zip
Added experimental reset for packet()
Diffstat (limited to 'ncpd')
-rw-r--r--ncpd/link.cc1
-rw-r--r--ncpd/packet.cc14
-rw-r--r--ncpd/packet.h1
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();