Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
da281ebf97 | |||
c832efbcb6 | |||
b7b3bc0af0 | |||
4a42c3d43a | |||
624cc0134a | |||
d9d5d5f55d | |||
53ea75dc80 | |||
b1f4c2a7d9 | |||
d87e9cedd2 | |||
9e972d3f33 |
@ -1,6 +1,6 @@
|
||||
# StreamDevice
|
||||
|
||||
_StreamDevice_ is a generic [EPICS](https://www.aps.anl.gov/epics)
|
||||
_StreamDevice_ is a generic [EPICS](https://epics.anl.gov/)
|
||||
device support for devices with a "byte stream" based
|
||||
communication interface.
|
||||
That means devices that can be controlled by sending and receiving
|
||||
|
@ -53,7 +53,7 @@ RegisterConverter(MyConverter,"Q");
|
||||
</pre>
|
||||
|
||||
<a name="theory"></a>
|
||||
<h2>Theroy of Operation</h2>
|
||||
<h2>Theory of Operation</h2>
|
||||
|
||||
<a name="registration"></a>
|
||||
<h3>Registration </h3>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<h2>What is <em>StreamDevice</em>?</h2>
|
||||
<p>
|
||||
<em>StreamDevice</em> is a generic
|
||||
<a href="https://www.aps.anl.gov/epics" target="ex">EPICS</a>
|
||||
<a href="https://epics.anl.gov/" target="ex">EPICS</a>
|
||||
device support for devices with a "byte stream" based
|
||||
communication interface.
|
||||
That means devices that can be controlled by sending and
|
||||
|
@ -16,7 +16,7 @@
|
||||
<h2>1. Normal Processing</h2>
|
||||
<p>
|
||||
<em>StreamDevice</em> is an asynchronous device support
|
||||
(see <a href="http://www.aps.anl.gov/epics/base/R3-14/8-docs/AppDevGuide.pdf"
|
||||
(see <a href="http://www.aps.anl.gov/epics/base/R3-14/12-docs/AppDevGuide.pdf"
|
||||
target="ex">IOC Application Developer's Guide</a> chapter 12:
|
||||
Device Support).
|
||||
Whenever the record is processed, the <a href="protocol.html">protocol</a>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<p>
|
||||
<b>Note:</b> The scalcout record is part of the <i>calc</i> module of
|
||||
the <a target="ex"
|
||||
href="http://www.aps.anl.gov/aod/bcda/synApps/index.php"
|
||||
href="https://www.aps.anl.gov/BCDA/synApps"
|
||||
><em>synApps</em></a> package.
|
||||
Device support for scalcout records is only available for <i>calc</i>
|
||||
module release 2-4 or higher.
|
||||
|
@ -1315,12 +1315,12 @@ normal_format:
|
||||
break;
|
||||
}
|
||||
case StreamProtocolParser::skip:
|
||||
// ignore next input byte
|
||||
consumedInput++;
|
||||
// ignore next input byte (if exists)
|
||||
if (consumedInput < inputLine.length()) consumedInput++;
|
||||
break;
|
||||
case StreamProtocolParser::whitespace:
|
||||
// any number of whitespace (including 0)
|
||||
while (isspace(inputLine[consumedInput])) consumedInput++;
|
||||
while (consumedInput < inputLine.length() && isspace(inputLine[consumedInput])) consumedInput++;
|
||||
break;
|
||||
case esc:
|
||||
// escaped literal byte
|
||||
|
@ -831,7 +831,7 @@ initRecord(const char* filename, const char* protocol,
|
||||
return ERROR;
|
||||
}
|
||||
debug("Stream::initRecord %s: initialized. %s\n",
|
||||
name(), convert==2 ?
|
||||
name(), convert == DO_NOT_CONVERT ?
|
||||
"convert" : "don't convert");
|
||||
return convert;
|
||||
}
|
||||
@ -843,6 +843,7 @@ process()
|
||||
debug("Stream::process(%s)\n", name());
|
||||
if (record->pact || record->scan == SCAN_IO_EVENT)
|
||||
{
|
||||
record->proc = 0;
|
||||
if (status != NO_ALARM)
|
||||
{
|
||||
debug("Stream::process(%s) error status=%s (%d)\n",
|
||||
@ -854,7 +855,7 @@ process()
|
||||
return false;
|
||||
}
|
||||
debug("Stream::process(%s) ready. %s\n",
|
||||
name(), convert==2 ?
|
||||
name(), convert == DO_NOT_CONVERT ?
|
||||
"convert" : "don't convert");
|
||||
return true;
|
||||
}
|
||||
@ -868,11 +869,15 @@ process()
|
||||
debug("Stream::process(%s) start\n", name());
|
||||
status = NO_ALARM;
|
||||
convert = OK;
|
||||
if (!startProtocol(record->proc==2 ? StreamCore::StartInit : StreamCore::StartNormal))
|
||||
if (!startProtocol(record->proc == 2 ? StreamCore::StartInit : StreamCore::StartNormal))
|
||||
{
|
||||
debug("Stream::process(%s): could not start %sprotocol, status=%d\n",
|
||||
name(), record->proc==2 ? "@init " : "", status);
|
||||
debug("Stream::process(%s): could not start %sprotocol, status=%s (%d)\n",
|
||||
name(), record->proc == 2 ? "@init " : "",
|
||||
status >= 0 && status < ALARM_NSTATUS ?
|
||||
epicsAlarmConditionStrings[status] : "ERROR",
|
||||
status);
|
||||
(void) recGblSetSevr(record, status ? status : UDF_ALARM, INVALID_ALARM);
|
||||
record->proc = 0;
|
||||
return false;
|
||||
}
|
||||
debug("Stream::process(%s): protocol started\n", name());
|
||||
@ -920,7 +925,7 @@ scan(format_t *format, void* value, size_t maxStringSize)
|
||||
currentValueLength = scanValue(*format->priv, *(double*)value);
|
||||
break;
|
||||
case DBF_STRING:
|
||||
currentValueLength = scanValue(*format->priv, (char*)value, size);
|
||||
currentValueLength = scanValue(*format->priv, (char*)value, size);
|
||||
break;
|
||||
default:
|
||||
error("INTERNAL ERROR (%s): Illegal format type %d\n",
|
||||
|
Reference in New Issue
Block a user