Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tommy Olofsson
LabComm
Commits
1c11e3c9
Commit
1c11e3c9
authored
Jan 23, 2015
by
Sven Gestegård Robertz
Browse files
more on type_defs
parent
f60d2c16
Changes
1
Show whitespace changes
Inline
Side-by-side
doc/tech_report.tex
View file @
1c11e3c9
...
...
@@ -330,11 +330,7 @@ i.e.,
<sample
_
data> <user
_
id: 40> <length: 14> <packed
_
sample
_
data>
\end{verbatim}
\section
{
Technical details
}
TODO: better section title
\subsection
{
Type and sample declarations
}
\section
{
Type and sample declarations
}
LabComm has two constructs for declaring sample types,
\emph
{
sample
declarations
}
and
\emph
{
type declarations
}
. A sample declaration is used
...
...
@@ -386,7 +382,7 @@ come from two independent number series. To identify which
\verb
+
TYPE_DECL
+
a particular
\verb
+
SAMPLE_DECL
+
corresponds to, the
\verb
+
TYPE_BINDING
+
packet is used.
\subs
ubs
ection
{
Example
}
\subsection
{
Example
}
The labcomm declaration
\lstinputlisting
[basicstyle=\footnotesize\ttfamily]
{
../examples/user
_
types/test.lc
}
...
...
@@ -418,6 +414,22 @@ Note that the id 0x40 is used both for the \verb+TYPE_DECL+ of
\verb
+
TYPE_BINDING
+
binds the sample id
\verb
+
0x40
+
to the type id
\verb
+
0x44
+
.
\subsection
{
Run-time behaviour
}
When a sample type is registered on an encoder, a
\verb
+
SAMPLE_DECL
+
(i.e., the flat signature) is always generated on that encoder channel.
If the sample depends on user types (i.e., typedefs),
\verb
+
TYPE_DECL
+
packets are encoded, recursively, for the dependent types and a
corresponding
\verb
+
TYPE_BINDING
+
is encoded.
If a
\verb
+
TYPE_DECL
+
is included via multiple sample types, or
dependency paths, an encoder may choose to only encode it once, but is
not required to do so. However, if multiple
\verb
+
TYPE_DECL
+
packets are
sent for the same
\verb
+
typedef
+
, the encoder must use the same
\verb
+
type_id
+
.
\section
{
Ideas/Discussion
}
:
...
...
@@ -515,8 +527,8 @@ The built-in data types are encoded as follows:
<type
_
binding> |
<sample
_
data> )
<version> := <string>
<sample
_
de
f>
:= <sample
_
id> <string> <type>
<type
_
de
f>
:= <type
_
id> <string> <type>
<sample
_
de
cl>
:= <sample
_
id> <string> <type>
<type
_
de
cl>
:= <type
_
id> <string> <type>
<type
_
binding> := <sample
_
id> <type
_
id>
<user
_
id> := 0x40..0xffffffff
<sample
_
id> : <user
_
id>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment