Snapshot of partial implementation (support for receiving, not yet for sending signals) of multiplexing/parsing/server driver for lirc, based on https://github.com/Boukefalos/mimis

This commit is contained in:
2015-06-11 23:03:40 +01:00
commit 75a5bf262e
32 changed files with 1943 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package com.github.boukefalos.lirc.server;
import base.exception.worker.ActivateException;
import base.server.channel.TcpServer;
import com.github.boukefalos.lirc.Lirc;
import com.github.boukefalos.lirc.listen.ServerListen;
import com.github.boukefalos.server.helper.ServerHelper;
public class LircTcpServer extends TcpServer implements LircServer {
protected Lirc lirc;
protected ServerListen listen;
public LircTcpServer(Lirc lirc, int port, Class<?> clientClass) {
super(port, clientClass);
this.lirc = lirc;
listen = new ServerListen(this);
lirc.register(listen);
}
public void activate() throws ActivateException {
lirc.start();
listen.start();
super.activate();
}
public void receive(byte[] buffer) {
ServerHelper.receive(lirc, buffer);
}
}