code
stringlengths
3
1.18M
language
stringclasses
1 value
/** Automatically generated file. DO NOT MODIFY */ package home.remote.control; public final class BuildConfig { public final static boolean DEBUG = true; }
Java
package home.remote.control.util; import android.app.Activity; import android.os.Build; import android.view.View; /** * A utility class that helps with showing and hiding system UI such as the * status bar and navigation/system bar. This class uses backward-compatibility * techniques described in <a href= * "http...
Java
package home.remote.control.util; import android.app.Activity; import android.view.View; import android.view.WindowManager; /** * A base implementation of {@link SystemUiHider}. Uses APIs available in all * API levels to show and hide the status bar. */ public class SystemUiHiderBase extends SystemUiHider { /** ...
Java
package home.remote.control.util; import android.annotation.TargetApi; import android.app.Activity; import android.os.Build; import android.view.View; import android.view.WindowManager; /** * An API 11+ implementation of {@link SystemUiHider}. Uses APIs available in * Honeycomb and later (specifically {@link View#s...
Java
package home.remote.control; import home.remote.control.util.SystemUiHider; import android.annotation.TargetApi; import android.app.Activity; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.view.MotionEvent; import android.view.View; import a...
Java
package rangesensor; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalInput; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; import java.text.DecimalFormat; import java.text.Format; /**...
Java
package rangesensor; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalInput; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; import java.text.DecimalFormat; import java.text.Format; /**...
Java
package readserialport; import com.pi4j.io.serial.Serial; import com.pi4j.io.serial.SerialDataEvent; import com.pi4j.io.serial.SerialDataListener; import com.pi4j.io.serial.SerialFactory; /** * Just reads the GPS data. * No parsing, just raw data. */ public class GPSDataReader { public static void main(String ar...
Java
package nmea; import calculation.AstroComputer; import calculation.SightReductionUtil; import java.text.DecimalFormat; import java.util.Calendar; import java.util.TimeZone; import ocss.nmea.api.NMEAClient; import ocss.nmea.api.NMEAEvent; import ocss.nmea.api.NMEAListener; import ocss.nmea.parser.GeoPos; import ocss...
Java
package nmea; import com.pi4j.io.serial.Serial; import com.pi4j.io.serial.SerialDataEvent; import com.pi4j.io.serial.SerialDataListener; import com.pi4j.io.serial.SerialFactory; import java.util.List; import ocss.nmea.api.NMEAEvent; import ocss.nmea.api.NMEAListener; import ocss.nmea.api.NMEAReader; public class Cu...
Java
package nmea; import calculation.AstroComputer; import calculation.SightReductionUtil; import java.text.DecimalFormat; import java.util.Calendar; import java.util.List; import java.util.TimeZone; import ocss.nmea.api.NMEAClient; import ocss.nmea.api.NMEAEvent; import ocss.nmea.api.NMEAListener; import ocss.nmea.par...
Java
package nmea; import calculation.AstroComputer; import calculation.SightReductionUtil; import java.io.BufferedReader; import java.io.FileReader; import java.text.DecimalFormat; import java.util.Calendar; import java.util.TimeZone; import ocss.nmea.parser.GeoPos; import ocss.nmea.parser.RMC; import ocss.nmea.parser...
Java
package readserialport; import com.pi4j.io.serial.Serial; import com.pi4j.io.serial.SerialDataEvent; import com.pi4j.io.serial.SerialDataListener; import com.pi4j.io.serial.SerialFactory; import com.pi4j.io.serial.SerialPortException; import java.util.Date; public class SerialReader { public static void main(Strin...
Java
package relay; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; /** * 5v are required to drive the relay * The GPIO pins deliver 3.3v * To drive a relay, a relay board is re...
Java
package adc.gui; import adc.ADCObserver; import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JFrame; import javax.swing.SwingUtilities; import javax.swing.UIManager; public class AnalogDisplayApp { private ADCObserver.MCP3...
Java
package adc.gui; import adc.ADCObserver; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; public class AnalogDisplayFrame ...
Java
package adc; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalInput; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.Pin; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; /** * Read an Analog to Digital Convert...
Java
package adc; import java.util.ArrayList; import java.util.List; public class ADCContext { private static ADCContext instance = null; private List<ADCListener> listeners = null; private ADCContext() { listeners = new ArrayList<ADCListener>(); } public synchronized static ADCContext getInstance() ...
Java
package adc; public class ADCListener { public void valueUpdated(ADCObserver.MCP3008_input_channels channel, int newValue) {}; }
Java
package adc.sample; import adc.ADCContext; import adc.ADCListener; import adc.ADCObserver; import adc.utils.EscapeSeq; import org.fusesource.jansi.AnsiConsole; public class SampleMain { private final static boolean DEBUG = false; private final static String STR100 = " ...
Java
package adc.sample; import adc.ADCContext; import adc.ADCListener; import adc.ADCObserver; import java.io.FileOutputStream; import oracle.generic.ws.client.ClientFacade; import oracle.generic.ws.client.ServerListenerAdapter; import oracle.generic.ws.client.ServerListenerInterface; public class WebSocketFeeder { p...
Java
package adc.sample; import adc.ADCContext; import adc.ADCListener; import adc.ADCObserver; import java.io.BufferedWriter; import java.io.FileWriter; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.GregorianCalendar; import java.util.TimeZone; publi...
Java
package adc.sample.log; import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.ut...
Java
package adc.sample.log; import adc.sample.log.LogAnalysis.LogData; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.RenderingHints; import java.awt.Stroke; import java.awt.event.MouseEvent; import java.awt.event.MouseList...
Java
package adc.sample.log; import adc.ADCObserver; import adc.gui.AnalogDisplayApp; import adc.gui.AnalogDisplayPanel; import adc.sample.log.LogAnalysis.LogData; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Date; imp...
Java
package adc.sample; import adc.ADCContext; import adc.ADCListener; import adc.ADCObserver; import adc.utils.EscapeSeq; import org.fusesource.jansi.AnsiConsole; public class FiveChannelListener { private final static boolean DEBUG = false; private final static String STR100 = " ...
Java
package adc.utils; import org.fusesource.jansi.Ansi; import org.fusesource.jansi.AnsiConsole; public class EscapeSeq { public final static char ESC = '\u001b'; // (char) 27; public final static String ANSI_BLACK = "0"; public final static String ANSI_RED = "1"; public final static String ANSI_GREEN =...
Java
package analogdigitalconverter.mcp3008; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalInput; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.Pin; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; /** * Read a...
Java
package analogdigitalconverter.mcp3008.sample; import analogdigitalconverter.mcp3008.MCP3008Reader; import analogdigitalconverter.mcp3008.MCP3008Reader.MCP3008_input_channels; public class MainMCP3008Sample { private final static boolean DEBUG = false; private static boolean go = true; private static int ADC_CH...
Java
package analogdigitalconverter; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalInput; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.Pin; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; /** * Read an Analog...
Java
package dac.sample; import dac.mcp4725.AdafruitMCP4725; import java.io.IOException; public class DACSample { private static final int[] DACLookupFullSine9Bit = new int[] { 2048, 2073, 2098, 2123, 2148, 2174, 2199, 2224, 2249, 2274, 2299, 2324, 2349, 2373, 2398, 2423, 2448, 2472, 2497, 2521, 2546, 2570, 2...
Java
package dac.mcp4725; import com.pi4j.io.i2c.I2CBus; import com.pi4j.io.i2c.I2CDevice; import com.pi4j.io.i2c.I2CFactory; import java.io.IOException; public class AdafruitMCP4725 { public final static int MCP4725_ADDRESS = 0x62; // Can be changed with pin A0. A0 connected to VDD: 0x63 public final static int MCP...
Java
package sunservo; import org.fusesource.jansi.AnsiConsole; public class EscapeSeq { public final static char ESC = '\u001b'; // (char) 27; public final static String ANSI_BLACK = "0"; public final static String ANSI_RED = "1"; public final static String ANSI_GREEN = "2"; public final static String ...
Java
package gpio01; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; public class GPIO01led { public static void main(String[] args) throws InterruptedException { Syst...
Java
package gpio01; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; public class GPIO08led { public static void main(String[] args) throws InterruptedException { Syst...
Java
package gpio01; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; public class GPIO02led { public static void main(String[] args) throws InterruptedException { Syst...
Java
package gpio01; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; public class SpeedTest { public static void main(String[] args) throws InterruptedException { Syst...
Java
package rgbled; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; import java.io.BufferedReader; import java.io.InputStreamReader; public class RGBLed { private static final...
Java
package relay; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; public class RelayManager { private final GpioController gpio = GpioFactory.getInstance(); private final Gpi...
Java
package httpserver; import com.sun.speech.freetts.Voice; import com.sun.speech.freetts.VoiceManager; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.ServerSocket; import ja...
Java
package httpserver; import java.io.EOFException; import java.net.HttpURLConnection; import java.net.SocketException; import java.net.URL; public class SmallClient { public static void main(String[] args) throws Exception { int responseCode = 0; try { URL url = new URL("http://raspberrypi:9999/...
Java
package relay.gpio; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalInput; import com.pi4j.io.gpio.PinPullResistance; import com.pi4j.io.gpio.RaspiPin; import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent; import com.pi4j.io.gpio.event.GpioPinL...
Java
package relay.gpio; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.Pin; import com.pi4j.io.gpio.PinState; public class OneRelay { private GpioPinDigitalOutput led = null; private String name; public OneRelay(GpioController gpio, Pin pin, String ...
Java
package relay.gpio; import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent; public interface RaspberryPIEventListener { public void manageEvent(GpioPinDigitalStateChangeEvent event); }
Java
package relay; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import org.json.JSONObject; import relay.email.EmailReceiver; import relay.email.EmailSender; public class SampleMain { private final static SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss"); priva...
Java
package relay.email; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; import jav...
Java
package relay.email; import com.sun.mail.smtp.SMTPTransport; import java.io.FileInputStream; import java.util.Properties; import javax.activation.DataHandler; import javax.activation.DataSource; import javax.activation.FileDataSource; import javax.mail.BodyPart; import javax.mail.Message; import javax.mail.Messagi...
Java
package relay; import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent; import java.io.FileReader; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Properties; import org.json.JSONObject; import relay.email.EmailReceiver; import relay.email.EmailSender; impo...
Java
package relay; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; public class RelayManager { private final GpioController gpio = GpioFactory.getInstance(); private final Gpi...
Java
package ws; import adc.ADCContext; import adc.ADCListener; import adc.ADCObserver; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URI; import org.java_websocket.client.WebSocketClient; import org.java_websocket.handshake.ServerHandshake; impor...
Java
package adc; import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio.GpioFactory; import com.pi4j.io.gpio.GpioPinDigitalInput; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.Pin; import com.pi4j.io.gpio.PinState; import com.pi4j.io.gpio.RaspiPin; /** * Read an Analog to Digital Convert...
Java
package adc; import java.util.ArrayList; import java.util.List; public class ADCContext { private static ADCContext instance = null; private List<ADCListener> listeners = null; private ADCContext() { listeners = new ArrayList<ADCListener>(); } public synchronized static ADCContext getInstance() ...
Java
package adc; public class ADCListener { public void valueUpdated(ADCObserver.MCP3008_input_channels channel, int newValue) {}; }
Java
package adc.utils; import org.fusesource.jansi.Ansi; import org.fusesource.jansi.AnsiConsole; public class EscapeSeq { public final static char ESC = '\u001b'; // (char) 27; public final static String ANSI_BLACK = "0"; public final static String ANSI_RED = "1"; public final static String ANSI_GREEN =...
Java
/* Copyright [2011] [University of Rostock] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Java
/** * Server Application for Plugtest 2012, Paris, France * * Execute with argument Identifier (e.g., TD_COAP_CORE_01) */ package org.ws4d.coap.test; import java.util.logging.Level; import java.util.logging.Logger; import org.ws4d.coap.connection.BasicCoapChannelManager; import org.ws4d.coap.connection.BasicCoap...
Java
/** * Server Application for Plugtest 2012, Paris, France * * Execute with argument Identifier (e.g., TD_COAP_CORE_01) */ package org.ws4d.coap.test; import java.util.logging.Level; import java.util.logging.Logger; import org.ws4d.coap.connection.BasicCoapChannelManager; import org.ws4d.coap.connection.BasicCoap...
Java
/** * Client Application for Plugtest 2012, Paris, France * * Execute with argument Identifier (e.g., TD_COAP_CORE_01) */ package org.ws4d.coap.test; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.logging.Level; import java.util.logging.Logger; import org.ws4d.coap.connection...
Java
package org.ws4d.coap.connection; import java.net.InetAddress; public class ChannelKey { public InetAddress inetAddr; public int port; public ChannelKey(InetAddress inetAddr, int port) { this.inetAddr = inetAddr; this.port = port; } @Override public int hashCode() { final int prime = 31; ...
Java
/* Copyright [2011] [University of Rostock] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable...
Java
/* Copyright [2011] [University of Rostock] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Java
/* Copyright [2011] [University of Rostock] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Java
/* Copyright [2011] [University of Rostock] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Java
/* Copyright [2011] [University of Rostock] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Java
package org.ws4d.coap.tools; import java.util.Collection; import java.util.HashMap; import java.util.LinkedList; import java.util.Map; import java.util.Map.Entry; import java.util.Set; public class TimeoutHashMap<K, V> extends HashMap<Object, Object>{ private static final long serialVersionUID = 4987370276...
Java
package org.ws4d.coap.messages; import java.io.UnsupportedEncodingException; import java.util.Vector; import org.ws4d.coap.interfaces.CoapRequest; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public class BasicCoapRequest extends AbstractCoapMessage implements CoapRequest { CoapRequestCode...
Java
package org.ws4d.coap.messages; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public enum CoapResponseCode { Created_201(65), Deleted_202(66), Valid_203(67), Changed_204(68), Content_205(69), Bad_Request_400(128), Unauthorized_401(129), Bad_Option_402(130), Forbi...
Java
package org.ws4d.coap.messages; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public class CoapBlockOption{ private int number; private boolean more; private CoapBlockSize blockSize; public CoapBlockOption(byte[] data){ if (data.length <1 || data.length > 3){ throw...
Java
/* Copyright [2011] [University of Rostock] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Java
/* Copyright [2011] [University of Rostock] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Java
package org.ws4d.coap.messages; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public enum CoapMediaType { text_plain (0), //text/plain; charset=utf-8 link_format (40), //application/link-format xml(41), //application/xml octet_stream (42), //application/octet-stream exi(...
Java
package org.ws4d.coap.messages; import org.ws4d.coap.interfaces.CoapResponse; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public class BasicCoapResponse extends AbstractCoapMessage implements CoapResponse { CoapResponseCode responseCode; public BasicCoapResponse(byte[] bytes, int length)...
Java
package org.ws4d.coap.messages; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public class CoapEmptyMessage extends AbstractCoapMessage { public CoapEmptyMessage(byte[] bytes, int length){ this(bytes, length, 0); } public CoapEmptyMessage(byte[] bytes, int length, int offset){ serial...
Java
package org.ws4d.coap.messages; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public enum CoapRequestCode { GET(1), POST(2), PUT(3), DELETE(4); private int code; private CoapRequestCode(int code) { this.code = code; } public static CoapRequestCode parseRequestCode(int...
Java
package org.ws4d.coap.rest; import java.util.Vector; /** * A resource known from the REST architecture style. A resource has a type, * name and data associated with it. * * @author Nico Laum <nico.laum@uni-rostock.de> * @author Christian Lerche <christian.lerche@uni-rostock.de> * */ public interface Resourc...
Java
package org.ws4d.coap.rest; import org.ws4d.coap.interfaces.CoapChannel; import org.ws4d.coap.interfaces.CoapRequest; import org.ws4d.coap.messages.CoapMediaType; /** * @author Nico Laum <nico.laum@uni-rostock.de> * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public interface CoapResource extend...
Java
package org.ws4d.coap.rest; import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.net.URI; import java.net.URISyntaxException; import java.util.Enumeration; import java.util.HashMap; import java.util.Vector; import org.apache.log4j.ConsoleAppender; import org.apac...
Java
package org.ws4d.coap.rest; import java.util.HashMap; import java.util.Vector; import org.apache.log4j.Logger; import org.ws4d.coap.interfaces.CoapChannel; import org.ws4d.coap.interfaces.CoapRequest; import org.ws4d.coap.interfaces.CoapResponse; import org.ws4d.coap.interfaces.CoapServerChannel; import org.ws4d.coap...
Java
package org.ws4d.coap.rest; import java.util.HashMap; import java.util.Vector; import org.apache.log4j.Logger; import org.ws4d.coap.interfaces.CoapChannel; import org.ws4d.coap.interfaces.CoapRequest; import org.ws4d.coap.messages.CoapMediaType; /** * Well-Known CoRE support (draft-ietf-core-link-format-05) * *...
Java
package org.ws4d.coap.rest; import java.net.URI; /** * A ResourceServer provides network access to resources via a network protocol such as HTTP or CoAP. * * @author Nico Laum <nico.laum@uni-rostock.de> * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public interface ResourceServer { /** ...
Java
package org.ws4d.coap.rest; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public interface ResourceHandler { public void onPost(byte[] data); }
Java
/* Copyright [2011] [University of Rostock] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Java
package org.ws4d.coap.interfaces; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public interface CoapServer extends CoapChannelListener { public CoapServer onAccept(CoapRequest request); public void onRequest(CoapServerChannel channel, CoapRequest request); public void onSe...
Java
/* Copyright [2011] [University of Rostock] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Java
package org.ws4d.coap.interfaces; import java.util.Vector; import org.ws4d.coap.messages.CoapMediaType; import org.ws4d.coap.messages.CoapRequestCode; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public interface CoapRequest extends CoapMessage{ public void setUriHost(String host); ...
Java
package org.ws4d.coap.interfaces; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ import org.ws4d.coap.messages.CoapMediaType; import org.ws4d.coap.messages.CoapResponseCode; public interface CoapServerChannel extends CoapChannel { /* creates a normal response */ public CoapResponse cr...
Java
package org.ws4d.coap.interfaces; import org.ws4d.coap.messages.CoapRequestCode; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public interface CoapClientChannel extends CoapChannel { public CoapRequest createRequest(boolean reliable, CoapRequestCode requestCode); public v...
Java
package org.ws4d.coap.interfaces; import org.ws4d.coap.messages.CoapResponseCode; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public interface CoapResponse extends CoapMessage{ /* TODO: Response Code is part of BasicCoapResponse */ public CoapResponseCode getResponseCode(); public void ...
Java
package org.ws4d.coap.interfaces; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ import java.net.InetAddress; import org.ws4d.coap.messages.CoapBlockOption.CoapBlockSize; public interface CoapChannel { public void sendMessage(CoapMessage msg); /*TODO: close when finished, & ...
Java
/* Copyright [2011] [University of Rostock] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
Java
package org.ws4d.coap.interfaces; import java.net.InetAddress; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public interface CoapSocketHandler { // public void registerResponseListener(CoapResponseListener // responseListener); // public void unregisterResponseListener(CoapRespons...
Java
package org.ws4d.coap.interfaces; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public interface CoapChannelListener { }
Java
package org.ws4d.coap.interfaces; /** * @author Christian Lerche <christian.lerche@uni-rostock.de> */ public interface CoapClient extends CoapChannelListener { public void onResponse(CoapClientChannel channel, CoapResponse response); public void onConnectionFailed(CoapClientChannel channel, bool...
Java
package org.ws4d.coap.proxy; import org.apache.log4j.Logger; import org.ws4d.coap.messages.CoapMediaType; import org.ws4d.coap.rest.BasicCoapResource; public class ProxyResource extends BasicCoapResource { static Logger logger = Logger.getLogger(Proxy.class); private ProxyResourceKey key = null; p...
Java
package org.ws4d.coap.proxy; import java.util.Vector; import org.apache.log4j.Logger; import org.ws4d.coap.messages.CoapMediaType; import org.ws4d.coap.rest.BasicCoapResource; import org.ws4d.coap.rest.CoapResourceServer; public class ProxyRestInterface { static Logger logger = Logger.getLogger(Proxy.class); priva...
Java
/* * Copyright 2012 University of Rostock, Institute of Applied Microelectronics and Computer Engineering * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org...
Java
/* * Copyright 2012 University of Rostock, Institute of Applied Microelectronics and Computer Engineering * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org...
Java
/* * Copyright 2012 University of Rostock, Institute of Applied Microelectronics and Computer Engineering * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org...
Java
/* * Copyright 2012 University of Rostock, Institute of Applied Microelectronics and Computer Engineering * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org...
Java
/* * Copyright 2012 University of Rostock, Institute of Applied Microelectronics and Computer Engineering * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org...
Java