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
Sven Gestegård Robertz
LabComm
Commits
9bfa7c14
Commit
9bfa7c14
authored
Oct 25, 2014
by
Sven Gestegård Robertz
Browse files
c encoding, java skipping pragma
parent
86728095
Changes
4
Hide whitespace changes
Inline
Side-by-side
examples/user_types/example_encoder.c
View file @
9bfa7c14
...
...
@@ -23,15 +23,15 @@ int main(int argc, char *argv[]) {
labcomm_default_scheduler
);
labcomm_encoder_register_test_twoLines
(
encoder
);
#ifdef
OLD_METADAT
A
struct
labcomm_encoder
*
mdt
=
labcomm_
metadata_begin
(
encoder
,
&
labcomm_signature_test_twoLines
);
labcomm_encoder_register_test_Comment
(
mdt
);
#if
n
def
WITHOUT_PRAGM
A
struct
labcomm_encoder
*
pb
=
labcomm_
pragma_builder_new
(
encoder
,
"se.lth.cs.sven.pragma"
);
labcomm_encoder_register_test_Comment
(
pb
);
test_Comment
comment
;
comment
.
id
=
17
;
comment
.
comment
=
"This is a metadata comment..."
;
labcomm_encode_test_Comment
(
mdt
,
&
comment
);
labcomm_
metadat
a_end
(
mdt
);
labcomm_encode_test_Comment
(
pb
,
&
comment
);
labcomm_
pragm
a_
s
end
(
pb
);
#endif
test_twoLines
tl
;
...
...
lib/c/labcomm.h
View file @
9bfa7c14
...
...
@@ -126,6 +126,10 @@ int labcomm_decoder_ioctl(struct labcomm_decoder *decoder,
...);
/* pragma */
struct
labcomm_encoder
*
labcomm_pragma_builder_new
(
struct
labcomm_encoder
*
e
,
char
*
pragma_type
)
;
int
labcomm_pragma_send
(
struct
labcomm_encoder
*
e
);
struct
labcomm_pragma_handler
{
//struct labcomm_decoder_registry *registry;
//TODO: implement map (char * pragma_type) --> decoder_registry *
...
...
lib/c/labcomm_encoder.c
View file @
9bfa7c14
...
...
@@ -97,7 +97,8 @@ struct pragma_packet_builder {
struct
labcomm_encoder
*
labcomm_pragma_builder_new
(
struct
labcomm_encoder
*
e
,
char
*
pragma_type
)
{
char
*
pragma_type
)
{
struct
labcomm_writer
*
dyn_writer
=
labcomm_dynamic_buffer_writer_new
(
e
->
memory
);
struct
labcomm_encoder
*
pb
=
labcomm_encoder_new
(
dyn_writer
,
...
...
lib/java/se/lth/control/labcomm/DecoderChannel.java
View file @
9bfa7c14
...
...
@@ -37,6 +37,12 @@ public class DecoderChannel implements Decoder {
ReadBytes
(
signature
,
signature_length
);
registry
.
add
(
index
,
name
,
signature
);
}
break
;
case
Constant
.
PRAGMA
:
{
System
.
out
.
println
(
"Pragma: skipping "
+
length
+
" bytes"
);
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
decodeByte
();
}
}
break
;
default
:
{
DecoderRegistry
.
Entry
e
=
registry
.
get
(
tag
);
if
(
e
==
null
)
{
...
...
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