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
Erik Jansson
LabComm
Commits
6b6da1ce
Commit
6b6da1ce
authored
Nov 26, 2014
by
Sven Gestegård Robertz
Browse files
temporarily unbroke java register: stop sending type defs
parent
ddb59c80
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/java/se/lth/control/labcomm/EncoderChannel.java
View file @
6b6da1ce
...
...
@@ -27,16 +27,19 @@ public class EncoderChannel implements Encoder {
}
public
void
register
(
SampleDispatcher
dispatcher
)
throws
IOException
{
int
index
=
def_registry
.
add
(
dispatcher
);
begin
(
Constant
.
SAMPLE_DEF
);
encodePacked32
(
index
);
encodeString
(
dispatcher
.
getName
());
byte
[]
signature
=
dispatcher
.
getSignature
();
encodePacked32
(
signature
.
length
);
for
(
int
i
=
0
;
i
<
signature
.
length
;
i
++)
{
encodeByte
(
signature
[
i
]);
if
(
dispatcher
.
getTypeDeclTag
()
==
Constant
.
SAMPLE_DEF
)
{
int
index
=
def_registry
.
add
(
dispatcher
);
//begin(Constant.SAMPLE_DEF);
begin
(
dispatcher
.
getTypeDeclTag
());
encodePacked32
(
index
);
encodeString
(
dispatcher
.
getName
());
byte
[]
signature
=
dispatcher
.
getSignature
();
encodePacked32
(
signature
.
length
);
for
(
int
i
=
0
;
i
<
signature
.
length
;
i
++)
{
encodeByte
(
signature
[
i
]);
}
end
(
null
);
}
end
(
null
);
}
public
void
registerSampleRef
(
SampleDispatcher
dispatcher
)
throws
IOException
{
...
...
lib/java/se/lth/control/labcomm/SampleDispatcher.java
View file @
6b6da1ce
...
...
@@ -11,5 +11,11 @@ public interface SampleDispatcher <T> {
public
void
decodeAndHandle
(
Decoder
decoder
,
SampleHandler
handler
)
throws
Exception
;
/** return the tag SAMPLE_DEF or TYPE_DEF, for use
* by encoder.register.
* TODO: refactor types, moving this to a super-interface
* applicable to both type and sample defs.
*/
public
byte
getTypeDeclTag
();
}
lib/python/labcomm/LabComm.py
View file @
6b6da1ce
...
...
@@ -848,7 +848,7 @@ class Decoder(Codec):
decl
=
self
.
index_to_decl
[
index
].
decode_decl
(
self
)
value
=
None
elif
index
<
i_USER
:
raise
e
xception
(
"Invalid type index %d"
%
index
)
raise
E
xception
(
"Invalid type index %d"
%
index
)
else
:
decl
=
self
.
index_to_decl
[
index
]
value
=
decl
.
decode
(
self
)
...
...
Write
Preview
Markdown
is supported
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