aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2000-10-09 19:54:42 +0000
committerFritz Elfert <felfert@to.com>2000-10-09 19:54:42 +0000
commit108cbdee49661d0c6e0a8980795c5593dc077d91 (patch)
treeedac72b1142644bfec1bc120a9bd7e0a049bcfa9
parent3f4b0b89d9e45a96dfe660890931aeaa0de87932 (diff)
downloadplptools-108cbdee49661d0c6e0a8980795c5593dc077d91.tar.gz
plptools-108cbdee49661d0c6e0a8980795c5593dc077d91.tar.bz2
plptools-108cbdee49661d0c6e0a8980795c5593dc077d91.zip
Added a hack for Jotter on S5mx and some experimental stuff.
-rw-r--r--.cvsignore1
-rw-r--r--lib/bufferstore.cc12
-rw-r--r--lib/rpcs.cc15
-rw-r--r--lib/rpcs32.cc21
-rw-r--r--lib/rpcs32.h2
5 files changed, 40 insertions, 11 deletions
diff --git a/.cvsignore b/.cvsignore
index d8f19db..012b49d 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -15,3 +15,4 @@ config.guess
config.sub
plptools-*.tar.gz
.vimsession
+.emacs.dektop
diff --git a/lib/bufferstore.cc b/lib/bufferstore.cc
index 7f2b49d..ea4bab6 100644
--- a/lib/bufferstore.cc
+++ b/lib/bufferstore.cc
@@ -64,7 +64,7 @@ void bufferStore::init() {
len = 0;
}
-void bufferStore::init(const unsigned char*_buff, long _len) {
+void bufferStore::init(const unsigned char *_buff, long _len) {
checkAllocd(_len);
start = 0;
len = _len;
@@ -95,8 +95,8 @@ unsigned int bufferStore::getDWord(long pos) const {
(buff[pos+start+3] << 24);
}
-const char* bufferStore::getString(long pos) const {
- return (const char*)buff + pos + start;
+const char * bufferStore::getString(long pos) const {
+ return (const char *)buff + pos + start;
}
ostream &operator<<(ostream &s, const bufferStore &m) {
@@ -137,19 +137,19 @@ void bufferStore::addByte(unsigned char cc) {
buff[len++] = cc;
}
-void bufferStore::addString(const char* s) {
+void bufferStore::addString(const char *s) {
int l = strlen(s);
checkAllocd(len + l);
memcpy(&buff[len], s, l);
len += l;
}
-void bufferStore::addStringT(const char* s) {
+void bufferStore::addStringT(const char *s) {
addString(s);
addByte(0);
}
-void bufferStore::addBytes(const unsigned char* s, int l) {
+void bufferStore::addBytes(const unsigned char *s, int l) {
checkAllocd(len + l);
memcpy(&buff[len], s, l);
len += l;
diff --git a/lib/rpcs.cc b/lib/rpcs.cc
index f1cac8a..d93fad0 100644
--- a/lib/rpcs.cc
+++ b/lib/rpcs.cc
@@ -153,12 +153,12 @@ getResponse(bufferStore & data, bool statusIsFirstByte)
Enum<rfsv::errs> ret;
if (skt->getBufferStore(data) == 1) {
if (statusIsFirstByte) {
- ret = (enum rfsv::errs)data.getByte(0);
+ ret = (enum rfsv::errs)((char)data.getByte(0));
data.discardFirstBytes(1);
} else {
int l = data.getLen();
if (l > 0) {
- ret = (enum rfsv::errs)data.getByte(data.getLen() - 1);
+ ret = (enum rfsv::errs)((char)data.getByte(data.getLen() - 1));
data.init((const unsigned char *)data.getString(), l - 1);
} else
ret = rfsv::E_PSI_GEN_FAIL;
@@ -198,7 +198,16 @@ execProgram(const char *program, const char *args)
int l = strlen(program);
for (int i = 127; i > l; i--)
a.addByte(0);
- a.addByte(strlen(args));
+
+ /**
+ * This is a hack for the jotter app on mx5 pro. (and probably others)
+ * Jotter seems to read it's arguments one char past normal apps.
+ * Without this hack, The Drive-Character gets lost. Other apps don't
+ * seem to be hurt by the additional blank.
+ */
+ a.addByte(strlen(args) + 1);
+ a.addByte(' ');
+
a.addStringT(args);
if (!sendCommand(EXEC_PROG, a))
return rfsv::E_PSI_FILE_DISC;
diff --git a/lib/rpcs32.cc b/lib/rpcs32.cc
index 85dd415..2175ef0 100644
--- a/lib/rpcs32.cc
+++ b/lib/rpcs32.cc
@@ -171,6 +171,22 @@ getMachineInfo(machineInfo &mi)
static unsigned long hhh;
Enum<rfsv::errs> rpcs32::
+regOpenIter(void)
+{
+ bufferStore a;
+ Enum<rfsv::errs> res;
+
+ a.addStringT("HKLM\\");
+ if (!sendCommand(rpcs::REG_OPEN_ITER, a))
+ return rfsv::E_PSI_FILE_DISC;
+ res = getResponse(a, true);
+ cout << "ro: r=" << res << " a=" << a << endl;
+ if (a.getLen() > 0)
+ hhh = a.getDWord(0);
+ return rfsv::E_PSI_GEN_NONE;
+}
+
+Enum<rfsv::errs> rpcs32::
configOpen(void)
{
bufferStore a;
@@ -179,8 +195,9 @@ configOpen(void)
if (!sendCommand(rpcs::CONFIG_OPEN, a))
return rfsv::E_PSI_FILE_DISC;
res = getResponse(a, true);
-cout << "co: r=" << res << " a=" << a << endl;
- hhh = a.getDWord(0);
+ cout << "co: r=" << res << " a=" << a << endl;
+ if (a.getLen() > 0)
+ hhh = a.getDWord(0);
return rfsv::E_PSI_GEN_NONE;
}
diff --git a/lib/rpcs32.h b/lib/rpcs32.h
index 973b142..3b2a3f7 100644
--- a/lib/rpcs32.h
+++ b/lib/rpcs32.h
@@ -17,7 +17,9 @@ class rpcs32 : public rpcs {
Enum<rfsv::errs> configRead(void);
#if 0
Enum<rfsv::errs> closeHandle(int);
+#endif
Enum<rfsv::errs> regOpenIter(void);
+#if 0
Enum<rfsv::errs> regReadIter(void);
Enum<rfsv::errs> regWrite(void);
Enum<rfsv::errs> regRead(void);