Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • anders_blomdell/labcomm
  • klaren/labcomm
  • tommyo/labcomm
  • erikj/labcomm
  • sven/labcomm
5 results
Select Git revision
Loading items
Show changes
Showing
with 138 additions and 417 deletions
......@@ -42,7 +42,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="LCRobot.cs" />
<Compile Include="Program.cs" />
<Compile Include="Specification.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
......
encoded_data
encoded_data06
example_decoder
example_decoder06
example_encoder
example_encoder06
gen
gen06
......@@ -2,7 +2,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import se.lth.control.labcomm.DecoderChannel;
import se.lth.control.labcomm2014.DecoderChannel;
public class Decoder
implements theTwoInts.Handler, anotherTwoInts.Handler, IntString.Handler, TwoArrays.Handler, TwoFixedArrays.Handler, doavoid.Handler
......
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import se.lth.control.labcomm2006.DecoderChannel;
public class Decoder06
implements theTwoInts.Handler, anotherTwoInts.Handler, IntString.Handler, TwoArrays.Handler, TwoFixedArrays.Handler
{
DecoderChannel decoder;
public Decoder06(InputStream in)
throws Exception
{
decoder = new DecoderChannel(in);
theTwoInts.register(decoder, this);
anotherTwoInts.register(decoder, this);
IntString.register(decoder, this);
TwoArrays.register(decoder, this);
TwoFixedArrays.register(decoder, this);
try {
System.out.println("Running decoder.");
decoder.run();
} catch (java.io.EOFException e) {
System.out.println("Decoder reached end of file.");
}
}
public void printTwoInts(TwoInts d) throws java.io.IOException {
System.out.println("a="+d.a+", b="+d.b);
}
public void handle_theTwoInts(TwoInts d) throws java.io.IOException {
System.out.print("Got theTwoInts: ");
printTwoInts(d);
}
public void handle_anotherTwoInts(TwoInts d) throws java.io.IOException {
System.out.print("Got anotherheTwoInts: ");
printTwoInts(d);
}
public void handle_IntString(IntString d) throws java.io.IOException {
System.out.println("Got IntString, x="+d.x+", s="+d.s);
}
public void handle_TwoArrays(TwoArrays d) throws java.io.IOException {
System.out.println("Got TwoArrays:");
for(int i=0; i<d.fixed.length; i++) {
System.out.print(d.fixed[i]+" ");
}
System.out.println();
for(int i=0; i<d.variable[0].length; i++) {
System.out.print(d.variable[0][i]+" ");
System.out.print(d.variable[1][i]+" ");
}
System.out.println();
}
public void handle_TwoFixedArrays(TwoFixedArrays d) throws java.io.IOException {
System.out.println("Got TwoFixedArrays:");
for(int i=0; i<d.a.length; i++) {
System.out.print(d.a[i]+" ");
}
System.out.println();
for(int i=0; i<d.b[0].length; i++) {
System.out.print(d.b[0][i]+" ");
System.out.print(d.b[1][i]+" ");
}
System.out.println();
}
public static void main(String[] arg) throws Exception {
Decoder06 example = new Decoder06(
new FileInputStream(new File(arg[0]))
);
}
}
......@@ -2,7 +2,7 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import se.lth.control.labcomm.EncoderChannel;
import se.lth.control.labcomm2014.EncoderChannel;
/**
* Simple encoder
......@@ -16,12 +16,14 @@ public class Encoder
throws Exception
{
encoder = new EncoderChannel(out);
doavoid.register(encoder);
theTwoInts.register(encoder);
IntString.register(encoder);
TwoArrays.register(encoder);
}
public void doEncode() throws java.io.IOException {
TwoInts x = new TwoInts();
x.a = 17;
x.b = 42;
......@@ -35,6 +37,9 @@ public class Encoder
// ta.variable = new int[][] {{1,2},{0x11,0x12},{0x21,0x22},{0x31,0x32}};
ta.variable = new int[][] {{1,2, 3, 4},{0x21,0x22,0x23,0x24}};
System.out.println("Encoding doavoid");
doavoid.encode(encoder);
System.out.println("Encoding theTwoInts, a="+x.a+", b="+x.b);
theTwoInts.encode(encoder, x);
......
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import se.lth.control.labcomm2006.EncoderChannel;
/**
* Simple encoder
*/
public class Encoder06
{
EncoderChannel encoder;
public Encoder06(OutputStream out)
throws Exception
{
encoder = new EncoderChannel(out);
theTwoInts.register(encoder);
IntString.register(encoder);
TwoArrays.register(encoder);
}
public void doEncode() throws java.io.IOException {
TwoInts x = new TwoInts();
x.a = 17;
x.b = 42;
IntString y = new IntString();
y.x = 37;
y.s = "Testing, testing";
TwoArrays ta = new TwoArrays();
ta.fixed = new int[] {14, 25};
// ta.variable = new int[][] {{1,2},{0x11,0x12},{0x21,0x22},{0x31,0x32}};
ta.variable = new int[][] {{1,2, 3, 4},{0x21,0x22,0x23,0x24}};
System.out.println("Encoding theTwoInts, a="+x.a+", b="+x.b);
theTwoInts.encode(encoder, x);
System.out.println("Encoding IntString, x="+y.x+", s="+y.s);
IntString.encode(encoder, y);
System.out.println("Encoding TwoArrays");
for(int i = 0; i < ta.variable.length; i++) {
for(int j=0; j < ta.variable[0].length; j++)
System.out.println(ta.variable[i][j]);
System.out.println("---");
}
TwoArrays.encode(encoder, ta);
}
public static void main(String[] arg) throws Exception {
FileOutputStream fos = new FileOutputStream(arg[0]);
Encoder06 example = new Encoder06(fos);
example.doEncode();
fos.close();
}
}
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import se.lth.control.labcomm2014.EncoderChannel;
/**
* Simple encoder
*/
public class EncoderIS
{
EncoderChannel encoder;
public EncoderIS(OutputStream out)
throws Exception
{
encoder = new EncoderChannel(out);
// doavoid.register(encoder);
// theTwoInts.register(encoder);
IntString.register(encoder);
// TwoArrays.register(encoder);
}
public void doEncodeIS() throws java.io.IOException {
IntString a = new IntString();
a.x = 17;
a.s = "A string";
IntString b = new IntString();
b.x = 9;
b.s = "Hej";
IntString c = new IntString();
c.x = 133742;
c.s = "Thirteenthirtysevenfourtytwo";
System.out.println("Encoding IntStrings");
IntString.encode(encoder, a);
IntString.encode(encoder, b);
IntString.encode(encoder, c);
}
public static void main(String[] arg) throws Exception {
FileOutputStream fos = new FileOutputStream(arg[0]);
EncoderIS example = new EncoderIS(fos);
example.doEncodeIS();
fos.close();
}
}
......@@ -4,10 +4,7 @@ clean:
distclean:
rm -rf gen
rm -rf gen06
rm -f *.class
rm -f example_encoder
rm -f example_encoder06
rm -f example_decoder
rm -f example_decoder06
rm -f encoded_data
#!/bin/sh
set -x
set -e
### Example compile script, showing the steps required to build a labcomm application
### (including compiler and libs). Also illustrates how versions 2013 and 2006 coexist
......@@ -5,34 +8,15 @@
(cd ../..; make all)
mkdir -p gen
java -jar ../../compiler/labcomm_compiler.jar --java=gen --c=gen/simple.c --h=gen/simple.h --python=gen/simple.py simple.lc
java -jar ../../compiler/labcomm2014_compiler.jar --java=gen --c=gen/simple.c --h=gen/simple.h --python=gen/simple.py simple.lc
javac -cp ../../lib/java/labcomm2014.jar:. gen/*.java Encoder.java Decoder.java
gcc -Wall -Werror -Wno-unused-function \
-I. -I../../lib/c -L../../lib/c \
-I. -I../../lib/c/2014 -L../../lib/c \
-o example_encoder example_encoder.c gen/simple.c \
-llabcomm2014 -Tlabcomm.linkscript
gcc -Wall -Werror -I . -I ../../lib/c -L../../lib/c \
-llabcomm2014
gcc -Wall -Werror -I . -I ../../lib/c/2014 -L../../lib/c \
-o example_decoder example_decoder.c gen/simple.c \
-llabcomm2014 -Tlabcomm.linkscript
# For version 2006
mkdir -p gen06
java -jar ../../compiler/labcomm_compiler.jar --ver=2006 --java=gen06 --c=gen06/simple.c --h=gen06/simple.h --python=gen06/simple.py simple.lc
javac -cp ../../lib/java/labcomm2006.jar:. gen06/*.java Encoder06.java Decoder06.java
gcc -Wall -Werror -I. -I../../lib/c/2006 -L../../lib/c \
-o example_encoder06 example_encoder06.c gen06/simple.c \
-llabcomm -Tlabcomm.linkscript
gcc -Wall -Werror -I . -I ../../lib/c/2006 -L../../lib/c \
-o example_decoder06 example_decoder06.c gen06/simple.c \
-llabcomm -Tlabcomm.linkscript
#gcc -o example_encoder -I . -I ../../lib/c example_encoder.c gen/simple.c ../../lib/c/labcomm.c ../../lib/c/labcomm_fd_reader_writer.c
#gcc -o example_decoder -I . -I ../../lib/c example_decoder.c gen/simple.c ../../lib/c/labcomm.c ../../lib/c/labcomm_fd_reader_writer.c
-llabcomm2014
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <labcomm_fd_reader.h>
#include <labcomm_default_error_handler.h>
#include <labcomm_default_memory.h>
#include <labcomm_default_scheduler.h>
#include <labcomm2014_fd_reader.h>
#include <labcomm2014_default_error_handler.h>
#include <labcomm2014_default_memory.h>
#include <labcomm2014_default_scheduler.h>
#include "gen/simple.h"
#include <stdio.h>
static void handle_simple_doavoid(simple_doavoid *v, void *context) {
printf("Got a void.\n");
}
static void handle_simple_theTwoInts(simple_TwoInts *v,void *context) {
printf("Got theTwoInts. a=%d, b=%d\n", v->a, v->b);
}
......@@ -53,32 +57,33 @@ static void handle_simple_TwoFixedArrays(simple_TwoFixedArrays *d,void *context)
int main(int argc, char *argv[]) {
int fd;
struct labcomm_decoder *decoder;
struct labcomm2014_decoder *decoder;
void *context = NULL;
char *filename = argv[1];
printf("C decoder reading from %s\n", filename);
fd = open(filename, O_RDONLY);
decoder = labcomm_decoder_new(labcomm_fd_reader_new(
labcomm_default_memory, fd, 1),
labcomm_default_error_handler,
labcomm_default_memory,
labcomm_default_scheduler);
decoder = labcomm2014_decoder_new(labcomm2014_fd_reader_new(
labcomm2014_default_memory, fd, 1),
labcomm2014_default_error_handler,
labcomm2014_default_memory,
labcomm2014_default_scheduler);
if (!decoder) {
printf("Failed to allocate decoder %s:%d\n", __FUNCTION__, __LINE__);
return 1;
}
labcomm_decoder_register_simple_theTwoInts(decoder, handle_simple_theTwoInts, context);
labcomm_decoder_register_simple_anotherTwoInts(decoder, handle_simple_anotherTwoInts, context);
labcomm_decoder_register_simple_IntString(decoder, handle_simple_IntString, context);
labcomm_decoder_register_simple_TwoArrays(decoder, handle_simple_TwoArrays, context);
labcomm_decoder_register_simple_TwoFixedArrays(decoder, handle_simple_TwoFixedArrays, context);
labcomm2014_decoder_register_simple_doavoid(decoder, handle_simple_doavoid, context);
labcomm2014_decoder_register_simple_theTwoInts(decoder, handle_simple_theTwoInts, context);
labcomm2014_decoder_register_simple_anotherTwoInts(decoder, handle_simple_anotherTwoInts, context);
labcomm2014_decoder_register_simple_IntString(decoder, handle_simple_IntString, context);
labcomm2014_decoder_register_simple_TwoArrays(decoder, handle_simple_TwoArrays, context);
labcomm2014_decoder_register_simple_TwoFixedArrays(decoder, handle_simple_TwoFixedArrays, context);
printf("Decoding:\n");
labcomm_decoder_run(decoder);
labcomm2014_decoder_run(decoder);
printf("--- End Of File ---:\n");
labcomm_decoder_free(decoder);
labcomm2014_decoder_free(decoder);
return 0;
}
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <labcomm2006_fd_reader.h>
#include <labcomm2006_default_error_handler.h>
#include <labcomm2006_default_memory.h>
#include <labcomm2006_default_scheduler.h>
#include "gen06/simple.h"
#include <stdio.h>
static void handle_simple_theTwoInts(simple_TwoInts *v,void *context) {
printf("Got theTwoInts. a=%d, b=%d\n", v->a, v->b);
}
static void handle_simple_anotherTwoInts(simple_TwoInts *v,void *context) {
printf("Got anotherTwoInts. a=%d, b=%d\n", v->a, v->b);
}
static void handle_simple_IntString(simple_IntString *v,void *context) {
printf("Got IntString. x=%d, s=%s\n", v->x, v->s);
}
static void handle_simple_TwoArrays(simple_TwoArrays *d,void *context) {
printf("Got TwoArrays:");
int i,j;
for(i=0; i<2; i++) {
printf("%d ",d->fixed.a[i]);
}
printf("\n");
for(i=0; i<2; i++) {
for(j=0; j<d->variable.n_1; j++) {
printf("%d ",d->variable.a[i *d->variable.n_1 + j]);
}
printf("\n");
}
printf("\n");
}
static void handle_simple_TwoFixedArrays(simple_TwoFixedArrays *d,void *context) {
printf("Got TwoFixedArrays:");
int i,j;
for(i=0; i<2; i++) {
printf("%d ",d->a.a[i]);
}
printf("\n");
for(i=0; i<2; i++) {
for(j=0; j<3; j++) {
printf("%d ",d->b.a[i][j]);
}
printf("\n");
}
}
int main(int argc, char *argv[]) {
int fd;
struct labcomm2006_decoder *decoder;
void *context = NULL;
char *filename = argv[1];
printf("C decoder reading from %s\n", filename);
fd = open(filename, O_RDONLY);
decoder = labcomm2006_decoder_new(labcomm2006_fd_reader_new(
labcomm2006_default_memory, fd, 1),
labcomm2006_default_error_handler,
labcomm2006_default_memory,
labcomm2006_default_scheduler);
if (!decoder) {
printf("Failed to allocate decoder %s:%d\n", __FUNCTION__, __LINE__);
return 1;
}
labcomm2006_decoder_register_simple_theTwoInts(decoder, handle_simple_theTwoInts, context);
labcomm2006_decoder_register_simple_anotherTwoInts(decoder, handle_simple_anotherTwoInts, context);
labcomm2006_decoder_register_simple_IntString(decoder, handle_simple_IntString, context);
labcomm2006_decoder_register_simple_TwoArrays(decoder, handle_simple_TwoArrays, context);
labcomm2006_decoder_register_simple_TwoFixedArrays(decoder, handle_simple_TwoFixedArrays, context);
printf("Decoding:\n");
labcomm2006_decoder_run(decoder);
printf("--- End Of File ---:\n");
labcomm2006_decoder_free(decoder);
return 0;
}
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <labcomm_fd_writer.h>
#include <labcomm_default_error_handler.h>
#include <labcomm_default_memory.h>
#include <labcomm_default_scheduler.h>
#include <labcomm2014_fd_writer.h>
#include <labcomm2014_default_error_handler.h>
#include <labcomm2014_default_memory.h>
#include <labcomm2014_default_scheduler.h>
#include "gen/simple.h"
#include <stdio.h>
int main(int argc, char *argv[]) {
int fd;
struct labcomm_encoder *encoder;
struct labcomm2014_encoder *encoder;
char *filename = argv[1];
printf("C encoder writing to %s\n", filename);
fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644);
encoder = labcomm_encoder_new(labcomm_fd_writer_new(
labcomm_default_memory, fd, 1),
labcomm_default_error_handler,
labcomm_default_memory,
labcomm_default_scheduler);
labcomm_encoder_register_simple_doavoid(encoder);
labcomm_encoder_register_simple_theTwoInts(encoder);
labcomm_encoder_register_simple_anotherTwoInts(encoder);
labcomm_encoder_register_simple_IntString(encoder);
labcomm_encode_simple_doavoid(encoder);
encoder = labcomm2014_encoder_new(labcomm2014_fd_writer_new(
labcomm2014_default_memory, fd, 1),
labcomm2014_default_error_handler,
labcomm2014_default_memory,
labcomm2014_default_scheduler);
labcomm2014_encoder_register_simple_doavoid(encoder);
labcomm2014_encoder_register_simple_theTwoInts(encoder);
labcomm2014_encoder_register_simple_anotherTwoInts(encoder);
labcomm2014_encoder_register_simple_IntString(encoder);
labcomm2014_encode_simple_doavoid(encoder);
simple_IntString is;
is.x = 24;
is.s = "Hello, LabComm!";
printf("Encoding IntString, x=%d, s=%s\n", is.x, is.s);
labcomm_encode_simple_IntString(encoder, &is);
labcomm2014_encode_simple_IntString(encoder, &is);
simple_theTwoInts ti;
ti.a = 13;
ti.b = 37;
printf("Encoding theTwoInts, a=%d, b=%d\n", ti.a, ti.b);
labcomm_encode_simple_theTwoInts(encoder, &ti);
labcomm2014_encode_simple_theTwoInts(encoder, &ti);
simple_anotherTwoInts ati;
ati.a = 23;
ati.b = 47;
printf("Encoding anotherTwoInts, a=%d, b=%d\n", ati.a, ati.b);
labcomm_encode_simple_anotherTwoInts(encoder, &ati);
labcomm2014_encode_simple_anotherTwoInts(encoder, &ati);
int foo[20];
labcomm_encoder_register_simple_TwoArrays(encoder);
labcomm2014_encoder_register_simple_TwoArrays(encoder);
simple_TwoArrays ta;
ta.fixed.a[0] = 17;
......@@ -61,12 +61,12 @@ int main(int argc, char *argv[]) {
}
printf("Encoding TwoArrays...\n");
labcomm_encode_simple_TwoArrays(encoder, &ta);
labcomm2014_encode_simple_TwoArrays(encoder, &ta);
ti.a = 23;
ti.b = 47;
printf("Encoding theTwoInts, a=%d, b=%d\n", ti.a, ti.b);
labcomm_encode_simple_theTwoInts(encoder, &ti);
labcomm2014_encode_simple_theTwoInts(encoder, &ti);
simple_TwoFixedArrays tfa;
......@@ -82,8 +82,8 @@ int main(int argc, char *argv[]) {
tfa.b.a[1][2] = 63;
printf("Encoding TwoFixedArrays...\n");
labcomm_encoder_register_simple_TwoFixedArrays(encoder);
labcomm_encode_simple_TwoFixedArrays(encoder, &tfa);
labcomm2014_encoder_register_simple_TwoFixedArrays(encoder);
labcomm2014_encode_simple_TwoFixedArrays(encoder, &tfa);
return 0;
}
#!/usr/bin/python
import labcomm
import labcomm2014
import sys
import simple
if __name__ == '__main__':
version = sys.argv[2] if len(sys.argv) == 3 else "LabComm2014"
encoder = labcomm.Encoder(labcomm.StreamWriter(open(sys.argv[1], 'w')), version)
encoder = labcomm2014.Encoder(labcomm2014.StreamWriter(open(sys.argv[1], 'w')), version)
encoder.add_decl(simple.theTwoInts.signature)
encoder.add_decl(simple.IntString.signature)
foo = simple.theTwoInts()
......
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <labcomm2006_fd_writer.h>
#include <labcomm2006_default_error_handler.h>
#include <labcomm2006_default_memory.h>
#include <labcomm2006_default_scheduler.h>
#include "gen06/simple.h"
#include <stdio.h>
int main(int argc, char *argv[]) {
int fd;
struct labcomm2006_encoder *encoder;
char *filename = argv[1];
printf("C encoder writing to %s\n", filename);
fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644);
encoder = labcomm2006_encoder_new(labcomm2006_fd_writer_new(
labcomm2006_default_memory, fd, 1),
labcomm2006_default_error_handler,
labcomm2006_default_memory,
labcomm2006_default_scheduler);
labcomm2006_encoder_register_simple_theTwoInts(encoder);
labcomm2006_encoder_register_simple_anotherTwoInts(encoder);
labcomm2006_encoder_register_simple_IntString(encoder);
simple_IntString is;
is.x = 24;
is.s = "Hello, LabComm!";
printf("Encoding IntString, x=%d, s=%s\n", is.x, is.s);
labcomm2006_encode_simple_IntString(encoder, &is);
simple_theTwoInts ti;
ti.a = 13;
ti.b = 37;
printf("Encoding theTwoInts, a=%d, b=%d\n", ti.a, ti.b);
labcomm2006_encode_simple_theTwoInts(encoder, &ti);
simple_anotherTwoInts ati;
ati.a = 23;
ati.b = 47;
printf("Encoding anotherTwoInts, a=%d, b=%d\n", ati.a, ati.b);
labcomm2006_encode_simple_anotherTwoInts(encoder, &ati);
int foo[20];
labcomm2006_encoder_register_simple_TwoArrays(encoder);
simple_TwoArrays ta;
ta.fixed.a[0] = 17;
ta.fixed.a[1] = 42;
ta.variable.n_1 = 10;
ta.variable.a = foo;
int k;
for(k=0; k<20; k++) {
foo[k] = k;
}
printf("Encoding TwoArrays...\n");
labcomm2006_encode_simple_TwoArrays(encoder, &ta);
ti.a = 23;
ti.b = 47;
printf("Encoding theTwoInts, a=%d, b=%d\n", ti.a, ti.b);
labcomm2006_encode_simple_theTwoInts(encoder, &ti);
simple_TwoFixedArrays tfa;
tfa.a.a[0] = 41;
tfa.a.a[1] = 42;
tfa.b.a[0][0] = 51;
tfa.b.a[0][1] = 52;
tfa.b.a[0][2] = 53;
tfa.b.a[1][0] = 61;
tfa.b.a[1][1] = 62;
tfa.b.a[1][2] = 63;
printf("Encoding TwoFixedArrays...\n");
labcomm2006_encoder_register_simple_TwoFixedArrays(encoder);
labcomm2006_encode_simple_TwoFixedArrays(encoder, &tfa);
return 0;
}
......@@ -17,20 +17,3 @@ java -cp .:../../lib/java/labcomm2014.jar:gen Decoder encoded_data
echo "running python decoder (from wiki_example):"
PYTHONPATH=../../lib/python ../wiki_example/example_decoder.py encoded_data LabComm2014
echo
echo "*******************************************************"
echo "*** Running C and Java example for version 2006 ***"
echo "*******************************************************"
echo
java -cp .:../../lib/java/labcomm2006.jar:gen06 Encoder06 encoded_data06
./example_decoder06 encoded_data06
PYTHONPATH=../../lib/python:gen ./example_encoder.py encoded_data06 LabComm2006
java -cp .:../../lib/java/labcomm2006.jar:gen06 Decoder06 encoded_data06
./example_encoder06 encoded_data06
java -cp .:../../lib/java/labcomm2006.jar:gen06 Decoder06 encoded_data06
echo "running python decoder (from wiki_example):"
PYTHONPATH=../../lib/python ../wiki_example/example_decoder.py encoded_data06 LabComm2006
LCDIR=../..
LABCOMM_JAR=../../compiler/labcomm_compiler.jar
LABCOMM_JAR=../../compiler/labcomm2014_compiler.jar
LABCOMM=java -jar $(LABCOMM_JAR)
LCLJAR=${LCDIR}/lib/java/labcomm.jar # the LabComm library
LCLJAR=${LCDIR}/lib/java/labcomm2014.jar # the LabComm library
JAVA_PKG=labcommTCPtest
.PHONY : clean run runserver runOSserver runclient
......@@ -21,7 +21,7 @@ ${LABCOMM_JAR} :
cd ${LCDIR} && make make-compiler
${LCLJAR} :
cd ${LCDIR}/lib/java && make labcomm.jar
cd ${LCDIR}/lib/java && make labcomm2014.jar
${JAVA_PKG}/gen/FooSample.java: test.lc ${LCCJAR}
${LABCOMM} --javapackage=${JAVA_PKG}.gen --java=${JAVA_PKG}/gen $<
......
......@@ -5,9 +5,9 @@ import sys
import socket
import rwsocket
if not any('labcomm' in p for p in sys.path):
if not any('labcomm2014' in p for p in sys.path):
sys.path.append('../../lib/python')
import labcomm
import labcomm2014
if __name__ == "__main__":
......@@ -19,7 +19,7 @@ if __name__ == "__main__":
sock.connect(addr)
print "Connected!"
d = labcomm.Decoder(labcomm.StreamReader(sock))
d = labcomm2014.Decoder(labcomm2014.StreamReader(sock))
while True:
try:
......
......@@ -6,8 +6,8 @@ import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import se.lth.control.labcomm.DecoderChannel;
import se.lth.control.labcomm.EncoderChannel;
import se.lth.control.labcomm2014.DecoderChannel;
import se.lth.control.labcomm2014.EncoderChannel;
import labcommTCPtest.gen.FooSample;
import labcommTCPtest.gen.FooSample.Handler;
......
......@@ -6,8 +6,8 @@ import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import se.lth.control.labcomm.DecoderChannel;
import se.lth.control.labcomm.EncoderChannel;
import se.lth.control.labcomm2014.DecoderChannel;
import se.lth.control.labcomm2014.EncoderChannel;
import labcommTCPtest.gen.FooSample;
import labcommTCPtest.gen.FooSample.Handler;
......
......@@ -6,8 +6,8 @@ import java.io.OutputStream;
import java.net.Socket;
import java.net.ServerSocket;
import se.lth.control.labcomm.DecoderChannel;
import se.lth.control.labcomm.EncoderChannel;
import se.lth.control.labcomm2014.DecoderChannel;
import se.lth.control.labcomm2014.EncoderChannel;
import labcommTCPtest.gen.FooSample;
public class OneShotServer {//implements Handler {
......