From 9802290aa867eeb54be284e2c15d0eda2bd2da57 Mon Sep 17 00:00:00 2001 From: Sven Gestegard Robertz <sven.robertz@cs.lth.se> Date: Wed, 28 Jan 2015 10:17:14 +0100 Subject: [PATCH] small fixes. tests still not working --- examples/user_types/Makefile | 10 +++++----- lib/c/2014/labcomm_encoder.c | 11 +++++++++++ lib/csharp/se/lth/control/labcomm/Constant.cs | 1 + lib/csharp/se/lth/control/labcomm/DecoderChannel.cs | 6 ++++++ lib/java/Makefile | 4 ++++ 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/examples/user_types/Makefile b/examples/user_types/Makefile index 4af38f6..76c10d8 100644 --- a/examples/user_types/Makefile +++ b/examples/user_types/Makefile @@ -122,7 +122,7 @@ runwcs: build ExampleEncoder.exe ExampleDecoder.exe @PYTHONPATH=${LCDIR}/lib/python ../wiki_example/example_decoder.py encoded_data_j LabComm2014 @echo "************ running C# decoder: *****************" - @LD_LIBRARY_PATH=${LCDIR}/lib/c/ ./ExampleDecoder.exe encoded_data_j + @LD_LIBRARY_PATH=${LCDIR}/lib/c/ mono ./ExampleDecoder.exe encoded_data_j @echo "************ running C encoder: *****************" @LD_LIBRARY_PATH=${LCDIR}/lib/c/ ./example_encoder encoded_data_c @@ -137,7 +137,7 @@ runwcs: build ExampleEncoder.exe ExampleDecoder.exe @PYTHONPATH=${LCDIR}/lib/python ../wiki_example/example_decoder.py encoded_data_c LabComm2014 @echo "************ running C# decoder: *****************" - @./ExampleDecoder.exe encoded_data_c + @mono ./ExampleDecoder.exe encoded_data_c @echo "************ running python encoder: *****************" @PYTHONPATH=${LCDIR}/lib/python:${GENDIR} ./example_encoder.py encoded_data_p LabComm2014 @@ -152,10 +152,10 @@ runwcs: build ExampleEncoder.exe ExampleDecoder.exe PYTHONPATH=${LCDIR}/lib/python ../wiki_example/example_decoder.py encoded_data_p LabComm2014 @echo "************ running C# decoder: *****************" - @./ExampleDecoder.exe encoded_data_p + @mono ./ExampleDecoder.exe encoded_data_p @echo "************ running C# encoder: *****************" - @./ExampleEncoder.exe encoded_data_cs + @mono ./ExampleEncoder.exe encoded_data_cs @echo "************ running Java decoder: *****************" @java -cp .:${LCDIR}/lib/java/labcomm2014.jar:${GENDIR} Decoder encoded_data_cs @@ -167,7 +167,7 @@ runwcs: build ExampleEncoder.exe ExampleDecoder.exe @PYTHONPATH=${LCDIR}/lib/python ../wiki_example/example_decoder.py encoded_data_cs LabComm2014 @echo "************ running C# decoder: *****************" - @./ExampleDecoder.exe encoded_data_cs + @mono ./ExampleDecoder.exe encoded_data_cs diff --git a/lib/c/2014/labcomm_encoder.c b/lib/c/2014/labcomm_encoder.c index 56af811..4f81294 100644 --- a/lib/c/2014/labcomm_encoder.c +++ b/lib/c/2014/labcomm_encoder.c @@ -101,6 +101,8 @@ void labcomm_encoder_free(struct labcomm_encoder* e) labcomm_memory_free(memory, 0, e); } //================ +#undef WITHOUT_TYPE_DEFS +#ifndef WITHOUT_TYPE_DEFS static struct labcomm_encoder * wrapped_begin( struct labcomm_encoder *e) { struct labcomm_writer *dyn_writer = labcomm_dynamic_buffer_writer_new( @@ -308,19 +310,25 @@ out: labcomm_scheduler_writer_unlock(e->scheduler); return result; } +#endif //-------------- int labcomm_internal_encoder_type_register( struct labcomm_encoder *e, const struct labcomm_signature *signature) { +#ifndef WITHOUT_TYPE_DEFS struct labcomm_encoder *w = wrapped_begin(e); internal_reg_type(w, signature, FALSE); return wrapped_end(e, LABCOMM_TYPE_DEF, w); +#else + return 0; +#endif } int labcomm_internal_encoder_type_bind( struct labcomm_encoder *e, const struct labcomm_signature *signature) { +#ifndef WITHOUT_TYPE_DEFS int result = -EINVAL; int err; int sindex = labcomm_get_local_index(signature); @@ -343,6 +351,9 @@ int labcomm_internal_encoder_type_bind( out: labcomm_scheduler_writer_unlock(e->scheduler); return result; +#else + return 0; +#endif } int labcomm_internal_encoder_register( struct labcomm_encoder *e, diff --git a/lib/csharp/se/lth/control/labcomm/Constant.cs b/lib/csharp/se/lth/control/labcomm/Constant.cs index 5b247f6..3761544 100644 --- a/lib/csharp/se/lth/control/labcomm/Constant.cs +++ b/lib/csharp/se/lth/control/labcomm/Constant.cs @@ -11,6 +11,7 @@ namespace se.lth.control.labcomm { public const int SAMPLE_DEF = 0x02; public const int SAMPLE_REF = 0x03; public const int TYPE_DEF = 0x04; + public const int TYPE_BINDING = 0x05; public const int PRAGMA = 0x3f; public const int FIRST_USER_INDEX = 0x40; /* ..0xffffffff */ diff --git a/lib/csharp/se/lth/control/labcomm/DecoderChannel.cs b/lib/csharp/se/lth/control/labcomm/DecoderChannel.cs index aa86621..99e17fb 100644 --- a/lib/csharp/se/lth/control/labcomm/DecoderChannel.cs +++ b/lib/csharp/se/lth/control/labcomm/DecoderChannel.cs @@ -45,6 +45,12 @@ namespace se.lth.control.labcomm { ReadBytes(signature, signature_length); ref_registry.add(index, name, signature); } break; + case Constant.TYPE_DEF: + case Constant.TYPE_BINDING: { + for(int i=0; i<length;i++){ + decodeByte(); + } + } break; default: { DecoderRegistry.Entry e = def_registry.get(tag); if (e == null) { diff --git a/lib/java/Makefile b/lib/java/Makefile index 060aeeb..1dd78eb 100644 --- a/lib/java/Makefile +++ b/lib/java/Makefile @@ -39,3 +39,7 @@ gen/JAVAC: $(MODULES:%=se/lth/control/labcomm/%.java) $(MODULES:%=se/lth/control clean: rm -rf labcomm.jar labcomm2006.jar labcomm2014.jar gen + +.PHONY: distclean + +distclean: clean -- GitLab