Compare commits

...

7 Commits

9 changed files with 31 additions and 9 deletions

5
MODULE
View File

@ -1,5 +0,0 @@
# Please change the following email with yours.
Email: dirk.zimoch@psi.ch
Module-Name: StreamDevice2
Description: StreamDevice2
Project-Name:

View File

@ -370,6 +370,9 @@ With the <code>0</code> flag, the value is unsigned, otherwise signed.
In output, the <em>precision</em> (or sizeof(long) whatever is less) least
significant bytes of the value are sign extended or zero extended
(depending on the <code>0</code> flag) to <em>width</em> bytes.
The default for <em>precision</em> is 1. Thus if you do not specify
the <em>precision</em>, only the least significant byte is written!
It is common error to write <code>out "%2r";</code> instead of <code>out "%.2r";</code>.
</p>
<p>
In input, <em>width</em> bytes are read and put into the value.
@ -380,7 +383,7 @@ the value is sign extended or zero extended, depending on the
<code>0</code> flag.
</p>
<p>
Example: <code>out "%.2r"</code>
Examples: <code>out "%.2r"; in "%02r";</code>
</p>
<a name="rawdouble"></a>

View File

@ -832,7 +832,7 @@ lockCallback(StreamIoStatus status)
case StreamIoSuccess:
break;
case StreamIoTimeout:
debug("%s: length, within %ld ms, device seems to be busy\n",
debug("%s: Cannot lock device within %ld ms, device seems to be busy\n",
name(), lockTimeout);
flags &= ~BusOwner;
finishProtocol(LockTimeout);

View File

@ -180,6 +180,7 @@ public:
#ifndef EPICS_3_13
extern "C" {
epicsExportAddress(int, streamDebug);
epicsExportAddress(int, streamError);
}
#endif

View File

@ -23,6 +23,7 @@
#include <stdio.h>
int streamDebug = 0;
int streamError = 0;
extern "C" {
#ifdef _WIN32
__declspec(dllexport)
@ -74,6 +75,7 @@ void StreamError(int line, const char* file, const char* fmt, ...)
void StreamVError(int line, const char* file, const char* fmt, va_list args)
{
char timestamp[40];
if (!streamError) return; // Error logging disabled
StreamPrintTimestampFunction(timestamp, 40);
#ifdef va_copy
if (StreamDebugFile)

View File

@ -28,6 +28,7 @@
#endif
extern int streamDebug;
extern int streamError;
extern void (*StreamPrintTimestampFunction)(char* buffer, int size);
void StreamError(int line, const char* file, const char* fmt, ...)

View File

@ -23,7 +23,7 @@
#define STREAM_MAJOR 2
#define STREAM_MINOR 7
#define STREAM_PATCHLEVEL 6
#define STREAM_PATCHLEVEL 8
#if defined(__vxworks) || defined(vxWorks)
#include <vxWorks.h>

View File

@ -20,6 +20,7 @@
***************************************************************/
#include <mbboDirectRecord.h>
#include "alarm.h"
#include "devStream.h"
#include <epicsExport.h>
@ -67,9 +68,27 @@ static long initRecord (dbCommon *record)
mbboDirectRecord *mbboD = (mbboDirectRecord *) record;
mbboD->mask <<= mbboD->shft;
/* Workaround for bug in mbboDirect record:
Put to VAL overwrites value to 0 if SEVR is INVALID_ALARM
Thus first write may send a wrong value.
*/
mbboD->sevr = 0;
return streamInitRecord (record, &mbboD->out, readData, writeData);
}
/* Unfortunately the bug also corrupts the next write to VAL after an I/O error.
Thus make sure the record is never left in INVALID_ALARM status.
*/
static long write(dbCommon *record)
{
long status = streamWrite(record);
if (record->nsev == INVALID_ALARM) record->nsev = MAJOR_ALARM;
return status;
}
struct {
long number;
DEVSUPFUN report;
@ -83,7 +102,7 @@ struct {
streamInit,
initRecord,
streamGetIointInfo,
streamWrite
write
};
epicsExportAddress(dset,devmbboDirectStream);

View File

@ -2,6 +2,7 @@ if (@ARGV[0] == "-3.13") {
shift;
} else {
print "variable(streamDebug, int)\n";
print "variable(streamError, int)\n";
print "registrar(streamRegistrar)\n";
}
print "driver(stream)\n";